mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Fix some deprecated stuff
This commit is contained in:
@@ -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).hasPermission('ATTACH_FILES'))
|
||||
if (!message.channel.permissionsFor(this.client.user).permissions.has('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');
|
||||
|
||||
@@ -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).hasPermission('ATTACH_FILES'))
|
||||
if (!message.channel.permissionsFor(this.client.user).permissions.has('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');
|
||||
|
||||
@@ -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).hasPermission('ATTACH_FILES'))
|
||||
if (!message.channel.permissionsFor(this.client.user).permissions.has('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');
|
||||
|
||||
@@ -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).hasPermission('ATTACH_FILES'))
|
||||
if (!message.channel.permissionsFor(this.client.user).permissions.has('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');
|
||||
|
||||
@@ -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).hasPermission('ATTACH_FILES'))
|
||||
if (!message.channel.permissionsFor(this.client.user).permissions.has('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;
|
||||
|
||||
@@ -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).hasPermission('EMBED_LINKS'))
|
||||
if (!message.channel.permissionsFor(this.client.user).permissions.has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
const { difficulty } = args;
|
||||
const operation = operations[Math.floor(Math.random() * operations.length)];
|
||||
|
||||
@@ -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).hasPermission('EMBED_LINKS'))
|
||||
if (!message.channel.permissionsFor(this.client.user).permissions.has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
try {
|
||||
const { body } = await request
|
||||
|
||||
@@ -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).hasPermission('EMBED_LINKS'))
|
||||
if (!message.channel.permissionsFor(this.client.user).permissions.has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
const { difficulty } = args;
|
||||
const sentence = sentences[Math.floor(Math.random() * sentences.length)];
|
||||
|
||||
@@ -20,7 +20,7 @@ module.exports = class GuildInfoCommand extends Command {
|
||||
}
|
||||
|
||||
run(message) {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS'))
|
||||
if (!message.channel.permissionsFor(this.client.user).permissions.has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
const embed = new RichEmbed()
|
||||
.setColor(0x00AE86)
|
||||
|
||||
@@ -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).hasPermission('ATTACH_FILES'))
|
||||
if (!message.channel.permissionsFor(this.client.user).permissions.has('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`]})
|
||||
|
||||
@@ -31,16 +31,16 @@ module.exports = class BanCommand extends Command {
|
||||
}
|
||||
|
||||
hasPermission(msg) {
|
||||
return msg.member.hasPermission('BAN_MEMBERS');
|
||||
return msg.member.permissions.has('BAN_MEMBERS');
|
||||
}
|
||||
|
||||
async run(message, args) {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('BAN_MEMBERS'))
|
||||
if (!message.channel.permissionsFor(this.client.user).permissions.has('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).hasPermission('EMBED_LINKS'))
|
||||
if (!modlogs.permissionsFor(this.client.user).permissions.has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
const { member, reason } = args;
|
||||
if (!member.bannable)
|
||||
|
||||
@@ -28,16 +28,16 @@ module.exports = class KickCommand extends Command {
|
||||
}
|
||||
|
||||
hasPermission(msg) {
|
||||
return msg.member.hasPermission('KICK_MEMBERS');
|
||||
return msg.member.permissions.has('KICK_MEMBERS');
|
||||
}
|
||||
|
||||
async run(message, args) {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('KICK_MEMBERS'))
|
||||
if (!message.channel.permissionsFor(this.client.user).permissions.has('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).hasPermission('EMBED_LINKS'))
|
||||
if (!modlogs.permissionsFor(this.client.user).permissions.has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
const { member, reason } = args;
|
||||
if (!member.kickable)
|
||||
|
||||
@@ -23,11 +23,11 @@ module.exports = class LockdownCommand extends Command {
|
||||
}
|
||||
|
||||
hasPermission(msg) {
|
||||
return msg.member.hasPermission('ADMINISTRATOR');
|
||||
return msg.member.permissions.has('ADMINISTRATOR');
|
||||
}
|
||||
|
||||
async run(message, args) {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('ADMINISTRATOR'))
|
||||
if (!message.channel.permissionsFor(this.client.user).permissions.has('ADMINISTRATOR'))
|
||||
return message.say('This Command requires the `Administrator` Permission.');
|
||||
const { type } = args;
|
||||
if (type === 'start') {
|
||||
|
||||
@@ -26,13 +26,13 @@ module.exports = class PruneCommand extends Command {
|
||||
}
|
||||
|
||||
hasPermission(msg) {
|
||||
return msg.member.hasPermission('MANAGE_MESSAGES');
|
||||
return msg.member.permissions.has('MANAGE_MESSAGES');
|
||||
}
|
||||
|
||||
async run(message, args) {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('READ_MESSAGE_HISTORY'))
|
||||
if (!message.channel.permissionsFor(this.client.user).permissions.has('READ_MESSAGE_HISTORY'))
|
||||
return message.say('This Command requires the `Read Message History` Permission.');
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('MANAGE_MESSAGES'))
|
||||
if (!message.channel.permissionsFor(this.client.user).permissions.has('MANAGE_MESSAGES'))
|
||||
return message.say('This Command requires the `Manage Messages` Permission.');
|
||||
let { count } = args;
|
||||
count = count + 1;
|
||||
|
||||
@@ -35,16 +35,16 @@ module.exports = class UnbanCommand extends Command {
|
||||
}
|
||||
|
||||
hasPermission(msg) {
|
||||
return msg.member.hasPermission('BAN_MEMBERS');
|
||||
return msg.member.permissions.has('BAN_MEMBERS');
|
||||
}
|
||||
|
||||
async run(message, args) {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('BAN_MEMBERS'))
|
||||
if (!message.channel.permissionsFor(this.client.user).permissions.has('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).hasPermission('EMBED_LINKS'))
|
||||
if (!modlogs.permissionsFor(this.client.user).permissions.has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
const { memberID, reason } = args;
|
||||
const bans = await message.guild.fetchBans();
|
||||
|
||||
@@ -27,14 +27,14 @@ module.exports = class WarnCommand extends Command {
|
||||
}
|
||||
|
||||
hasPermission(msg) {
|
||||
return msg.member.hasPermission('MANAGE_MESSAGES');
|
||||
return msg.member.permissions.has('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).hasPermission('EMBED_LINKS'))
|
||||
if (!modlogs.permissionsFor(this.client.user).permissions.has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
const { member, reason } = args;
|
||||
try {
|
||||
|
||||
@@ -13,7 +13,7 @@ module.exports = class NitroCommand extends Command {
|
||||
|
||||
run(message) {
|
||||
if (message.channel.type !== 'dm')
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS'))
|
||||
if (!message.channel.permissionsFor(this.client.user).permissions.has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
const embed = new RichEmbed()
|
||||
.setAuthor('Discord Nitro')
|
||||
|
||||
@@ -12,7 +12,7 @@ module.exports = class SpamCommand extends Command {
|
||||
|
||||
run(message) {
|
||||
if (message.channel.type !== 'dm')
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('ATTACH_FILES'))
|
||||
if (!message.channel.permissionsFor(this.client.user).permissions.has('ATTACH_FILES'))
|
||||
return message.say('This Command requires the `Attach Files` Permission.');
|
||||
return message.channel.send({files: ['./images/Spam.jpg']});
|
||||
}
|
||||
|
||||
@@ -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).hasPermission('EMBED_LINKS'))
|
||||
if (!message.channel.permissionsFor(this.client.user).permissions.has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
try {
|
||||
const { text } = await request
|
||||
|
||||
@@ -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).hasPermission('EMBED_LINKS'))
|
||||
if (!message.channel.permissionsFor(this.client.user).permissions.has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
try {
|
||||
const { body } = await request
|
||||
|
||||
@@ -16,7 +16,7 @@ module.exports = class CatCommand extends Command {
|
||||
|
||||
run(message) {
|
||||
if (message.channel.type !== 'dm')
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('ATTACH_FILES'))
|
||||
if (!message.channel.permissionsFor(this.client.user).permissions.has('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}`]});
|
||||
|
||||
@@ -16,7 +16,7 @@ module.exports = class PotatoCommand extends Command {
|
||||
|
||||
run(message) {
|
||||
if (message.channel.type !== 'dm')
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('ATTACH_FILES'))
|
||||
if (!message.channel.permissionsFor(this.client.user).permissions.has('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}`]});
|
||||
|
||||
@@ -13,7 +13,7 @@ module.exports = class RandomPunCommand extends Command {
|
||||
|
||||
run(message) {
|
||||
if (message.channel.type !== 'dm')
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('ATTACH_FILES'))
|
||||
if (!message.channel.permissionsFor(this.client.user).permissions.has('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}`]});
|
||||
|
||||
@@ -16,7 +16,7 @@ module.exports = class XiaoCommand extends Command {
|
||||
|
||||
run(message) {
|
||||
if (message.channel.type !== 'dm')
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('ATTACH_FILES'))
|
||||
if (!message.channel.permissionsFor(this.client.user).permissions.has('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}`]});
|
||||
|
||||
@@ -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).hasPermission('EMBED_LINKS'))
|
||||
if (!message.channel.permissionsFor(this.client.user).permissions.has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
let { bot } = args;
|
||||
bot = bot.id;
|
||||
|
||||
@@ -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).hasPermission('EMBED_LINKS'))
|
||||
if (!message.channel.permissionsFor(this.client.user).permissions.has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
const { word } = args;
|
||||
try {
|
||||
|
||||
@@ -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).hasPermission('EMBED_LINKS'))
|
||||
if (!message.channel.permissionsFor(this.client.user).permissions.has('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();
|
||||
|
||||
@@ -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).hasPermission('EMBED_LINKS'))
|
||||
if (!message.channel.permissionsFor(this.client.user).permissions.has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
const { location } = args;
|
||||
try {
|
||||
|
||||
@@ -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).hasPermission('EMBED_LINKS'))
|
||||
if (!message.channel.permissionsFor(this.client.user).permissions.has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
const { movie } = args;
|
||||
try {
|
||||
|
||||
@@ -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).hasPermission('ATTACH_FILES'))
|
||||
if (!message.channel.permissionsFor(this.client.user).permissions.has('ATTACH_FILES'))
|
||||
return message.say('This Command requires the `Attach Files` Permission.');
|
||||
const { zoom, location } = args;
|
||||
try {
|
||||
|
||||
@@ -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).hasPermission('EMBED_LINKS'))
|
||||
if (!message.channel.permissionsFor(this.client.user).permissions.has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
const { username } = args;
|
||||
try {
|
||||
|
||||
@@ -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).hasPermission('EMBED_LINKS'))
|
||||
if (!message.channel.permissionsFor(this.client.user).permissions.has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
const { query } = args;
|
||||
try {
|
||||
|
||||
@@ -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).hasPermission('EMBED_LINKS'))
|
||||
if (!message.channel.permissionsFor(this.client.user).permissions.has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
const { word } = args;
|
||||
try {
|
||||
|
||||
@@ -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).hasPermission('EMBED_LINKS'))
|
||||
if (!message.channel.permissionsFor(this.client.user).permissions.has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
const { book } = args;
|
||||
try {
|
||||
|
||||
@@ -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).hasPermission('EMBED_LINKS'))
|
||||
if (!message.channel.permissionsFor(this.client.user).permissions.has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
const { location } = args;
|
||||
try {
|
||||
|
||||
@@ -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).hasPermission('EMBED_LINKS'))
|
||||
if (!message.channel.permissionsFor(this.client.user).permissions.has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
const { query } = args;
|
||||
try {
|
||||
|
||||
@@ -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).hasPermission('EMBED_LINKS'))
|
||||
if (!message.channel.permissionsFor(this.client.user).permissions.has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
const { video } = args;
|
||||
try {
|
||||
|
||||
@@ -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).hasPermission('EMBED_LINKS'))
|
||||
if (!message.channel.permissionsFor(this.client.user).permissions.has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
const { card } = args;
|
||||
try {
|
||||
|
||||
@@ -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).hasPermission('EMBED_LINKS'))
|
||||
if (!message.channel.permissionsFor(this.client.user).permissions.has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
const { text } = args;
|
||||
const embed = new RichEmbed()
|
||||
|
||||
@@ -22,7 +22,7 @@ module.exports = class SayCommand extends Command {
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('MANAGE_MESSAGES'))
|
||||
if (!message.channel.permissionsFor(this.client.user).permissions.has('MANAGE_MESSAGES'))
|
||||
return message.say('This Command requires the `Manage Messages` Permission.');
|
||||
const { text } = args;
|
||||
message.delete();
|
||||
|
||||
@@ -26,7 +26,7 @@ module.exports = class WebhookCommand extends Command {
|
||||
}
|
||||
|
||||
async run(message, args) {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('MANAGE_MESSAGES'))
|
||||
if (!message.channel.permissionsFor(this.client.user).permissions.has('MANAGE_MESSAGES'))
|
||||
return message.say('This Command requires the `Manage Messages` Permission.');
|
||||
const { text } = args;
|
||||
try {
|
||||
|
||||
@@ -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).hasPermission('EMBED_LINKS'))
|
||||
if (!message.channel.permissionsFor(this.client.user).permissions.has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
const { user } = args;
|
||||
const member = await message.guild.fetchMember(user);
|
||||
|
||||
@@ -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).hasPermission('EMBED_LINKS'))
|
||||
if (!message.channel.permissionsFor(this.client.user).permissions.has('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()
|
||||
|
||||
@@ -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).hasPermission('EMBED_LINKS'))
|
||||
if (!message.channel.permissionsFor(this.client.user).permissions.has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
const { shardID } = args;
|
||||
if (shardID > this.client.options.shardCount - 1 || shardID < 0)
|
||||
|
||||
Reference in New Issue
Block a user