From f3d3b20be76e4deabd47fda1df5cdf6bd181ed6a Mon Sep 17 00:00:00 2001 From: Bread Date: Fri, 29 Apr 2022 17:12:24 -0500 Subject: [PATCH] fix #3: ms(command[2]) is now trycatch --- src/commands/mute.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/commands/mute.ts b/src/commands/mute.ts index a2290f1..600e3f3 100644 --- a/src/commands/mute.ts +++ b/src/commands/mute.ts @@ -55,8 +55,10 @@ export async function runMuteCommand( let user = command[1] || ""; // we default to an empty string because it causes non-fatal errors. let lookup; - let msToUnmute = ms(command[2]); - if(!msToUnmute) { + let msToUnmute; + try { + msToUnmute = ms(command[2]); + } catch { msToUnmute = ms("1d"); reason = command.slice(2).join(" ") || "No reason specified." }