From 532cbea7ed034688e93cd4953e6c3f06b5e1d872 Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Tue, 29 Aug 2017 12:58:09 +0000 Subject: [PATCH] Remove Mod DM --- commands/moderation/ban.js | 10 +++------- commands/moderation/kick.js | 10 +++------- commands/moderation/softban.js | 10 +++------- commands/moderation/warn.js | 10 +++------- commands/util/setting-help.js | 2 -- 5 files changed, 12 insertions(+), 30 deletions(-) diff --git a/commands/moderation/ban.js b/commands/moderation/ban.js index 0b4c0b84..47f29c92 100644 --- a/commands/moderation/ban.js +++ b/commands/moderation/ban.js @@ -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 BanCommand extends Command { constructor(client) { @@ -49,16 +49,12 @@ module.exports = class BanCommand 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, 'banned') - .replace(/{{moderator}}/gi, msg.author.tag) - .replace(/{{server}}/gi, msg.guild.name); await member.send(stripIndents` - ${message || `You were banned from ${msg.guild.name} by ${msg.author.tag}!`} + You were banned from ${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 member.ban({ days: 7, diff --git a/commands/moderation/kick.js b/commands/moderation/kick.js index 819150cb..2edcc5be 100644 --- a/commands/moderation/kick.js +++ b/commands/moderation/kick.js @@ -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 KickCommand extends Command { constructor(client) { @@ -49,16 +49,12 @@ module.exports = class KickCommand 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, 'kicked') - .replace(/{{moderator}}/gi, msg.author.tag) - .replace(/{{server}}/gi, msg.guild.name); await member.send(stripIndents` - ${message || `You were kicked from ${msg.guild.name} by ${msg.author.tag}!`} + You were kicked from ${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 member.kick(`${msg.author.tag}: ${reason}`); await msg.say(`Successfully kicked ${member.user.tag}.`); diff --git a/commands/moderation/softban.js b/commands/moderation/softban.js index 4b20b0f5..bffe6c65 100644 --- a/commands/moderation/softban.js +++ b/commands/moderation/softban.js @@ -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 SoftbanCommand extends Command { constructor(client) { @@ -49,16 +49,12 @@ module.exports = class SoftbanCommand 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, 'softbanned') - .replace(/{{moderator}}/gi, msg.author.tag) - .replace(/{{server}}/gi, msg.guild.name); await member.send(stripIndents` - ${message || `You were softbanned from ${msg.guild.name} by ${msg.author.tag}!`} + You were softbanned from ${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 member.ban({ days: 7, diff --git a/commands/moderation/warn.js b/commands/moderation/warn.js index b0792e15..da5cab16 100644 --- a/commands/moderation/warn.js +++ b/commands/moderation/warn.js @@ -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')) { diff --git a/commands/util/setting-help.js b/commands/util/setting-help.js index de140021..6962b9d8 100644 --- a/commands/util/setting-help.js +++ b/commands/util/setting-help.js @@ -20,11 +20,9 @@ module.exports = class SettingHelpCommand extends Command { **Member Log Channel:** Place \`\` in a channel's topic. **Custom Join Message:** Place \`message\` in the Member Log's topic. **Custom Leave Message:** Place \`message\` in the Member Log's topic. - **Custom Mod DM:** Place \`message\` in the Mod Log's topic. __**Placeholders**__ **Join/Leave Message:** \`{{member}}\`, \`{{server}}\`, \`{{mention}}\` - **Mod DM:** \`{{action}}\`, \`{{server}}\`, \`{{moderator}}\` `); } };