diff --git a/config.example.ts b/config.example.ts index 4fe791e..f2232de 100644 --- a/config.example.ts +++ b/config.example.ts @@ -1,6 +1,6 @@ export const config = { "name": "Group Up", // Name of the bot - "version": "0.5.4", // Version of the bot + "version": "0.5.5", // Version of the bot "token": "the_bot_token", // Discord API Token for this bot "localtoken": "local_testing_token", // Discord API Token for a secondary OPTIONAL testing bot, THIS MUST BE DIFFERENT FROM "token" "prefix": "gu!", // Prefix for all commands diff --git a/mod.ts b/mod.ts index c54dbd9..0b5915c 100644 --- a/mod.ts +++ b/mod.ts @@ -163,13 +163,13 @@ startBot({ // Handle messages not starting with the prefix if (message.content.indexOf(prefix) !== 0) { // Mentions - if (message.mentionedUserIds[0] === botId && message.content.trim().startsWith(`<@!${botId}>`)) { + if (message.mentionedUserIds[0] === botId && (message.content.trim().startsWith(`<@${botId}>`) || message.content.trim().startsWith(`<@!${botId}>`))) { // Light telemetry to see how many times a command is being run await dbClient.execute(`CALL INC_CNT("prefix");`).catch(e => { log(LT.ERROR, `Failed to call stored procedure INC_CNT: ${jsonStringifyBig(e)}`); }); - if (message.content.trim() === `<@!${botId}>`) { + if (message.content.trim() === `<@${botId}>` || message.content.trim() === `<@!${botId}>`) { message.send({ embeds: [{ title: `Hello ${message.member?.username}, and thanks for using Group Up!`, @@ -186,7 +186,7 @@ startBot({ } else if (await hasGuildPermissions(message.guildId, message.authorId, ["ADMINISTRATOR"])) { - const newPrefix = message.content.replace(`<@!${botId}>`, "").trim(); + const newPrefix = message.content.replace(`<@!${botId}>`, "").replace(`<@${botId}>`, "").trim(); if (newPrefix.length <= 10) { let success = true;