Skip to content

Commit

Permalink
fix #3: ms(command[2]) is now trycatch
Browse files Browse the repository at this point in the history
  • Loading branch information
luphoria committed Apr 29, 2022
1 parent d15e11c commit f3d3b20
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/commands/mute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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."
}
Expand Down

0 comments on commit f3d3b20

Please sign in to comment.