mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-20 05:51:35 +02:00
Remove Mod DM
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const { stripIndents } = require('common-tags');
|
||||
const { filterTopics, parseTopic } = require('../../structures/Util');
|
||||
const { filterTopics } = require('../../structures/Util');
|
||||
|
||||
module.exports = class WarnCommand extends Command {
|
||||
constructor(client) {
|
||||
@@ -48,16 +48,12 @@ module.exports = class WarnCommand extends Command {
|
||||
});
|
||||
if (!msgs.size || !['y', 'yes'].includes(msgs.first().content.toLowerCase())) return msg.say('Aborting.');
|
||||
try {
|
||||
const message = parseTopic(modlogs.topic, 'modmessage')
|
||||
.replace(/{{action}}/gi, 'warned')
|
||||
.replace(/{{moderator}}/gi, msg.author.tag)
|
||||
.replace(/{{server}}/gi, msg.guild.name);
|
||||
await member.send(stripIndents`
|
||||
${message || `You were warned in ${msg.guild.name} by ${msg.author.tag}!`}
|
||||
You were warned in ${msg.guild.name} by ${msg.author.tag}!
|
||||
**Reason:** ${reason}
|
||||
`);
|
||||
} catch (err) {
|
||||
await msg.say('Failed to Send DM.');
|
||||
await msg.say('Failed to send DM.');
|
||||
}
|
||||
await msg.say(`Successfully warned ${member.user.tag}.`);
|
||||
if (!modlogs || !modlogs.permissionsFor(this.client.user).has('SEND_MESSAGES')) {
|
||||
|
||||
Reference in New Issue
Block a user