make user mentions not actually ping the user

This commit is contained in:
janderedev 2022-01-05 20:41:18 +01:00
parent 2e9570b6be
commit fc4aa66c8f
Signed by: Lea
GPG key ID: 5D5E18ACB990F57A
3 changed files with 9 additions and 9 deletions

View file

@ -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;

View file

@ -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;

View file

@ -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)));