Fix crash on reminder id length+1
This commit is contained in:
parent
381903a72a
commit
233c7d43a2
1 changed files with 1 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue