From 1c3084c2eed942a9efeb779694cdd77a72f90c47 Mon Sep 17 00:00:00 2001 From: Alee Date: Sat, 24 Mar 2018 22:56:20 -0400 Subject: Added purge and say + 2.3 release --- src/bot_discord.js | 4 ++-- src/commands/changelog.js | 8 ++++---- src/commands/help.js | 2 +- src/commands/purge.js | 21 +++++++++++++++++++++ src/commands/say.js | 18 ++++++++++++++++++ 5 files changed, 46 insertions(+), 7 deletions(-) create mode 100644 src/commands/purge.js create mode 100644 src/commands/say.js (limited to 'src') diff --git a/src/bot_discord.js b/src/bot_discord.js index 4fd4791..055049c 100644 --- a/src/bot_discord.js +++ b/src/bot_discord.js @@ -7,8 +7,8 @@ **********************************************/ const Discord = require('discord.js'); const client = new Discord.Client(); -const abVersion = '2.2.0'; -const prefix = 'ab:'; +const abVersion = '2.3.0'; +const prefix = 'abb:'; const fs = require('fs'); const config = require('./absettings.json'); console.log('Welcome to AleeBot NodeJS Terminal!'); diff --git a/src/commands/changelog.js b/src/commands/changelog.js index be41192..2c69bb0 100644 --- a/src/commands/changelog.js +++ b/src/commands/changelog.js @@ -1,10 +1,10 @@ module.exports.run = async (client, message) => { const Discord = require('discord.js'); const embed = new Discord.RichEmbed() - .setAuthor('AleeBot ' + '2.2.0 ' + 'Changelog', 'https://cdn.discordapp.com/avatars/282547024547545109/6c147a444ae328c38145ef1f74169e38.png?size=2048') - .setDescription('What\'s new in AleeBot 2.2?') - .addField('[>] Music Command!','ab:play [music or url]', true) - .addField('[>] Moderation Commands!','Kick and Ban has been added!', true) + .setAuthor('AleeBot ' + '2.3.0 ' + 'Changelog', 'https://cdn.discordapp.com/avatars/282547024547545109/6c147a444ae328c38145ef1f74169e38.png?size=2048') + .setDescription('What\'s new in AleeBot 2.3?') + .addField('[>] Purge Command!','Purge command only for moderators!', true) + .addField('[>] Say Command!','Say command is only for the person who created the bot!', true) .setFooter('AleeCorp Copyright 2017') .setColor('#1fd619'); message.channel.sendEmbed(embed); diff --git a/src/commands/help.js b/src/commands/help.js index 690c91c..4033289 100644 --- a/src/commands/help.js +++ b/src/commands/help.js @@ -11,7 +11,7 @@ module.exports.run = async (client, message) => { const embed = new Discord.RichEmbed() .setTitle('AleeBot Help') - .setAuthor('AleeBot 2.2.0' + ` Help and on ${client.guilds.size} servers`, 'https://cdn.discordapp.com/avatars/282547024547545109/6c147a444ae328c38145ef1f74169e38.png?size=2048') + .setAuthor('AleeBot 2.3.0' + ` Help and on ${client.guilds.size} servers`, 'https://cdn.discordapp.com/avatars/282547024547545109/6c147a444ae328c38145ef1f74169e38.png?size=2048') .setDescription('Every command you input into AleeBot is `' + require('../absettings.json').prefix + '`') .setColor('#1fd619') .setFooter('AleeCorp Copyright 2018'); diff --git a/src/commands/purge.js b/src/commands/purge.js new file mode 100644 index 0000000..36a0803 --- /dev/null +++ b/src/commands/purge.js @@ -0,0 +1,21 @@ +module.exports.run = async (client, message, args) => { + if (!message.member.permissions.has('MANAGE_MESSAGES')) return message.reply("It looks like that you don't have the permissions to delete messages.") + if (isNaN(args[0])) return message.reply("Please put the valid number of messages to purge."); + + if (args[0] > 100) return message.channel.send("Please put a number less than 100."); + + message.channel.bulkDelete(args[0]) + .then( messages => message.channel.send(`Successfully deleted ${messages.size} messages.`)) + }; + + exports.conf = { + aliases: ['rm'], + guildOnly: false, + }; + exports.help = { + name: 'purge', + description: 'Removes messages in a bulk.', + usage: 'purge [number]', + category: '- Moderation Commands', + }; + \ No newline at end of file diff --git a/src/commands/say.js b/src/commands/say.js new file mode 100644 index 0000000..2e6c918 --- /dev/null +++ b/src/commands/say.js @@ -0,0 +1,18 @@ +module.exports.run = async (client, message, args) => { + if (!['242775871059001344',].includes(message.author.id)) return message.reply('Nope! You need the person who created this bot to use this command.'); + let absay = args.join(" "); + message.delete().catch(); + message.reply(absay); + }; + + exports.conf = { + aliases: [], + guildOnly: false, + }; + exports.help = { + name: 'say', + description: 'You can control AleeBot now!', + usage: 'say [context]', + category: '- Owners Only', + }; + \ No newline at end of file -- cgit v1.2.3