diff --git a/commands/avataredit/3000years.js b/commands/avataredit/3000years.js index be80b929..63fed554 100644 --- a/commands/avataredit/3000years.js +++ b/commands/avataredit/3000years.js @@ -35,9 +35,9 @@ module.exports = class YearsCommand extends Command { const [avatar, years] = await Promise.all(images); avatar.resize(200, 200); years.blit(avatar, 461, 127); - years.getBuffer(Jimp.MIME_PNG, (err, buff) => { + return years.getBuffer(Jimp.MIME_PNG, (err, buff) => { if (err) return message.say(':x: Error! Something went wrong!'); - return message.channel.sendFile(buff); + return message.channel.send({file: buff}); }); } }; diff --git a/commands/avataredit/beautiful.js b/commands/avataredit/beautiful.js index a4b3c7dd..84aec717 100644 --- a/commands/avataredit/beautiful.js +++ b/commands/avataredit/beautiful.js @@ -37,9 +37,9 @@ module.exports = class BeautifulCommand extends Command { beautiful.blit(avatar, 432, 42); avatar.resize(190, 190); beautiful.blit(avatar, 451, 434); - beautiful.getBuffer(Jimp.MIME_PNG, (err, buff) => { + return beautiful.getBuffer(Jimp.MIME_PNG, (err, buff) => { if (err) return message.say(':x: Error! Something went wrong!'); - return message.channel.sendFile(buff); + return message.channel.send({file: buff}); }); } }; diff --git a/commands/avataredit/bobross.js b/commands/avataredit/bobross.js index a37aec56..fc13c255 100644 --- a/commands/avataredit/bobross.js +++ b/commands/avataredit/bobross.js @@ -39,9 +39,9 @@ module.exports = class BobRossCommand extends Command { avatar.resize(300, 300); nothing.composite(avatar, 44, 85); nothing.composite(bob, 0, 0); - nothing.getBuffer(Jimp.MIME_PNG, (err, buff) => { + return nothing.getBuffer(Jimp.MIME_PNG, (err, buff) => { if (err) return message.say(':x: Error! Something went wrong!'); - return message.channel.sendFile(buff); + return message.channel.send({file: buff}); }); } }; diff --git a/commands/avataredit/rip.js b/commands/avataredit/rip.js index a96774ae..6ff2b5d8 100644 --- a/commands/avataredit/rip.js +++ b/commands/avataredit/rip.js @@ -36,9 +36,9 @@ module.exports = class RIPCommand extends Command { const [avatar, gravestone] = await Promise.all(images); avatar.resize(200, 200); gravestone.blit(avatar, 60, 65); - gravestone.getBuffer(Jimp.MIME_PNG, (err, buff) => { + return gravestone.getBuffer(Jimp.MIME_PNG, (err, buff) => { if (err) return message.say(':x: Error! Something went wrong!'); - return message.channel.sendFile(buff); + return message.channel.send({file: buff}); }); } }; diff --git a/commands/avataredit/steamcard.js b/commands/avataredit/steamcard.js index 3c4aea4c..f986fe51 100644 --- a/commands/avataredit/steamcard.js +++ b/commands/avataredit/steamcard.js @@ -40,9 +40,9 @@ module.exports = class SteamCardCommand extends Command { nothing.composite(avatar, 25, 25); nothing.composite(steamcard, 0, 0); nothing.print(font, 38, 20, userDisplayName); - nothing.getBuffer(Jimp.MIME_PNG, (err, buff) => { + return nothing.getBuffer(Jimp.MIME_PNG, (err, buff) => { if (err) return message.say(':x: Error! Something went wrong!'); - return message.channel.sendFile(buff); + return message.channel.send({file: buff}); }); } }; diff --git a/commands/imageedit/meme.js b/commands/imageedit/meme.js index e3881681..1e0da124 100644 --- a/commands/imageedit/meme.js +++ b/commands/imageedit/meme.js @@ -58,6 +58,6 @@ module.exports = class MemeCommand extends Command { let bottomrow = args.bottomrow.replace(/[ ]/g, '-'); bottomrow = bottomrow.replace(/[?]/g, '~q'); const link = `https://memegen.link/${type}/${toprow}/${bottomrow}.jpg`; - return message.channel.sendFile(link).catch(() => message.say(':x: Error! Something went wrong!')); + return message.channel.send({file: link}).catch(() => message.say(':x: Error! Something went wrong!')); } }; diff --git a/commands/moderation/ban.js b/commands/moderation/ban.js index 72e9cb14..04034dbd 100644 --- a/commands/moderation/ban.js +++ b/commands/moderation/ban.js @@ -48,14 +48,14 @@ module.exports = class BanCommand extends Command { const reason = args.reason; if (!member.bannable) return message.say(':x: Error! This member cannot be banned! Perhaps they have a higher role than me?'); try { - await member.ban(); + await member.ban(7); await message.say(':ok_hand:'); const embed = new RichEmbed() .setAuthor(message.author.tag, message.author.avatarURL) .setColor(0xFF0000) .setTimestamp() .setDescription(`**Member:** ${member.user.tag} (${member.id})\n**Action:** Ban\n**Reason:** ${reason}`); - return message.guild.channels.find('name', 'mod_logs').sendEmbed(embed); + return message.guild.channels.find('name', 'mod_logs').send({embed}); } catch (err) { return message.say(':x: Error! Something went wrong!'); diff --git a/commands/moderation/kick.js b/commands/moderation/kick.js index d736c0d1..90be7b4f 100644 --- a/commands/moderation/kick.js +++ b/commands/moderation/kick.js @@ -52,7 +52,7 @@ module.exports = class KickCommand extends Command { .setColor(0xFFA500) .setTimestamp() .setDescription(`**Member:** ${member.user.tag} (${member.id})\n**Action:** Kick\n**Reason:** ${reason}`); - return message.guild.channels.find('name', 'mod_logs').sendEmbed(embed); + return message.guild.channels.find('name', 'mod_logs').send({embed}); } catch (err) { return message.say(':x: Error! Something went wrong!'); diff --git a/commands/moderation/unban.js b/commands/moderation/unban.js index c5094a68..3471cfcf 100644 --- a/commands/moderation/unban.js +++ b/commands/moderation/unban.js @@ -60,7 +60,7 @@ module.exports = class UnbanCommand extends Command { .setColor(0x00AE86) .setTimestamp() .setDescription(`**Member:** ${unbanUser.tag} (${unbanUser.id})\n**Action:** Unban\n**Reason:** ${reason}`); - return message.guild.channels.find('name', 'mod_logs').sendEmbed(embed); + return message.guild.channels.find('name', 'mod_logs').send({embed}); } catch (err) { return message.say(':x: Error! Something went wrong!'); diff --git a/commands/moderation/warn.js b/commands/moderation/warn.js index 20398f9d..3fb351eb 100644 --- a/commands/moderation/warn.js +++ b/commands/moderation/warn.js @@ -49,7 +49,7 @@ module.exports = class WarnCommand extends Command { .setColor(0xFFFF00) .setTimestamp() .setDescription(`**Member:** ${member.user.tag} (${member.id})\n**Action:** Warn\n**Reason:** ${reason}`); - return message.guild.channels.find('name', 'mod_logs').sendEmbed(embed); + return message.guild.channels.find('name', 'mod_logs').send({embed}); } catch (err) { return message.say(':x: Error! Something went wrong!'); diff --git a/commands/random/spam.js b/commands/random/spam.js index f937b157..bd4edfd8 100644 --- a/commands/random/spam.js +++ b/commands/random/spam.js @@ -16,6 +16,6 @@ module.exports = class SpamCommand extends Command { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission('ATTACH_FILES')) return message.say(':x: Error! I don\'t have the Attach Files Permission!'); } - return message.channel.sendFile('./images/Spam.jpg'); + return message.channel.send({file: './images/Spam.jpg'}); } }; diff --git a/commands/randomimg/cat.js b/commands/randomimg/cat.js index 1c811962..906f138a 100644 --- a/commands/randomimg/cat.js +++ b/commands/randomimg/cat.js @@ -18,6 +18,6 @@ module.exports = class CatCommand extends Command { } let cat = ['1.jpg', '2.jpg', '3.jpg', '4.jpg', '5.jpg', '6.jpg', '7.jpg', '8.jpg', '9.jpg', '10.jpg', '11.jpeg', '12.jpg', '13.jpeg', '14.png', '15.jpg', '16.jpg', '17.jpg', '18.jpg', '19.jpg', '20.jpg']; cat = cat[Math.floor(Math.random() * cat.length)]; - return message.channel.sendFile(`./images/Cat${cat}`); + return message.channel.send({file: `./images/Cat${cat}`}); } }; diff --git a/commands/randomimg/potato.js b/commands/randomimg/potato.js index eb956bbb..e35c04e4 100644 --- a/commands/randomimg/potato.js +++ b/commands/randomimg/potato.js @@ -21,6 +21,6 @@ module.exports = class PotatoCommand extends Command { } let potato = ['1.jpg', '2.jpg', '3.jpg', '4.jpg', '5.gif', '6.png', '7.jpg', '8.jpg', '9.jpg']; potato = potato[Math.floor(Math.random() * potato.length)]; - return message.channel.sendFile(`./images/Potato${potato}`); + return message.channel.send({file: `./images/Potato${potato}`}); } }; diff --git a/commands/randomimg/pun.js b/commands/randomimg/pun.js index 8c08124c..37dfa4f3 100644 --- a/commands/randomimg/pun.js +++ b/commands/randomimg/pun.js @@ -18,6 +18,6 @@ module.exports = class RandomPunCommand extends Command { } let pun = ['1.jpg', '2.jpg', '3.jpg', '4.jpg', '5.jpg', '6.jpg', '7.jpg', '8.png', '9.jpg', '10.jpg', '11.jpg', '12.jpg', '13.jpg', '14.jpg', '15.jpg', '16.jpg', '17.jpg', '18.jpg', '19.jpg', '20.jpg', '21.jpg', '22.jpg', '23.jpg', '24.jpg', '25.jpg', '26.jpg', '27.jpg', '28.jpg', '29.jpg', '30.jpeg', '31.jpg', '32.jpg', '33.jpg', '34.png', '35.jpg', '36.jpg', '37.jpg', '38.jpg', '39.jpg', '40.jpg', '41.jpg', '42.jpg', '43.jpg', '44.jpg', '45.gif', '46.jpg', '47.jpg', '48.jpg', '49.jpg', '50.jpg', '51.jpg', '52.jpg', '53.jpg']; pun = pun[Math.floor(Math.random() * pun.length)]; - return message.channel.sendFile(`./images/Pun${pun}`); + return message.channel.send({file: `./images/Pun${pun}`}); } }; diff --git a/commands/randomimg/xiaopai.js b/commands/randomimg/xiaopai.js index 8f329291..2ad29710 100644 --- a/commands/randomimg/xiaopai.js +++ b/commands/randomimg/xiaopai.js @@ -21,6 +21,6 @@ module.exports = class XiaoCommand extends Command { } let xiao = ['1.png', '2.jpg', '3.jpg', '4.jpg', '5.jpg', '6.jpg', '7.jpg', '8.png', '9.png', '10.png', '11.png', '12.png', '13.jpg', '14.jpg', '15.png', '16.jpg', '17.png', '18.gif', '19.png', '20.jpg', '21.jpg']; xiao = xiao[Math.floor(Math.random() * xiao.length)]; - return message.channel.sendFile(`./images/Xiao${xiao}`); + return message.channel.send({file: `./images/Xiao${xiao}`}); } }; diff --git a/commands/search/map.js b/commands/search/map.js index 9db0dd36..f9ab0680 100644 --- a/commands/search/map.js +++ b/commands/search/map.js @@ -40,7 +40,7 @@ module.exports = class MapCommand extends Command { try { const response = await snekfetch .get(`https://maps.googleapis.com/maps/api/staticmap?center=${location}&zoom=${zoom}&size=500x500&key=${process.env.GOOGLE_KEY}`); - return message.channel.sendFile(response.body); + return message.channel.send({file: response.body}); } catch (err) { return message.say(':x: Error! Something went wrong! Make sure you entered the location correctly!'); diff --git a/html/carbonuse.html b/html/carbonuse.html index 889a21ff..b906c790 100644 --- a/html/carbonuse.html +++ b/html/carbonuse.html @@ -12,7 +12,7 @@

Notes:

  1. Moderation Commands Require a Channel Named "mod_logs" to send Ban/Kick/Unban/Warn Logs
  2. -
  3. Use ;help to View a Command List
  4. +
  5. Use x;help to View a Command List
  6. Visit my Home Server for more support, or for updates, or if you just want to hang out.
diff --git a/html/discordbots.html b/html/discordbots.html index 304774e5..f77b4a26 100644 --- a/html/discordbots.html +++ b/html/discordbots.html @@ -55,7 +55,7 @@

Notes:

  1. Moderation Commands Require a Channel Named "mod_logs" to send Ban/Kick/Unban/Warn Logs
  2. -
  3. Use ;help to View a Command List
  4. +
  5. Use x;help to View a Command List
  6. Visit my Home Server for more support, or for updates, or if you just want to hang out.

Modules

diff --git a/index.js b/index.js index 722a5209..d47bc133 100644 --- a/index.js +++ b/index.js @@ -2,8 +2,7 @@ const commando = require('discord.js-commando'); const snekfetch = require('snekfetch'); const path = require('path'); const client = new commando.Client({ - commandPrefix: ';', - unknownCommandResponse: false, + commandPrefix: 'x;', owner: process.env.OWNER_ID, disableEveryone: true }); @@ -108,7 +107,7 @@ client.setTimeout(() => { client.on('ready', () => { console.log(`[Ready] Shard ${client.shard.id} Logged in!`); - client.user.setGame(`;help | Shard ${client.shard.id}`); + client.user.setGame(`x;help | Shard ${client.shard.id}`); }); process.on('unhandledRejection', console.error); diff --git a/package.json b/package.json index d17431d2..67ae230e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiaobot", - "version": "25.4.0", + "version": "26.0.0", "description": "A Discord Bot", "main": "shardingmanager.js", "scripts": { @@ -33,10 +33,10 @@ "discord.js": "hydrabolt/discord.js", "discord.js-commando": "gawdl3y/discord.js-commando", "jimp": "^0.2.27", - "mathjs": "^3.11.0", + "mathjs": "^3.11.5", "moment": "^2.18.1", "moment-duration-format": "^1.3.0", - "snekfetch": "^2.2.3", + "snekfetch": "^2.3.2", "zalgolize": "^1.2.4" } }