Fix crash on reaction blocked

should fix #7
This commit is contained in:
Wroclaw 2023-07-23 06:28:56 +02:00
parent 31097e03ce
commit 13d8f73356

View file

@ -134,7 +134,7 @@ export async function queueRequest(request: apiRequest) {
if (userLimit !== false && userLimit.remaining <= 0) {
if (request instanceof DiscordApi.Message) {
request.react("🛑");
request.react("🛑").catch(/*it's okay*/);
if (!request.author.dmChannel) await request.author.createDM();
request.author.dmChannel?.send({
embeds: [{
@ -266,7 +266,7 @@ async function executeFromQueue(channel: string) {
response.then(rval => Moderation.checkMessage(rval));
}
else {
if (message instanceof DiscordApi.Message) message.react("😶");
if (message instanceof DiscordApi.Message) message.react("😶").catch(/*it's okay*/);
}
} catch (e) {
console.error(`Error ocurred while handling chat completion request (${(e as object).constructor.name}):`);