diff --git a/commands/moderation/ban.js b/commands/moderation/ban.js index 6173755a..f168a692 100644 --- a/commands/moderation/ban.js +++ b/commands/moderation/ban.js @@ -47,12 +47,12 @@ module.exports = class BanCommand extends Command { if (!member.bannable) return msg.say('This member is not bannable. Perhaps they have a higher role than me?'); try { try { - await member.send(stripIndents` + await member.user.send(stripIndents` You were banned from ${msg.guild.name}! Reason: ${reason}. `); } catch (err) { - await msg.say('Failed to send DM to the user.'); + await msg.say('Failed to Send DM.'); } await member.ban({ days: 7, reason }); msg.say(':ok_hand:'); diff --git a/commands/moderation/kick.js b/commands/moderation/kick.js index cf4b9898..a4a6d0a3 100644 --- a/commands/moderation/kick.js +++ b/commands/moderation/kick.js @@ -46,12 +46,12 @@ module.exports = class KickCommand extends Command { if (!member.kickable) return msg.say('This member is not kickable. Perhaps they have a higher role than me?'); try { try { - await member.send(stripIndents` + await member.user.send(stripIndents` You were kicked from ${msg.guild.name}! Reason: ${reason}. `); } catch (err) { - await msg.say('Failed to send DM.'); + await msg.say('Failed to Send DM.'); } await member.kick({ reason }); msg.say(':ok_hand:'); diff --git a/commands/moderation/softban.js b/commands/moderation/softban.js index 26b1d02b..d7463104 100644 --- a/commands/moderation/softban.js +++ b/commands/moderation/softban.js @@ -46,15 +46,15 @@ module.exports = class SoftbanCommand extends Command { if (!modlogs.permissionsFor(this.client.user).has('EMBED_LINKS')) return msg.say('This Command requires the `Embed Links` Permission.'); const { member, reason } = args; - if (!member.bannable) return msg.say('This member is not bannable. Perhaps they have a higher role than me?'); + if (!member.bannable) return msg.say('This member is not softbannable. Perhaps they have a higher role than me?'); try { try { - await member.send(stripIndents` + await member.user.send(stripIndents` You were softbanned from ${msg.guild.name}! Reason: ${reason}. `); } catch (err) { - await msg.say('Failed to send DM to user.'); + await msg.say('Failed to Send DM.'); } await member.ban({ days: 7, reason }); await msg.guild.unban(member.user); diff --git a/commands/moderation/warn.js b/commands/moderation/warn.js index 490a1cf4..84b6e482 100644 --- a/commands/moderation/warn.js +++ b/commands/moderation/warn.js @@ -33,7 +33,7 @@ module.exports = class WarnCommand extends Command { return msg.member.hasPermission('KICK_MEMBERS') || msg.member.roles.has(msg.guild.settings.get('staffRole')); } - run(msg, args) { + async run(msg, args) { const modlogs = msg.guild.channels.get(msg.guild.settings.get('modLog')); if (!modlogs) return msg.say('This Command requires a channel set with the `modchannel` command.'); if (!modlogs.permissionsFor(this.client.user).has('SEND_MESSAGES')) @@ -41,6 +41,15 @@ module.exports = class WarnCommand extends Command { if (!modlogs.permissionsFor(this.client.user).has('EMBED_LINKS')) return msg.say('This Command requires the `Embed Links` Permission.'); const { member, reason } = args; + if (!member.kickable) return msg.say('This member is not warnable. Perhaps they have a higher role than me?'); + try { + await member.user.send(stripIndents` + You were warned in ${msg.guild.name}! + Reason: ${reason}. + `); + } catch (err) { + await msg.say('Failed to Send DM.'); + } msg.say(':ok_hand:'); const embed = new RichEmbed() .setAuthor(msg.author.tag, msg.author.displayAvatarURL) diff --git a/package.json b/package.json index d2bd3f5a..ff33747b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiaobot", - "version": "19.12.0", + "version": "19.12.1", "description": "A Discord Bot", "main": "shardingmanager.js", "scripts": {