Refactor out the common error handling in moderation
This commit is contained in:
parent
5a116b0531
commit
853bf183ee
2 changed files with 30 additions and 20 deletions
|
@ -231,7 +231,7 @@ async function executeFromQueue(channel: string) {
|
|||
|
||||
messages = messages.filter(m => message.createdTimestamp - m.createdTimestamp < config.limits.time );
|
||||
|
||||
messages.forEach(m => { Moderation.checkMessage(m); });
|
||||
messages.forEach(m => { Moderation.checkMessageNoReturn(m); });
|
||||
|
||||
if (message instanceof DiscordApi.Message) {
|
||||
await message.channel.sendTyping();
|
||||
|
@ -286,7 +286,7 @@ async function executeFromQueue(channel: string) {
|
|||
for (const i of answerMessagesContent) {
|
||||
const response = requestReply(message, {content: i}, {allowedMentions: { repliedUser: false }});
|
||||
|
||||
await response.then(rval => Moderation.checkMessage(rval));
|
||||
await response.then(rval => Moderation.checkMessageNoReturn(rval));
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue