From 95e44fb29388eff2c5f62311ad6341bc72349b84 Mon Sep 17 00:00:00 2001 From: Ibrahim Ansari Date: Sat, 17 Nov 2018 16:18:41 +0530 Subject: [PATCH] Fix eval and mute's timers and mute persists. --- server/bot/commands/admin/mute.ts | 4 ++-- server/bot/commands/tools.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/server/bot/commands/admin/mute.ts b/server/bot/commands/admin/mute.ts index a65b8c5..72308c1 100644 --- a/server/bot/commands/admin/mute.ts +++ b/server/bot/commands/admin/mute.ts @@ -99,10 +99,10 @@ export const handleMute: Command = { // Persist the mute. const guildID = message.member.guild.id if (!tempDB.mute[guildID]) tempDB.mute[guildID] = [] - tempDB.mute[guildID].push(user.id) + if (!tempDB.mute[guildID].includes(user.id)) tempDB.mute[guildID].push(user.id) // If time given, set timeout. try { - if (ms(args[0])) { + if (ms(args[0]) && ms(args[0]) <= 2073600000) { setTimeout(() => { try { // Remove the mute persist. diff --git a/server/bot/commands/tools.ts b/server/bot/commands/tools.ts index d2fae99..c744e34 100644 --- a/server/bot/commands/tools.ts +++ b/server/bot/commands/tools.ts @@ -131,7 +131,7 @@ export const handleEval: Command = { example: '/eval ```js\nconsole.log(\'ji\')\n```', requirements: { userIDs: [host] } }, - generator: async (message, args, { client, tempDB, db }) => { + generator: async (message, args, { client, tempDB, db, commandParser }) => { try { let toEval = args.join(' ') if (toEval.startsWith('```js')) toEval = toEval.substring(5)