From aeeb2d0924628fcbd4ed404eb03c40d2b53f584c Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Wed, 26 Apr 2017 17:31:15 +0000 Subject: [PATCH] Fix Error --- commands/avataredit/3000years.js | 2 +- commands/avataredit/beautiful.js | 2 +- commands/avataredit/bobross.js | 2 +- commands/avataredit/rip.js | 2 +- commands/avataredit/steamcard.js | 2 +- commands/games/mathgame.js | 2 +- commands/games/quiz.js | 2 +- commands/games/typinggame.js | 2 +- commands/guildinfo/guildinfo.js | 2 +- commands/imageedit/meme.js | 2 +- commands/moderation/ban.js | 6 +++--- commands/moderation/kick.js | 6 +++--- commands/moderation/lockdown.js | 4 ++-- commands/moderation/prune.js | 6 +++--- commands/moderation/unban.js | 6 +++--- commands/moderation/warn.js | 4 ++-- commands/random/nitro.js | 2 +- commands/random/spam.js | 2 +- commands/random/today.js | 2 +- commands/random/wouldyourather.js | 2 +- commands/randomimg/cat.js | 2 +- commands/randomimg/potato.js | 2 +- commands/randomimg/pun.js | 2 +- commands/randomimg/xiaopai.js | 2 +- commands/search/botinfo.js | 2 +- commands/search/define.js | 2 +- commands/search/discrim.js | 2 +- commands/search/forecast.js | 2 +- commands/search/imdb.js | 2 +- commands/search/map.js | 2 +- commands/search/osu.js | 2 +- commands/search/soundcloud.js | 2 +- commands/search/urban.js | 2 +- commands/search/wattpad.js | 2 +- commands/search/weather.js | 2 +- commands/search/wikipedia.js | 2 +- commands/search/youtube.js | 2 +- commands/search/yugioh.js | 2 +- commands/textedit/embed.js | 2 +- commands/textedit/say.js | 2 +- commands/textedit/webhook.js | 2 +- commands/userinfo/userinfo.js | 2 +- commands/util/info.js | 2 +- commands/util/shardinfo.js | 2 +- package.json | 2 +- 45 files changed, 55 insertions(+), 55 deletions(-) diff --git a/commands/avataredit/3000years.js b/commands/avataredit/3000years.js index 724c550f..0db3f99a 100644 --- a/commands/avataredit/3000years.js +++ b/commands/avataredit/3000years.js @@ -21,7 +21,7 @@ module.exports = class YearsCommand extends Command { async run(message, args) { if (message.channel.type !== 'dm') - if (!message.channel.permissionsFor(this.client.user).permissions.has('ATTACH_FILES')) + if (!message.channel.permissionsFor(this.client.user).hasPermission('ATTACH_FILES')) return message.say('This Command requires the `Attach Files` Permission.'); const { user } = args; const userAvatar = user.displayAvatarURL.replace('.jpg', '.png').replace('.gif', '.png'); diff --git a/commands/avataredit/beautiful.js b/commands/avataredit/beautiful.js index bd299264..07852324 100644 --- a/commands/avataredit/beautiful.js +++ b/commands/avataredit/beautiful.js @@ -21,7 +21,7 @@ module.exports = class BeautifulCommand extends Command { async run(message, args) { if (message.channel.type !== 'dm') - if (!message.channel.permissionsFor(this.client.user).permissions.has('ATTACH_FILES')) + if (!message.channel.permissionsFor(this.client.user).hasPermission('ATTACH_FILES')) return message.say('This Command requires the `Attach Files` Permission.'); const { user } = args; const userAvatar = user.displayAvatarURL.replace('.jpg', '.png').replace('.gif', '.png'); diff --git a/commands/avataredit/bobross.js b/commands/avataredit/bobross.js index 6b06ad07..c9b142be 100644 --- a/commands/avataredit/bobross.js +++ b/commands/avataredit/bobross.js @@ -21,7 +21,7 @@ module.exports = class BobRossCommand extends Command { async run(message, args) { if (message.channel.type !== 'dm') - if (!message.channel.permissionsFor(this.client.user).permissions.has('ATTACH_FILES')) + if (!message.channel.permissionsFor(this.client.user).hasPermission('ATTACH_FILES')) return message.say('This Command requires the `Attach Files` Permission.'); const { user } = args; const userAvatar = user.displayAvatarURL.replace('.jpg', '.png').replace('.gif', '.png'); diff --git a/commands/avataredit/rip.js b/commands/avataredit/rip.js index a36b0a21..bde914d2 100644 --- a/commands/avataredit/rip.js +++ b/commands/avataredit/rip.js @@ -22,7 +22,7 @@ module.exports = class RIPCommand extends Command { async run(message, args) { if (message.channel.type !== 'dm') - if (!message.channel.permissionsFor(this.client.user).permissions.has('ATTACH_FILES')) + if (!message.channel.permissionsFor(this.client.user).hasPermission('ATTACH_FILES')) return message.say('This Command requires the `Attach Files` Permission.'); const { user } = args; const userAvatar = user.displayAvatarURL.replace('.jpg', '.png').replace('.gif', '.png'); diff --git a/commands/avataredit/steamcard.js b/commands/avataredit/steamcard.js index 81aee99b..c4da6983 100644 --- a/commands/avataredit/steamcard.js +++ b/commands/avataredit/steamcard.js @@ -21,7 +21,7 @@ module.exports = class SteamCardCommand extends Command { async run(message, args) { if (message.channel.type !== 'dm') - if (!message.channel.permissionsFor(this.client.user).permissions.has('ATTACH_FILES')) + if (!message.channel.permissionsFor(this.client.user).hasPermission('ATTACH_FILES')) return message.say('This Command requires the `Attach Files` Permission.'); const { user } = args; const username = message.guild ? message.guild.member(user).displayName : user.username; diff --git a/commands/games/mathgame.js b/commands/games/mathgame.js index 22ee0441..5b9e3fc9 100644 --- a/commands/games/mathgame.js +++ b/commands/games/mathgame.js @@ -26,7 +26,7 @@ module.exports = class MathGameCommand extends Command { async run(message, args) { if (message.channel.type !== 'dm') - if (!message.channel.permissionsFor(this.client.user).permissions.has('EMBED_LINKS')) + if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say('This Command requires the `Embed Links` Permission.'); const { difficulty } = args; const operation = operations[Math.floor(Math.random() * operations.length)]; diff --git a/commands/games/quiz.js b/commands/games/quiz.js index 906bcafb..84d4170c 100644 --- a/commands/games/quiz.js +++ b/commands/games/quiz.js @@ -17,7 +17,7 @@ module.exports = class QuizCommand extends Command { async run(message) { if (message.channel.type !== 'dm') - if (!message.channel.permissionsFor(this.client.user).permissions.has('EMBED_LINKS')) + if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say('This Command requires the `Embed Links` Permission.'); try { const { body } = await request diff --git a/commands/games/typinggame.js b/commands/games/typinggame.js index f3fb4460..2bd70814 100644 --- a/commands/games/typinggame.js +++ b/commands/games/typinggame.js @@ -25,7 +25,7 @@ module.exports = class TypingGameCommand extends Command { async run(message, args) { if (message.channel.type !== 'dm') - if (!message.channel.permissionsFor(this.client.user).permissions.has('EMBED_LINKS')) + if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say('This Command requires the `Embed Links` Permission.'); const { difficulty } = args; const sentence = sentences[Math.floor(Math.random() * sentences.length)]; diff --git a/commands/guildinfo/guildinfo.js b/commands/guildinfo/guildinfo.js index 0227fd2e..eaf065d6 100644 --- a/commands/guildinfo/guildinfo.js +++ b/commands/guildinfo/guildinfo.js @@ -20,7 +20,7 @@ module.exports = class GuildInfoCommand extends Command { } run(message) { - if (!message.channel.permissionsFor(this.client.user).permissions.has('EMBED_LINKS')) + if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say('This Command requires the `Embed Links` Permission.'); const embed = new RichEmbed() .setColor(0x00AE86) diff --git a/commands/imageedit/meme.js b/commands/imageedit/meme.js index c10c895b..8142eacd 100644 --- a/commands/imageedit/meme.js +++ b/commands/imageedit/meme.js @@ -45,7 +45,7 @@ module.exports = class MemeCommand extends Command { run(message, args) { if (message.channel.type !== 'dm') - if (!message.channel.permissionsFor(this.client.user).permissions.has('ATTACH_FILES')) + if (!message.channel.permissionsFor(this.client.user).hasPermission('ATTACH_FILES')) return message.say('This Command requires the `Attach Files` Permission.'); const { type, toprow, bottomrow } = args; return message.channel.send({files: [`https://memegen.link/${type}/${toprow}/${bottomrow}.jpg`]}) diff --git a/commands/moderation/ban.js b/commands/moderation/ban.js index f76ca617..ef4fd58a 100644 --- a/commands/moderation/ban.js +++ b/commands/moderation/ban.js @@ -31,16 +31,16 @@ module.exports = class BanCommand extends Command { } hasPermission(msg) { - return msg.member.permissions.has('BAN_MEMBERS'); + return msg.member.hasPermission('BAN_MEMBERS'); } async run(message, args) { - if (!message.channel.permissionsFor(this.client.user).permissions.has('BAN_MEMBERS')) + if (!message.channel.permissionsFor(this.client.user).hasPermission('BAN_MEMBERS')) return message.say('This Command requires the `Ban Members` Permission.'); const modlogs = message.guild.channels.find('name', 'mod_logs'); if (!modlogs) return message.say('This Command requires a channel named `mod_logs`.'); - if (!modlogs.permissionsFor(this.client.user).permissions.has('EMBED_LINKS')) + if (!modlogs.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say('This Command requires the `Embed Links` Permission.'); const { member, reason } = args; if (!member.bannable) diff --git a/commands/moderation/kick.js b/commands/moderation/kick.js index 2e8a368f..ff6ad3f0 100644 --- a/commands/moderation/kick.js +++ b/commands/moderation/kick.js @@ -28,16 +28,16 @@ module.exports = class KickCommand extends Command { } hasPermission(msg) { - return msg.member.permissions.has('KICK_MEMBERS'); + return msg.member.hasPermission('KICK_MEMBERS'); } async run(message, args) { - if (!message.channel.permissionsFor(this.client.user).permissions.has('KICK_MEMBERS')) + if (!message.channel.permissionsFor(this.client.user).hasPermission('KICK_MEMBERS')) return message.say('This Command requires the `Kick Members` Permission.'); const modlogs = message.guild.channels.find('name', 'mod_logs'); if (!modlogs) return message.say('This Command requires a channel named `mod_logs`.'); - if (!modlogs.permissionsFor(this.client.user).permissions.has('EMBED_LINKS')) + if (!modlogs.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say('This Command requires the `Embed Links` Permission.'); const { member, reason } = args; if (!member.kickable) diff --git a/commands/moderation/lockdown.js b/commands/moderation/lockdown.js index 4a3e2513..1cf9644b 100644 --- a/commands/moderation/lockdown.js +++ b/commands/moderation/lockdown.js @@ -23,11 +23,11 @@ module.exports = class LockdownCommand extends Command { } hasPermission(msg) { - return msg.member.permissions.has('ADMINISTRATOR'); + return msg.member.hasPermission('ADMINISTRATOR'); } async run(message, args) { - if (!message.channel.permissionsFor(this.client.user).permissions.has('ADMINISTRATOR')) + if (!message.channel.permissionsFor(this.client.user).hasPermission('ADMINISTRATOR')) return message.say('This Command requires the `Administrator` Permission.'); const { type } = args; if (type === 'start') { diff --git a/commands/moderation/prune.js b/commands/moderation/prune.js index 15e2483f..0e13c53e 100644 --- a/commands/moderation/prune.js +++ b/commands/moderation/prune.js @@ -26,13 +26,13 @@ module.exports = class PruneCommand extends Command { } hasPermission(msg) { - return msg.member.permissions.has('MANAGE_MESSAGES'); + return msg.member.hasPermission('MANAGE_MESSAGES'); } async run(message, args) { - if (!message.channel.permissionsFor(this.client.user).permissions.has('READ_MESSAGE_HISTORY')) + if (!message.channel.permissionsFor(this.client.user).hasPermission('READ_MESSAGE_HISTORY')) return message.say('This Command requires the `Read Message History` Permission.'); - if (!message.channel.permissionsFor(this.client.user).permissions.has('MANAGE_MESSAGES')) + if (!message.channel.permissionsFor(this.client.user).hasPermission('MANAGE_MESSAGES')) return message.say('This Command requires the `Manage Messages` Permission.'); let { count } = args; count = count + 1; diff --git a/commands/moderation/unban.js b/commands/moderation/unban.js index 3f221e17..07ef3923 100644 --- a/commands/moderation/unban.js +++ b/commands/moderation/unban.js @@ -35,16 +35,16 @@ module.exports = class UnbanCommand extends Command { } hasPermission(msg) { - return msg.member.permissions.has('BAN_MEMBERS'); + return msg.member.hasPermission('BAN_MEMBERS'); } async run(message, args) { - if (!message.channel.permissionsFor(this.client.user).permissions.has('BAN_MEMBERS')) + if (!message.channel.permissionsFor(this.client.user).hasPermission('BAN_MEMBERS')) return message.say('This Command requires the `Ban Members` Permission.'); const modlogs = message.guild.channels.find('name', 'mod_logs'); if (!modlogs) return message.say('This Command requires a channel named `mod_logs`.'); - if (!modlogs.permissionsFor(this.client.user).permissions.has('EMBED_LINKS')) + if (!modlogs.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say('This Command requires the `Embed Links` Permission.'); const { memberID, reason } = args; const bans = await message.guild.fetchBans(); diff --git a/commands/moderation/warn.js b/commands/moderation/warn.js index f0be3f28..c50cb7d1 100644 --- a/commands/moderation/warn.js +++ b/commands/moderation/warn.js @@ -27,14 +27,14 @@ module.exports = class WarnCommand extends Command { } hasPermission(msg) { - return msg.member.permissions.has('MANAGE_MESSAGES'); + return msg.member.hasPermission('MANAGE_MESSAGES'); } async run(message, args) { const modlogs = message.guild.channels.find('name', 'mod_logs'); if (!modlogs) return message.say('This Command requires a channel named `mod_logs`.'); - if (!modlogs.permissionsFor(this.client.user).permissions.has('EMBED_LINKS')) + if (!modlogs.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say('This Command requires the `Embed Links` Permission.'); const { member, reason } = args; try { diff --git a/commands/random/nitro.js b/commands/random/nitro.js index 2339f2e0..0e5d2e06 100644 --- a/commands/random/nitro.js +++ b/commands/random/nitro.js @@ -13,7 +13,7 @@ module.exports = class NitroCommand extends Command { run(message) { if (message.channel.type !== 'dm') - if (!message.channel.permissionsFor(this.client.user).permissions.has('EMBED_LINKS')) + if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say('This Command requires the `Embed Links` Permission.'); const embed = new RichEmbed() .setAuthor('Discord Nitro') diff --git a/commands/random/spam.js b/commands/random/spam.js index 81d87931..de4f85de 100644 --- a/commands/random/spam.js +++ b/commands/random/spam.js @@ -12,7 +12,7 @@ module.exports = class SpamCommand extends Command { run(message) { if (message.channel.type !== 'dm') - if (!message.channel.permissionsFor(this.client.user).permissions.has('ATTACH_FILES')) + if (!message.channel.permissionsFor(this.client.user).hasPermission('ATTACH_FILES')) return message.say('This Command requires the `Attach Files` Permission.'); return message.channel.send({files: ['./images/Spam.jpg']}); } diff --git a/commands/random/today.js b/commands/random/today.js index 4e03508f..ade22acc 100644 --- a/commands/random/today.js +++ b/commands/random/today.js @@ -14,7 +14,7 @@ module.exports = class TodayCommand extends Command { async run(message) { if (message.channel.type !== 'dm') - if (!message.channel.permissionsFor(this.client.user).permissions.has('EMBED_LINKS')) + if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say('This Command requires the `Embed Links` Permission.'); try { const { text } = await request diff --git a/commands/random/wouldyourather.js b/commands/random/wouldyourather.js index ab45a728..c751bdca 100644 --- a/commands/random/wouldyourather.js +++ b/commands/random/wouldyourather.js @@ -17,7 +17,7 @@ module.exports = class WouldYouRatherCommand extends Command { async run(message) { if (message.channel.type !== 'dm') - if (!message.channel.permissionsFor(this.client.user).permissions.has('EMBED_LINKS')) + if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say('This Command requires the `Embed Links` Permission.'); try { const { body } = await request diff --git a/commands/randomimg/cat.js b/commands/randomimg/cat.js index 178bc0ff..24f9b36e 100644 --- a/commands/randomimg/cat.js +++ b/commands/randomimg/cat.js @@ -16,7 +16,7 @@ module.exports = class CatCommand extends Command { run(message) { if (message.channel.type !== 'dm') - if (!message.channel.permissionsFor(this.client.user).permissions.has('ATTACH_FILES')) + if (!message.channel.permissionsFor(this.client.user).hasPermission('ATTACH_FILES')) return message.say('This Command requires the `Attach Files` Permission.'); const cat = cats[Math.floor(Math.random() * cats.length)]; return message.channel.send({files: [`./images/Cat${cat}`]}); diff --git a/commands/randomimg/potato.js b/commands/randomimg/potato.js index d29e9719..58714822 100644 --- a/commands/randomimg/potato.js +++ b/commands/randomimg/potato.js @@ -16,7 +16,7 @@ module.exports = class PotatoCommand extends Command { run(message) { if (message.channel.type !== 'dm') - if (!message.channel.permissionsFor(this.client.user).permissions.has('ATTACH_FILES')) + if (!message.channel.permissionsFor(this.client.user).hasPermission('ATTACH_FILES')) return message.say('This Command requires the `Attach Files` Permission.'); const potato = potatoes[Math.floor(Math.random() * potatoes.length)]; return message.channel.send({files: [`./images/Potato${potato}`]}); diff --git a/commands/randomimg/pun.js b/commands/randomimg/pun.js index 75681d56..93191b44 100644 --- a/commands/randomimg/pun.js +++ b/commands/randomimg/pun.js @@ -13,7 +13,7 @@ module.exports = class RandomPunCommand extends Command { run(message) { if (message.channel.type !== 'dm') - if (!message.channel.permissionsFor(this.client.user).permissions.has('ATTACH_FILES')) + if (!message.channel.permissionsFor(this.client.user).hasPermission('ATTACH_FILES')) return message.say('This Command requires the `Attach Files` Permission.'); const pun = puns[Math.floor(Math.random() * puns.length)]; return message.channel.send({files: [`./images/Pun${pun}`]}); diff --git a/commands/randomimg/xiaopai.js b/commands/randomimg/xiaopai.js index 38a38bdb..2af74b27 100644 --- a/commands/randomimg/xiaopai.js +++ b/commands/randomimg/xiaopai.js @@ -16,7 +16,7 @@ module.exports = class XiaoCommand extends Command { run(message) { if (message.channel.type !== 'dm') - if (!message.channel.permissionsFor(this.client.user).permissions.has('ATTACH_FILES')) + if (!message.channel.permissionsFor(this.client.user).hasPermission('ATTACH_FILES')) return message.say('This Command requires the `Attach Files` Permission.'); const xiao = xiaos[Math.floor(Math.random() * xiaos.length)]; return message.channel.send({files: [`./images/Xiao${xiao}`]}); diff --git a/commands/search/botinfo.js b/commands/search/botinfo.js index 38927692..545130c0 100644 --- a/commands/search/botinfo.js +++ b/commands/search/botinfo.js @@ -19,7 +19,7 @@ module.exports = class BotSearchCommand extends Command { async run(message, args) { if (message.channel.type !== 'dm') - if (!message.channel.permissionsFor(this.client.user).permissions.has('EMBED_LINKS')) + if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say('This Command requires the `Embed Links` Permission.'); let { bot } = args; bot = bot.id; diff --git a/commands/search/define.js b/commands/search/define.js index 14cac68a..37b76c85 100644 --- a/commands/search/define.js +++ b/commands/search/define.js @@ -20,7 +20,7 @@ module.exports = class DefineCommand extends Command { async run(message, args) { if (message.channel.type !== 'dm') - if (!message.channel.permissionsFor(this.client.user).permissions.has('EMBED_LINKS')) + if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say('This Command requires the `Embed Links` Permission.'); const { word } = args; try { diff --git a/commands/search/discrim.js b/commands/search/discrim.js index 97b7640d..0775fc61 100644 --- a/commands/search/discrim.js +++ b/commands/search/discrim.js @@ -27,7 +27,7 @@ module.exports = class DiscrimCommand extends Command { async run(message, args) { if (message.channel.type !== 'dm') - if (!message.channel.permissionsFor(this.client.user).permissions.has('EMBED_LINKS')) + if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say('This Command requires the `Embed Links` Permission.'); const { discrim } = args; const users = await this.client.users.filter(u => u.discriminator === discrim).map(u => u.username).sort(); diff --git a/commands/search/forecast.js b/commands/search/forecast.js index a8e9ba88..3dcf0d7d 100644 --- a/commands/search/forecast.js +++ b/commands/search/forecast.js @@ -19,7 +19,7 @@ module.exports = class ForecastCommand extends Command { async run(message, args) { if (message.channel.type !== 'dm') - if (!message.channel.permissionsFor(this.client.user).permissions.has('EMBED_LINKS')) + if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say('This Command requires the `Embed Links` Permission.'); const { location } = args; try { diff --git a/commands/search/imdb.js b/commands/search/imdb.js index 21d8af47..81936fca 100644 --- a/commands/search/imdb.js +++ b/commands/search/imdb.js @@ -20,7 +20,7 @@ module.exports = class IMDBCommand extends Command { async run(message, args) { if (message.channel.type !== 'dm') - if (!message.channel.permissionsFor(this.client.user).permissions.has('EMBED_LINKS')) + if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say('This Command requires the `Embed Links` Permission.'); const { movie } = args; try { diff --git a/commands/search/map.js b/commands/search/map.js index bf627e49..08c24820 100644 --- a/commands/search/map.js +++ b/commands/search/map.js @@ -28,7 +28,7 @@ module.exports = class MapCommand extends Command { async run(message, args) { if (message.channel.type !== 'dm') - if (!message.channel.permissionsFor(this.client.user).permissions.has('ATTACH_FILES')) + if (!message.channel.permissionsFor(this.client.user).hasPermission('ATTACH_FILES')) return message.say('This Command requires the `Attach Files` Permission.'); const { zoom, location } = args; try { diff --git a/commands/search/osu.js b/commands/search/osu.js index 151621c0..d9ae426b 100644 --- a/commands/search/osu.js +++ b/commands/search/osu.js @@ -20,7 +20,7 @@ module.exports = class OsuCommand extends Command { async run(message, args) { if (message.channel.type !== 'dm') - if (!message.channel.permissionsFor(this.client.user).permissions.has('EMBED_LINKS')) + if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say('This Command requires the `Embed Links` Permission.'); const { username } = args; try { diff --git a/commands/search/soundcloud.js b/commands/search/soundcloud.js index ed7519b2..2c0fcb80 100644 --- a/commands/search/soundcloud.js +++ b/commands/search/soundcloud.js @@ -20,7 +20,7 @@ module.exports = class SoundCloudCommand extends Command { async run(message, args) { if (message.channel.type !== 'dm') - if (!message.channel.permissionsFor(this.client.user).permissions.has('EMBED_LINKS')) + if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say('This Command requires the `Embed Links` Permission.'); const { query } = args; try { diff --git a/commands/search/urban.js b/commands/search/urban.js index fcf645cc..42638d93 100644 --- a/commands/search/urban.js +++ b/commands/search/urban.js @@ -20,7 +20,7 @@ module.exports = class UrbanCommand extends Command { async run(message, args) { if (message.channel.type !== 'dm') - if (!message.channel.permissionsFor(this.client.user).permissions.has('EMBED_LINKS')) + if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say('This Command requires the `Embed Links` Permission.'); const { word } = args; try { diff --git a/commands/search/wattpad.js b/commands/search/wattpad.js index a3a77eda..04fd4c8e 100644 --- a/commands/search/wattpad.js +++ b/commands/search/wattpad.js @@ -20,7 +20,7 @@ module.exports = class WattpadCommand extends Command { async run(message, args) { if (message.channel.type !== 'dm') - if (!message.channel.permissionsFor(this.client.user).permissions.has('EMBED_LINKS')) + if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say('This Command requires the `Embed Links` Permission.'); const { book } = args; try { diff --git a/commands/search/weather.js b/commands/search/weather.js index 8bb37812..318aa18d 100644 --- a/commands/search/weather.js +++ b/commands/search/weather.js @@ -19,7 +19,7 @@ module.exports = class WeatherCommand extends Command { async run(message, args) { if (message.channel.type !== 'dm') - if (!message.channel.permissionsFor(this.client.user).permissions.has('EMBED_LINKS')) + if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say('This Command requires the `Embed Links` Permission.'); const { location } = args; try { diff --git a/commands/search/wikipedia.js b/commands/search/wikipedia.js index 39647dea..65b11297 100644 --- a/commands/search/wikipedia.js +++ b/commands/search/wikipedia.js @@ -20,7 +20,7 @@ module.exports = class WikipediaCommand extends Command { async run(message, args) { if (message.channel.type !== 'dm') - if (!message.channel.permissionsFor(this.client.user).permissions.has('EMBED_LINKS')) + if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say('This Command requires the `Embed Links` Permission.'); const { query } = args; try { diff --git a/commands/search/youtube.js b/commands/search/youtube.js index bf50d776..018cb962 100644 --- a/commands/search/youtube.js +++ b/commands/search/youtube.js @@ -20,7 +20,7 @@ module.exports = class YouTubeCommand extends Command { async run(message, args) { if (message.channel.type !== 'dm') - if (!message.channel.permissionsFor(this.client.user).permissions.has('EMBED_LINKS')) + if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say('This Command requires the `Embed Links` Permission.'); const { video } = args; try { diff --git a/commands/search/yugioh.js b/commands/search/yugioh.js index 47f56d5d..92be9f54 100644 --- a/commands/search/yugioh.js +++ b/commands/search/yugioh.js @@ -20,7 +20,7 @@ module.exports = class YuGiOhCommand extends Command { async run(message, args) { if (message.channel.type !== 'dm') - if (!message.channel.permissionsFor(this.client.user).permissions.has('EMBED_LINKS')) + if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say('This Command requires the `Embed Links` Permission.'); const { card } = args; try { diff --git a/commands/textedit/embed.js b/commands/textedit/embed.js index 95de33a7..6ebcfb7f 100644 --- a/commands/textedit/embed.js +++ b/commands/textedit/embed.js @@ -18,7 +18,7 @@ module.exports = class EmbedCommand extends Command { run(message, args) { if (message.channel.type !== 'dm') - if (!message.channel.permissionsFor(this.client.user).permissions.has('EMBED_LINKS')) + if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say('This Command requires the `Embed Links` Permission.'); const { text } = args; const embed = new RichEmbed() diff --git a/commands/textedit/say.js b/commands/textedit/say.js index 4ed62983..27d829f9 100644 --- a/commands/textedit/say.js +++ b/commands/textedit/say.js @@ -22,7 +22,7 @@ module.exports = class SayCommand extends Command { } run(message, args) { - if (!message.channel.permissionsFor(this.client.user).permissions.has('MANAGE_MESSAGES')) + if (!message.channel.permissionsFor(this.client.user).hasPermission('MANAGE_MESSAGES')) return message.say('This Command requires the `Manage Messages` Permission.'); const { text } = args; message.delete(); diff --git a/commands/textedit/webhook.js b/commands/textedit/webhook.js index 3c7db3e1..74f21d04 100644 --- a/commands/textedit/webhook.js +++ b/commands/textedit/webhook.js @@ -26,7 +26,7 @@ module.exports = class WebhookCommand extends Command { } async run(message, args) { - if (!message.channel.permissionsFor(this.client.user).permissions.has('MANAGE_MESSAGES')) + if (!message.channel.permissionsFor(this.client.user).hasPermission('MANAGE_MESSAGES')) return message.say('This Command requires the `Manage Messages` Permission.'); const { text } = args; try { diff --git a/commands/userinfo/userinfo.js b/commands/userinfo/userinfo.js index dca2fdf9..fe86f0cd 100644 --- a/commands/userinfo/userinfo.js +++ b/commands/userinfo/userinfo.js @@ -26,7 +26,7 @@ module.exports = class UserInfoCommand extends Command { async run(message, args) { if (message.channel.type !== 'dm') - if (!message.channel.permissionsFor(this.client.user).permissions.has('EMBED_LINKS')) + if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say('This Command requires the `Embed Links` Permission.'); const { user } = args; const member = await message.guild.fetchMember(user); diff --git a/commands/util/info.js b/commands/util/info.js index 6ed960f0..1b29cf41 100644 --- a/commands/util/info.js +++ b/commands/util/info.js @@ -19,7 +19,7 @@ module.exports = class InfoCommand extends Command { async run(message) { if (message.channel.type !== 'dm') - if (!message.channel.permissionsFor(this.client.user).permissions.has('EMBED_LINKS')) + if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say('This Command requires the `Embed Links` Permission.'); const guilds = await this.client.shard.fetchClientValues('guilds.size'); const embed = new RichEmbed() diff --git a/commands/util/shardinfo.js b/commands/util/shardinfo.js index d1ad3a4f..7972bbef 100644 --- a/commands/util/shardinfo.js +++ b/commands/util/shardinfo.js @@ -24,7 +24,7 @@ module.exports = class ShardInfoCommand extends Command { async run(message, args) { if (message.channel.type !== 'dm') - if (!message.channel.permissionsFor(this.client.user).permissions.has('EMBED_LINKS')) + if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say('This Command requires the `Embed Links` Permission.'); const { shardID } = args; if (shardID > this.client.options.shardCount - 1 || shardID < 0) diff --git a/package.json b/package.json index 9736034a..45dcca2b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiaobot", - "version": "15.4.2", + "version": "15.4.3", "description": "A Discord Bot", "main": "shardingmanager.js", "scripts": {