Compare commits
2 commits
0df05e2f06
...
13d8f73356
Author | SHA1 | Date | |
---|---|---|---|
13d8f73356 | |||
31097e03ce |
1 changed files with 5 additions and 3 deletions
|
@ -134,12 +134,14 @@ 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: [{
|
||||
color: 0xff0000,
|
||||
description: `You've used up your message limit for today, ${userLimit.limit} requests in last 24 hours`,
|
||||
description:
|
||||
"You've used up your message limit for today,\n" +
|
||||
`${userLimit.limit} requests in last 24 hours`,
|
||||
}]
|
||||
});
|
||||
}
|
||||
|
@ -264,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}):`);
|
||||
|
|
Loading…
Reference in a new issue