From fc4aa66c8f840a0d708f95c5bd8597f266fc8c80 Mon Sep 17 00:00:00 2001 From: janderedev Date: Wed, 5 Jan 2022 20:41:18 +0100 Subject: [PATCH] make user mentions not actually ping the user --- src/bot/commands/bot_managers.ts | 6 +++--- src/bot/commands/moderator.ts | 6 +++--- src/bot/commands/whitelist.ts | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/bot/commands/bot_managers.ts b/src/bot/commands/bot_managers.ts index 15f88c0..dc5f39e 100644 --- a/src/bot/commands/bot_managers.ts +++ b/src/bot/commands/bot_managers.ts @@ -33,7 +33,7 @@ export default { admins.push(user._id); await client.db.get('servers').update({ id: message.serverContext._id }, { $set: { botManagers: admins } }); - message.reply(`✅ Added \`@${user.username}\` to bot admins.`); + message.reply(`✅ Added [@${user.username}](/@${user._id}) to bot admins.`); break; case 'remove': case 'delete': @@ -48,14 +48,14 @@ export default { admins = admins.filter(a => a != user?._id); await client.db.get('servers').update({ id: message.serverContext._id }, { $set: { botManagers: admins } }); - message.reply(`✅ Removed \`@${user.username}\` from bot admins.`); + message.reply(`✅ Removed [@${user.username}](/@${user._id}) from bot admins.`); break; case 'list': case 'ls': case 'show': message.reply(`# Bot admins\n` + `Users with **ManageServer** permission can add or remove admins.\n\n` - + `${admins.map(a => `* <@${a}>`).join('\n')}\n\n` + + `${admins.map(a => `* [@${client.users.get(a)?.username ?? a}](/@${a})`).join('\n')}\n\n` + `${admins.length} user${admins.length == 1 ? '' : 's'}.`) ?.catch(e => message.reply(e)); break; diff --git a/src/bot/commands/moderator.ts b/src/bot/commands/moderator.ts index 820ad29..751a270 100644 --- a/src/bot/commands/moderator.ts +++ b/src/bot/commands/moderator.ts @@ -35,7 +35,7 @@ export default { mods.push(user._id); await client.db.get('servers').update({ id: message.serverContext._id }, { $set: { moderators: mods } }); - message.reply(`✅ Added \`@${user.username}\` to moderators.`); + message.reply(`✅ Added [@${user.username}](/@${user._id}) to moderators.`); break; case 'remove': case 'delete': @@ -50,14 +50,14 @@ export default { mods = mods.filter(a => a != user?._id); await client.db.get('servers').update({ id: message.serverContext._id }, { $set: { moderators: mods } }); - message.reply(`✅ Removed \`@${user.username}\` from moderators.`); + message.reply(`✅ Removed [@${user.username}](/@${user._id}) from moderators.`); break; case 'list': case 'ls': case 'show': message.reply(`# Moderators\n` + `Bot admins can add or remove moderators.\n\n` - + `${mods.map(a => `* <@${a}>`).join('\n')}\n\n` + + `${mods.map(a => `* [${client.users.get(a)?.username ?? a}](/@${a})`).join('\n')}\n\n` + `${mods.length} user${mods.length == 1 ? '' : 's'}.`) ?.catch(e => message.reply(e)); break; diff --git a/src/bot/commands/whitelist.ts b/src/bot/commands/whitelist.ts index f315e25..bf80cae 100644 --- a/src/bot/commands/whitelist.ts +++ b/src/bot/commands/whitelist.ts @@ -88,12 +88,12 @@ export default { if (config.whitelist.users?.length) { config.whitelist.users?.forEach((u, index) => { - if (index < 15) str += `* <@${u}>\n`; + if (index < 15) str += `* [@${client.users.get(u)?.username || u}](/@${u})\n`; if (index == 15) str += `**${index - 15} more user${config.whitelist?.users?.length == 16 ? '' : 's'}**\n`; }); } else str += `**No whitelisted users**\n`; - str += `\u200b\n### Roles\n`; + str += `### Roles\n`; if (config.whitelist.roles?.length) { config.whitelist.roles @@ -104,7 +104,7 @@ export default { }); } else str += `**No whitelisted roles**\n`; - str += `\u200b\nAdmins and bot managers: **${config.whitelist.managers === false ? 'No' : 'Yes'}**`; + str += `\nAdmins and bot managers: **${config.whitelist.managers === false ? 'No' : 'Yes'}**`; message.reply(str) ?.catch(e => message.reply(String(e)));