Reformat using prettier
diff --git a/src/utils/dualCollector.ts b/src/utils/dualCollector.ts
index 0b05779..bf9b0c0 100644
--- a/src/utils/dualCollector.ts
+++ b/src/utils/dualCollector.ts
@@ -1,4 +1,13 @@
-import { ButtonInteraction, Client, User, Interaction, InteractionCollector, Message, MessageComponentInteraction, ModalSubmitInteraction } from "discord.js";
+import {
+ ButtonInteraction,
+ Client,
+ User,
+ Interaction,
+ InteractionCollector,
+ Message,
+ MessageComponentInteraction,
+ ModalSubmitInteraction
+} from "discord.js";
import client from "./client.js";
export default async function (
@@ -10,14 +19,15 @@
try {
out = await new Promise((resolve, _reject) => {
const mes = m
- .createMessageComponentCollector({
- filter: (m) => interactionFilter(m),
- time: 300000
- })
- .on("collect", (m) => {
+ .createMessageComponentCollector({
+ filter: (m) => interactionFilter(m),
+ time: 300000
+ })
+ .on("collect", (m) => {
resolve(m);
});
- const int = m.channel.createMessageCollector({
+ const int = m.channel
+ .createMessageCollector({
filter: (m) => messageFilter(m),
time: 300000
})
@@ -45,15 +55,15 @@
}
function defaultInteractionFilter(i: MessageComponentInteraction, user: User, m: Message) {
- return i.channel!.id === m.channel!.id && i.user.id === user.id
+ return i.channel!.id === m.channel!.id && i.user.id === user.id;
}
function defaultModalFilter(i: ModalSubmitInteraction, user: User, m: Message) {
- return i.channel!.id === m.channel!.id && i.user.id === user.id
+ return i.channel!.id === m.channel!.id && i.user.id === user.id;
}
-
export async function modalInteractionCollector(
- m: Message, user: User,
+ m: Message,
+ user: User,
modalFilter?: (i: Interaction) => boolean | Promise<boolean>,
interactionFilter?: (i: MessageComponentInteraction) => boolean | Promise<boolean>
): Promise<null | ButtonInteraction | ModalSubmitInteraction> {
@@ -62,7 +72,8 @@
out = await new Promise((resolve, _reject) => {
const int = m
.createMessageComponentCollector({
- filter: (i: MessageComponentInteraction) => (interactionFilter ? interactionFilter(i) : true) && defaultInteractionFilter(i, user, m),
+ filter: (i: MessageComponentInteraction) =>
+ (interactionFilter ? interactionFilter(i) : true) && defaultInteractionFilter(i, user, m),
time: 300000
})
.on("collect", async (i: ButtonInteraction) => {
@@ -72,7 +83,8 @@
resolve(i);
});
const mod = new InteractionCollector(client as Client, {
- filter: (i: Interaction) => (modalFilter ? modalFilter(i) : true) && i.isModalSubmit() && defaultModalFilter(i, user, m),
+ filter: (i: Interaction) =>
+ (modalFilter ? modalFilter(i) : true) && i.isModalSubmit() && defaultModalFilter(i, user, m),
time: 300000
}).on("collect", async (i: ModalSubmitInteraction) => {
int.stop();