Fix Error

This commit is contained in:
Daniel Odendahl Jr
2017-04-26 17:31:15 +00:00
parent 291aaa7f08
commit aeeb2d0924
45 changed files with 55 additions and 55 deletions
+1 -1
View File
@@ -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');
+1 -1
View File
@@ -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');
+1 -1
View File
@@ -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');
+1 -1
View File
@@ -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');
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -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)];
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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)];
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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`]})
+3 -3
View File
@@ -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)
+3 -3
View File
@@ -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)
+2 -2
View File
@@ -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') {
+3 -3
View File
@@ -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;
+3 -3
View File
@@ -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();
+2 -2
View File
@@ -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 {
+1 -1
View File
@@ -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')
+1 -1
View File
@@ -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']});
}
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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}`]});
+1 -1
View File
@@ -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}`]});
+1 -1
View File
@@ -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}`]});
+1 -1
View File
@@ -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}`]});
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -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 {
+1 -1
View File
@@ -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();
+1 -1
View File
@@ -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 {
+1 -1
View File
@@ -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 {
+1 -1
View File
@@ -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 {
+1 -1
View File
@@ -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 {
+1 -1
View File
@@ -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 {
+1 -1
View File
@@ -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 {
+1 -1
View File
@@ -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 {
+1 -1
View File
@@ -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 {
+1 -1
View File
@@ -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 {
+1 -1
View File
@@ -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 {
+1 -1
View File
@@ -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 {
+1 -1
View File
@@ -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()
+1 -1
View File
@@ -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();
+1 -1
View File
@@ -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 {
+1 -1
View File
@@ -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);
+1 -1
View File
@@ -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()
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiaobot",
"version": "15.4.2",
"version": "15.4.3",
"description": "A Discord Bot",
"main": "shardingmanager.js",
"scripts": {