From 29318592b0d8978035fed11d6c9fd737102e285d Mon Sep 17 00:00:00 2001 From: Wroclaw Date: Mon, 18 Sep 2023 12:44:55 +0200 Subject: [PATCH] Execution: Don't execute the summon command if bot is writing already fixes #14 --- src/execution.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/execution.ts b/src/execution.ts index d42fafb..32e4f1e 100644 --- a/src/execution.ts +++ b/src/execution.ts @@ -177,6 +177,23 @@ export async function queueRequest(request: apiRequest) { 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); if (userLimit !== false && userLimit.remaining <= 0) {