mirror of
https://github.com/janderedev/automod.git
synced 2024-12-22 10:45:27 +00:00
make user mentions not actually ping the user
This commit is contained in:
parent
2e9570b6be
commit
fc4aa66c8f
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)));
|
||||
|
|
Loading…
Reference in a new issue