Skip to content

Commit

Permalink
parse the error message
Browse files Browse the repository at this point in the history
  • Loading branch information
horrible-little-slime committed Nov 16, 2023
1 parent c8e06a0 commit 2a9acfd
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/commands/misc/itom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@ async function onMessage(message: Message) {
try {
await message.react("<:minusone:748016030357520464>");
} catch (error) {
discordClient.alert(
`Tried to :minusone: a message containing the forbidden string by ${message.author}; received error ${error}.`,
);
await message.member?.kick("You mess with the oaf, you get the boot");
const stringedError = `${error}`;
if (stringedError.includes("Reaction blocked")) {
await message.member?.kick("You mess with the bot, you get the boot");
} else {
discordClient.alert(
`Tried to :minusone: a message containing the forbidden string by ${message.author}; received error ${error}.`,
);
}
}
}
}
Expand Down

0 comments on commit 2a9acfd

Please sign in to comment.