From b17bd4033cd1f9db997b5619bde85af3ba4ce9a7 Mon Sep 17 00:00:00 2001 From: Alee Date: Thu, 26 Apr 2018 18:08:15 -0400 Subject: Embed in ban and kick --- commands/ban.js | 8 +++++++- commands/changelog.js | 2 +- commands/kick.js | 10 ++++++++-- storage/settings.json | 2 +- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/commands/ban.js b/commands/ban.js index cf8b14c..c1129de 100644 --- a/commands/ban.js +++ b/commands/ban.js @@ -18,13 +18,19 @@ * * *************************************/ module.exports.run = async (client, message, args) => { + const Discord = require('discord.js'); const mreason = args.join(" ").slice(22); if (!message.member.permissions.has('BAN_MEMBERS')) return message.reply("It looks like that you don't have the permissions to ban people.") if (!message.guild.member(client.user).hasPermission('BAN_MEMBERS')) return message.reply('Uhh... I don\'t have permission to ban members.'); const member = message.mentions.members.first(); if (!member) return message.reply("Uhh... Please mention a member first."); member.ban(`Banned by ${message.author.tag} Reason: ` + mreason); - message.reply(`**${member.user.tag}** has been banned for the reason: \n\`\`\`${mreason}.\`\`\`\n`); + const embed = new Discord.RichEmbed() + .setTitle('User Banned!') + .setColor('#1fd619') + .addField('**User:**', `${member.user.tag}`) + .addField('**Reason:**', `\`\`\`${mreason}\`\`\``) + await message.channel.send({ embed }); }; exports.conf = { diff --git a/commands/changelog.js b/commands/changelog.js index 2849d8d..cca1475 100644 --- a/commands/changelog.js +++ b/commands/changelog.js @@ -22,7 +22,7 @@ module.exports.run = async (client, message) => { const embed = new Discord.RichEmbed() .setAuthor('AleeBot ' + require('../storage/settings.json').abVersion + ' Changelog', 'https://cdn.discordapp.com/avatars/282547024547545109/6c147a444ae328c38145ef1f74169e38.png?size=2048') .setDescription('What\'s new in AleeBot '+ require('../storage/settings.json').abVersion +'?') - .addField('1. Console commands!', 'Unfortunately they are not discord features but it\'s only for console.') + .addField('1. Minor changes in ban and kick!', 'We now have embeds in ban and kick...') .setColor('#1fd619'); message.channel.send({embed}); diff --git a/commands/kick.js b/commands/kick.js index 63904c1..2cf596e 100644 --- a/commands/kick.js +++ b/commands/kick.js @@ -18,14 +18,20 @@ * * *************************************/ module.exports.run = async (client, message, args) => { + const Discord = require('discord.js'); const mreason = args.join(" ").slice(22); if (!message.member.permissions.has('KICK_MEMBERS')) return message.reply("It looks like that you don't have the permissions to ban people."); if (!message.guild.member(client.user).hasPermission('KICK_MEMBERS')) return message.reply('Uhh... I don\'t have permission to kick members.'); const member = message.mentions.members.first(); if (!member) return message.reply("Uhh... Please mention a member first."); member.kick(`Kicked by: ${message.author.tag} Reason: ` + mreason); - message.reply(`**${member.user.tag}** has been kicked for the reason: \n\`\`\`${mreason}.\`\`\`\n`); -}; + const embed = new Discord.RichEmbed() + .setTitle('User Kicked!') + .setColor('#1fd619') + .addField('**User:**', `${member.user.tag}`) + .addField('**Reason:**', `\`\`\`${mreason}\`\`\``) + await message.channel.send({ embed }); + }; exports.conf = { aliases: [], diff --git a/storage/settings.json b/storage/settings.json index c223b8a..0f4bfae 100644 --- a/storage/settings.json +++ b/storage/settings.json @@ -1,4 +1,4 @@ { - "abVersion": "2.9.1", + "abVersion": "2.9.2", "prefix": "ab:" } -- cgit v1.2.3