diff --git a/commands/ssps/rozvrh.js b/commands/ssps/rozvrh.js index 0fa5e81..7000036 100644 --- a/commands/ssps/rozvrh.js +++ b/commands/ssps/rozvrh.js @@ -73,7 +73,7 @@ module.exports = class rozvrh extends commando.Command { for(const scell of cells) { embed.addField(scell.subject.abbrev, `\`${api.formatRoom(scell.roomId) || "?"}\` - ${scell.teacher.name} - **${scell.group.name}**`, cells.length > 1); } - if(cells.length > 1 && schedule[cellI + 1].length > 1) embed.addField("\u200B", "\u200B", true); + if(cells.length > 1 && schedule[cellI + 1]?.length > 1) embed.addField("\u200B", "\u200B", true); } return msg.say(embed); diff --git a/commands/ssps/suplovani.js b/commands/ssps/suplovani.js index 2b6af9b..d0c0497 100644 --- a/commands/ssps/suplovani.js +++ b/commands/ssps/suplovani.js @@ -34,6 +34,7 @@ module.exports = class suplovani extends commando.Command { if(!changes.has(t.Hour)) changes.set(t.Hour, []); changes.set(t.Hour, [...changes.get(t.Hour), `(\`${t.Subject}\`) **${t.ChgType1}** ${t.Group ? "(sk. " + t.Group + ")" : ""} ${t.Room ? "v `" + api.formatRoom(t.Room) + "`" : ""}`]); } + if(!change.Class.Abbrev) continue; embed.addField(change.Class.Abbrev, [...changes.entries()].map(t => `**${t[0]}**. h.: ${t[1].map(t => t.trim()).join("; ")}`) || "Žádná změna", true