feat: require mention

This commit is contained in:
Pihkaal
2025-06-27 18:51:42 +02:00
parent fce089c319
commit 91965f1b47

View File

@@ -47,7 +47,9 @@ const askForGrinders = async (quest: QuestResult) => {
});
const filter = (msg: Message) =>
msg.channel.id === channel.id && !msg.author.bot;
msg.channel.id === channel.id &&
!msg.author.bot &&
msg.content.startsWith(`<@${client.user!.id}>`);
let confirmed = false;
let answer: string | null = null;
@@ -55,6 +57,7 @@ const askForGrinders = async (quest: QuestResult) => {
const collected = await channel.awaitMessages({ filter, max: 1 });
answer = collected.first()?.content || null;
if (!answer) continue;
answer = answer.replace(`<@${client.user!.id}>`, "");
const players = answer
.split(",")
@@ -125,7 +128,7 @@ client.on("messageCreate", async (message) => {
if (message.author.bot) return;
if (message.content.startsWith(`<@${client.user!.id}>`)) {
await message.reply("Ok");
await message.reply("tg");
}
});