intermediate update
diff --git a/src/utils/confirmationMessage.ts b/src/utils/confirmationMessage.ts
index 4d90676..613b48c 100644
--- a/src/utils/confirmationMessage.ts
+++ b/src/utils/confirmationMessage.ts
@@ -257,7 +257,7 @@
cancelled = true;
continue;
}
- if (out === null) {
+ if (out === null || out.isButton()) {
cancelled = true;
continue;
}
diff --git a/src/utils/convertCurlyBracketString.ts b/src/utils/convertCurlyBracketString.ts
index 5d2c23d..058ba16 100644
--- a/src/utils/convertCurlyBracketString.ts
+++ b/src/utils/convertCurlyBracketString.ts
@@ -13,7 +13,7 @@
.replace("{member:mention}", memberID ? `<@${memberID}>` : "{member:mention}")
.replace("{member:name}", memberName ? `${memberName}` : "{member:name}")
.replace("{serverName}", serverName ? `${serverName}` : "{serverName}")
- .replace("{memberCount}", memberCount ? `${memberCount}` : "{memberCount}")
+ .replace("{memberCount:all}", memberCount ? `${memberCount}` : "{memberCount}")
.replace("{memberCount:bots}", bots ? `${bots}` : "{memberCount:bots}")
.replace("{memberCount:humans}", memberCount && bots ? `${memberCount - bots}` : "{memberCount:humans}");
diff --git a/src/utils/dualCollector.ts b/src/utils/dualCollector.ts
index 714a2d9..3c2b5d9 100644
--- a/src/utils/dualCollector.ts
+++ b/src/utils/dualCollector.ts
@@ -1,4 +1,4 @@
-import Discord, { Client, Interaction, Message, MessageComponentInteraction } from "discord.js";
+import Discord, { ButtonInteraction, Client, Interaction, InteractionCollector, Message, MessageComponentInteraction, ModalSubmitInteraction } from "discord.js";
import client from "./client.js";
export default async function (
@@ -49,8 +49,8 @@
m: Message,
modalFilter: (i: Interaction) => boolean | Promise<boolean>,
interactionFilter: (i: MessageComponentInteraction) => boolean | Promise<boolean>
-): Promise<null | Interaction> {
- let out: Interaction;
+): Promise<null | ButtonInteraction | ModalSubmitInteraction> {
+ let out: ButtonInteraction | ModalSubmitInteraction;
try {
out = await new Promise((resolve, _reject) => {
const int = m
@@ -58,22 +58,17 @@
filter: (i: MessageComponentInteraction) => interactionFilter(i),
time: 300000
})
- .on("collect", (i: Interaction) => {
+ .on("collect", (i: ButtonInteraction) => {
+ mod.stop();
resolve(i);
});
- const mod = new Discord.InteractionCollector(client as Client, {
+ const mod = new InteractionCollector(client as Client, {
filter: (i: Interaction) => modalFilter(i),
time: 300000
- }).on("collect", async (i: Interaction) => {
+ }).on("collect", async (i: ModalSubmitInteraction) => {
int.stop();
- (i as Discord.ModalSubmitInteraction).deferUpdate();
- resolve(i as Discord.ModalSubmitInteraction);
- });
- int.on("end", () => {
- mod.stop();
- });
- mod.on("end", () => {
- int.stop();
+ await i.deferUpdate();
+ resolve(i);
});
});
} catch (e) {
diff --git a/src/utils/log.ts b/src/utils/log.ts
index 54f656a..184f29a 100644
--- a/src/utils/log.ts
+++ b/src/utils/log.ts
@@ -29,7 +29,8 @@
if (typeof value === "number") value = value.toString();
return { value: value, displayValue: displayValue };
},
- renderChannel(channel: Discord.GuildChannel | Discord.ThreadChannel) {
+ renderChannel(channel: Discord.GuildChannel | Discord.ThreadChannel | string) {
+ if (typeof channel === "string") channel = client.channels.cache.get(channel) as Discord.GuildChannel | Discord.ThreadChannel;
return `${channel.name} [<#${channel.id}>]`;
},
renderRole(role: Discord.Role) {