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); admins.push(user._id);
await client.db.get('servers').update({ id: message.serverContext._id }, { $set: { botManagers: admins } }); 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; break;
case 'remove': case 'remove':
case 'delete': case 'delete':
@ -48,14 +48,14 @@ export default {
admins = admins.filter(a => a != user?._id); admins = admins.filter(a => a != user?._id);
await client.db.get('servers').update({ id: message.serverContext._id }, { $set: { botManagers: admins } }); 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; break;
case 'list': case 'list':
case 'ls': case 'ls':
case 'show': case 'show':
message.reply(`# Bot admins\n` message.reply(`# Bot admins\n`
+ `Users with **ManageServer** permission can add or remove admins.\n\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'}.`) + `${admins.length} user${admins.length == 1 ? '' : 's'}.`)
?.catch(e => message.reply(e)); ?.catch(e => message.reply(e));
break; break;

View file

@ -35,7 +35,7 @@ export default {
mods.push(user._id); mods.push(user._id);
await client.db.get('servers').update({ id: message.serverContext._id }, { $set: { moderators: mods } }); 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; break;
case 'remove': case 'remove':
case 'delete': case 'delete':
@ -50,14 +50,14 @@ export default {
mods = mods.filter(a => a != user?._id); mods = mods.filter(a => a != user?._id);
await client.db.get('servers').update({ id: message.serverContext._id }, { $set: { moderators: mods } }); 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; break;
case 'list': case 'list':
case 'ls': case 'ls':
case 'show': case 'show':
message.reply(`# Moderators\n` message.reply(`# Moderators\n`
+ `Bot admins can add or remove moderators.\n\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'}.`) + `${mods.length} user${mods.length == 1 ? '' : 's'}.`)
?.catch(e => message.reply(e)); ?.catch(e => message.reply(e));
break; break;

View file

@ -88,12 +88,12 @@ export default {
if (config.whitelist.users?.length) { if (config.whitelist.users?.length) {
config.whitelist.users?.forEach((u, index) => { 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`; if (index == 15) str += `**${index - 15} more user${config.whitelist?.users?.length == 16 ? '' : 's'}**\n`;
}); });
} else str += `**No whitelisted users**\n`; } else str += `**No whitelisted users**\n`;
str += `\u200b\n### Roles\n`; str += `### Roles\n`;
if (config.whitelist.roles?.length) { if (config.whitelist.roles?.length) {
config.whitelist.roles config.whitelist.roles
@ -104,7 +104,7 @@ export default {
}); });
} else str += `**No whitelisted roles**\n`; } 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) message.reply(str)
?.catch(e => message.reply(String(e))); ?.catch(e => message.reply(String(e)));