Skip to content

Commit

Permalink
catch discord errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Techbot121 authored and Meta Construct committed Nov 21, 2023
1 parent d4c031d commit 0a3813a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions app/services/discord/modules/shitposting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,12 @@ export default async (bot: DiscordBot) => {
allowedMentions: options.ping ? { repliedUser: true } : { repliedUser: false },
});
} else {
await bot.getTextChannel(bot.config.channels.chat)?.send(shat);
await bot
.getTextChannel(bot.config.channels.chat)
?.send(shat)
.catch(e => {
console.error(e, shat, options);
});
}
}
posting = false;
Expand Down Expand Up @@ -345,7 +350,7 @@ export default async (bot: DiscordBot) => {
if (mk) {
lastReactionUserId = user.id;
lastRespondedReactionMsgs.push(reaction.message.id);
await reaction.message.channel.send(`${user.mention} ` + mk);
await reaction.message.channel.send(`${user.mention} ` + mk).catch();
}
}
});
Expand Down Expand Up @@ -409,7 +414,7 @@ export default async (bot: DiscordBot) => {
originalMsg: msg.reference ? await msg.fetchReference() : undefined,
ping: true,
}
);
).catch(console.error);
if (isChatChannel) replied = true;
} else {
msg.react(getRandomEmoji());
Expand Down

0 comments on commit 0a3813a

Please sign in to comment.