3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-15 05:41:51 +00:00

Fix crash on reminder id length+1

This commit is contained in:
Dark 2020-07-29 01:42:16 +02:00
parent 381903a72a
commit 233c7d43a2

View file

@ -14,9 +14,8 @@ export const RemindersDeleteCmd = remindersCommand({
async run({ message: msg, args, pluginData }) {
const reminders = await pluginData.state.reminders.getRemindersByUserId(msg.author.id);
reminders.sort(sorter("remind_at"));
const lastNum = reminders.length + 1;
if (args.num > lastNum || args.num <= 0) {
if (args.num > reminders.length || args.num <= 0) {
sendErrorMessage(pluginData, msg.channel, "Unknown reminder");
return;
}