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:
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 }) {
|
async run({ message: msg, args, pluginData }) {
|
||||||
const reminders = await pluginData.state.reminders.getRemindersByUserId(msg.author.id);
|
const reminders = await pluginData.state.reminders.getRemindersByUserId(msg.author.id);
|
||||||
reminders.sort(sorter("remind_at"));
|
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");
|
sendErrorMessage(pluginData, msg.channel, "Unknown reminder");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue