Execution: Don't execute the summon command if bot is writing already

fixes #14
This commit is contained in:
Wroclaw 2023-09-18 12:44:55 +02:00
parent b6eb476162
commit 29318592b0

View file

@ -177,6 +177,23 @@ export async function queueRequest(request: apiRequest) {
if (!canReplyToRequest(request)) return; if (!canReplyToRequest(request)) return;
if (!(request instanceof DiscordApi.Message) && channelsRunning.get(request.channelId)?.length !== 0) {
requestReply(
request as RequestMessage,
{
embeds: [{
color: 0xb000ff,
description: "I'm already typing here, please wait!",
}]
},
{},
{
ephemeral: true,
},
)
return;
}
const userLimit = await getUserLimit(getAuthor(request), request.createdAt); const userLimit = await getUserLimit(getAuthor(request), request.createdAt);
if (userLimit !== false && userLimit.remaining <= 0) { if (userLimit !== false && userLimit.remaining <= 0) {