mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
msg
This commit is contained in:
@@ -19,10 +19,10 @@ module.exports = class YearsCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(message, args) {
|
||||
if (message.channel.type !== 'dm')
|
||||
if (!message.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
||||
return message.say('This Command requires the `Attach Files` Permission.');
|
||||
async run(msg, args) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
||||
return msg.say('This Command requires the `Attach Files` Permission.');
|
||||
const { user } = args;
|
||||
const avatarURL = user.displayAvatarURL.replace(/(png|jpg|jpeg|gif|webp)/, 'png');
|
||||
let images = [];
|
||||
@@ -32,8 +32,8 @@ module.exports = class YearsCommand extends Command {
|
||||
avatar.resize(200, 200);
|
||||
az.composite(avatar, 461, 127);
|
||||
az.getBuffer(Jimp.MIME_PNG, (err, buff) => {
|
||||
if (err) return message.say('An Unknown Error Occurred.');
|
||||
return message.channel.send({files: [{attachment: buff}]});
|
||||
if (err) return msg.say('An Unknown Error Occurred.');
|
||||
return msg.channel.send({files: [{attachment: buff}]});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -19,10 +19,10 @@ module.exports = class BeautifulCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(message, args) {
|
||||
if (message.channel.type !== 'dm')
|
||||
if (!message.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
||||
return message.say('This Command requires the `Attach Files` Permission.');
|
||||
async run(msg, args) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
||||
return msg.say('This Command requires the `Attach Files` Permission.');
|
||||
const { user } = args;
|
||||
const avatarURL = user.displayAvatarURL.replace(/(png|jpg|jpeg|gif|webp)/, 'png');
|
||||
let images = [];
|
||||
@@ -34,8 +34,8 @@ module.exports = class BeautifulCommand extends Command {
|
||||
avatar.resize(190, 190);
|
||||
grunkle.composite(avatar, 451, 434);
|
||||
grunkle.getBuffer(Jimp.MIME_PNG, (err, buff) => {
|
||||
if (err) return message.say('An Unknown Error Occurred.');
|
||||
return message.channel.send({files: [{attachment: buff}]});
|
||||
if (err) return msg.say('An Unknown Error Occurred.');
|
||||
return msg.channel.send({files: [{attachment: buff}]});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -19,10 +19,10 @@ module.exports = class BobRossCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(message, args) {
|
||||
if (message.channel.type !== 'dm')
|
||||
if (!message.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
||||
return message.say('This Command requires the `Attach Files` Permission.');
|
||||
async run(msg, args) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
||||
return msg.say('This Command requires the `Attach Files` Permission.');
|
||||
const { user } = args;
|
||||
const avatarURL = user.displayAvatarURL.replace(/(png|jpg|jpeg|gif|webp)/, 'png');
|
||||
const blank = new Jimp(600, 775, 0xFFFFFFFF);
|
||||
@@ -35,8 +35,8 @@ module.exports = class BobRossCommand extends Command {
|
||||
blank.composite(avatar, 44, 85);
|
||||
blank.composite(bob, 0, 0);
|
||||
blank.getBuffer(Jimp.MIME_PNG, (err, buff) => {
|
||||
if (err) return message.say('An Unknown Error Occurred.');
|
||||
return message.channel.send({files: [{attachment: buff}]});
|
||||
if (err) return msg.say('An Unknown Error Occurred.');
|
||||
return msg.channel.send({files: [{attachment: buff}]});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -20,10 +20,10 @@ module.exports = class RIPCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(message, args) {
|
||||
if (message.channel.type !== 'dm')
|
||||
if (!message.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
||||
return message.say('This Command requires the `Attach Files` Permission.');
|
||||
async run(msg, args) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
||||
return msg.say('This Command requires the `Attach Files` Permission.');
|
||||
const { user } = args;
|
||||
const avatarURL = user.displayAvatarURL.replace(/(png|jpg|jpeg|gif|webp)/, 'png');
|
||||
let images = [];
|
||||
@@ -33,8 +33,8 @@ module.exports = class RIPCommand extends Command {
|
||||
avatar.resize(200, 200);
|
||||
grave.composite(avatar, 158, 51);
|
||||
grave.getBuffer(Jimp.MIME_PNG, (err, buff) => {
|
||||
if (err) return message.say('An Unknown Error Occurred.');
|
||||
return message.channel.send({files: [{attachment: buff}]});
|
||||
if (err) return msg.say('An Unknown Error Occurred.');
|
||||
return msg.channel.send({files: [{attachment: buff}]});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -19,12 +19,12 @@ module.exports = class SteamCardCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(message, args) {
|
||||
if (message.channel.type !== 'dm')
|
||||
if (!message.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
||||
return message.say('This Command requires the `Attach Files` Permission.');
|
||||
async run(msg, args) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
||||
return msg.say('This Command requires the `Attach Files` Permission.');
|
||||
const { user } = args;
|
||||
const username = message.guild ? message.guild.member(user).displayName : user.username;
|
||||
const username = msg.guild ? msg.guild.member(user).displayName : user.username;
|
||||
const avatarURL = user.displayAvatarURL.replace(/(png|jpg|jpeg|gif|webp)/, 'png');
|
||||
const blank = new Jimp(494, 568, 0xFFFFFFFF);
|
||||
let images = [];
|
||||
@@ -37,8 +37,8 @@ module.exports = class SteamCardCommand extends Command {
|
||||
blank.composite(card, 0, 0);
|
||||
blank.print(font, 38, 20, username);
|
||||
blank.getBuffer(Jimp.MIME_PNG, (err, buff) => {
|
||||
if (err) return message.say('An Unknown Error Occurred.');
|
||||
return message.channel.send({files: [{attachment: buff}]});
|
||||
if (err) return msg.say('An Unknown Error Occurred.');
|
||||
return msg.channel.send({files: [{attachment: buff}]});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -16,10 +16,10 @@ module.exports = class TriggeredCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(message, args) {
|
||||
if (message.channel.type !== 'dm')
|
||||
if (!message.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
||||
return message.say('This Command requires the `Attach Files` Permission.');
|
||||
async run(msg, args) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
||||
return msg.say('This Command requires the `Attach Files` Permission.');
|
||||
const { user } = args;
|
||||
const avatarURL = user.displayAvatarURL.replace(/(png|jpg|jpeg|gif|webp)/, 'png');
|
||||
const blank = new Jimp(320, 371, 0xFFFFFFFF);
|
||||
@@ -31,8 +31,8 @@ module.exports = class TriggeredCommand extends Command {
|
||||
blank.composite(avatar, 0, 0);
|
||||
blank.composite(triggered, 0, 0);
|
||||
blank.getBuffer(Jimp.MIME_PNG, (err, buff) => {
|
||||
if (err) return message.say('An Unknown Error Occurred.');
|
||||
return message.channel.send({files: [{attachment: buff}]});
|
||||
if (err) return msg.say('An Unknown Error Occurred.');
|
||||
return msg.channel.send({files: [{attachment: buff}]});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -10,10 +10,10 @@ module.exports = class LotteryCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message) {
|
||||
run(msg) {
|
||||
const lottery = Math.floor(Math.random() * 100) + 1;
|
||||
if (lottery < 99)
|
||||
return message.say(`Nope, sorry ${message.author.username}, you lost.`);
|
||||
return message.say(`Wow ${message.author.username}! You actually won! Great job!`);
|
||||
return msg.say(`Nope, sorry ${msg.author.username}, you lost.`);
|
||||
return msg.say(`Wow ${msg.author.username}! You actually won! Great job!`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -24,10 +24,10 @@ module.exports = class MathGameCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(message, args) {
|
||||
if (message.channel.type !== 'dm')
|
||||
if (!message.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
async run(msg, args) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
const { difficulty } = args;
|
||||
const operation = operations[Math.floor(Math.random() * operations.length)];
|
||||
let value;
|
||||
@@ -55,18 +55,18 @@ module.exports = class MathGameCommand extends Command {
|
||||
const embed = new RichEmbed()
|
||||
.setTitle('You have **10** seconds to answer:')
|
||||
.setDescription(expression);
|
||||
await message.embed(embed);
|
||||
await msg.embed(embed);
|
||||
try {
|
||||
const collected = await message.channel.awaitMessages(response => response.author.id === message.author.id, {
|
||||
const collected = await msg.channel.awaitMessages(res => res.author.id === msg.author.id, {
|
||||
max: 1,
|
||||
time: 10000,
|
||||
errors: ['time']
|
||||
});
|
||||
if (collected.first().content !== solved)
|
||||
return message.say(`Aw... Too bad, try again next time!\nThe correct answer is: ${solved}`);
|
||||
return message.say(`Good Job! You won! ${solved} is the correct answer!`);
|
||||
return msg.say(`Aw... Too bad, try again next time!\nThe correct answer is: ${solved}`);
|
||||
return msg.say(`Good Job! You won! ${solved} is the correct answer!`);
|
||||
} catch (err) {
|
||||
return message.say(`Aw... Too bad, try again next time!\nThe correct answer is: ${solved}`);
|
||||
return msg.say(`Aw... Too bad, try again next time!\nThe correct answer is: ${solved}`);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
+10
-10
@@ -15,10 +15,10 @@ module.exports = class QuizCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(message) {
|
||||
if (message.channel.type !== 'dm')
|
||||
if (!message.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
async run(msg) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
try {
|
||||
const { body } = await request
|
||||
.get('http://jservice.io/api/random?count=1');
|
||||
@@ -26,21 +26,21 @@ module.exports = class QuizCommand extends Command {
|
||||
const embed = new RichEmbed()
|
||||
.setTitle('You have **15** seconds to answer this question:')
|
||||
.setDescription(`**Category: ${body[0].category.title}**\n${body[0].question}`);
|
||||
await message.embed(embed);
|
||||
await msg.embed(embed);
|
||||
try {
|
||||
const collected = await message.channel.awaitMessages(res => res.author.id === message.author.id, {
|
||||
const collected = await msg.channel.awaitMessages(res => res.author.id === msg.author.id, {
|
||||
max: 1,
|
||||
time: 15000,
|
||||
errors: ['time']
|
||||
});
|
||||
if (collected.first().content.toLowerCase() !== answer)
|
||||
return message.say(`The correct answer is: ${answer}`);
|
||||
return message.say(`Perfect! The correct answer is: ${answer}`);
|
||||
return msg.say(`The correct answer is: ${answer}`);
|
||||
return msg.say(`Perfect! The correct answer is: ${answer}`);
|
||||
} catch (err) {
|
||||
return message.say(`Aw... Too bad, try again next time!\nThe Correct Answer was: ${answer}`);
|
||||
return msg.say(`Aw... Too bad, try again next time!\nThe Correct Answer was: ${answer}`);
|
||||
}
|
||||
} catch (err) {
|
||||
return message.say('An Unknown Error Occurred.');
|
||||
return msg.say('An Unknown Error Occurred.');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -25,30 +25,30 @@ module.exports = class RockPaperScissorsCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
run(msg, args) {
|
||||
const { choice } = args;
|
||||
const response = responses[Math.floor(Math.random() * responses.length)];
|
||||
if (choice === 'rock') {
|
||||
if (response === 'Rock')
|
||||
return message.say('Rock! Aw, it\'s a tie!');
|
||||
return msg.say('Rock! Aw, it\'s a tie!');
|
||||
if (response === 'Paper')
|
||||
return message.say('Paper! Yes! I win!');
|
||||
return msg.say('Paper! Yes! I win!');
|
||||
if (response === 'Scissors')
|
||||
return message.say('Scissors! Aw... I lose...');
|
||||
return msg.say('Scissors! Aw... I lose...');
|
||||
} else if (choice === 'paper') {
|
||||
if (response === 'Rock')
|
||||
return message.say('Rock! Aw... I lose...');
|
||||
return msg.say('Rock! Aw... I lose...');
|
||||
if (response === 'Paper')
|
||||
return message.say('Paper! Aw, it\'s a tie!');
|
||||
return msg.say('Paper! Aw, it\'s a tie!');
|
||||
if (response === 'Scissors')
|
||||
return message.say('Scissors! Yes! I win!');
|
||||
return msg.say('Scissors! Yes! I win!');
|
||||
} else if (choice === 'scissors') {
|
||||
if (response === 'Rock')
|
||||
return message.say('Rock! Yes! I win!');
|
||||
return msg.say('Rock! Yes! I win!');
|
||||
if (response === 'Paper')
|
||||
return message.say('Paper! Aw... I lose...');
|
||||
return msg.say('Paper! Aw... I lose...');
|
||||
if (response === 'Scissors')
|
||||
return message.say('Scissors! Aw, it\'s a tie!');
|
||||
return msg.say('Scissors! Aw, it\'s a tie!');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -11,12 +11,12 @@ module.exports = class SlotsCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message) {
|
||||
run(msg) {
|
||||
const slotOne = slotThing[Math.floor(Math.random() * slotThing.length)];
|
||||
const slotTwo = slotThing[Math.floor(Math.random() * slotThing.length)];
|
||||
const slotThree = slotThing[Math.floor(Math.random() * slotThing.length)];
|
||||
if (slotOne === slotTwo && slotOne === slotThree)
|
||||
return message.say(`${slotOne}|${slotTwo}|${slotThree}\nWow! You won! Great job... er... luck!`);
|
||||
return message.say(`${slotOne}|${slotTwo}|${slotThree}\nAww... You lost... Guess it's just bad luck, huh?`);
|
||||
return msg.say(`${slotOne}|${slotTwo}|${slotThree}\nWow! You won! Great job... er... luck!`);
|
||||
return msg.say(`${slotOne}|${slotTwo}|${slotThree}\nAww... You lost... Guess it's just bad luck, huh?`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -23,10 +23,10 @@ module.exports = class TypingGameCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(message, args) {
|
||||
if (message.channel.type !== 'dm')
|
||||
if (!message.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
async run(msg, args) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
const { difficulty } = args;
|
||||
const sentence = sentences[Math.floor(Math.random() * sentences.length)];
|
||||
let time;
|
||||
@@ -50,18 +50,18 @@ module.exports = class TypingGameCommand extends Command {
|
||||
const embed = new RichEmbed()
|
||||
.setTitle(`You have **${time / 1000}** seconds to type:`)
|
||||
.setDescription(sentence);
|
||||
await message.embed(embed);
|
||||
await msg.embed(embed);
|
||||
try {
|
||||
const collected = await message.channel.awaitMessages(response => response.author.id === message.author.id, {
|
||||
const collected = await msg.channel.awaitMessages(res => res.author.id === msg.author.id, {
|
||||
max: 1,
|
||||
time: time,
|
||||
errors: ['time']
|
||||
});
|
||||
if (collected.first().content !== sentence)
|
||||
return message.say('Nope, your sentence does not match the original. Try again next time!');
|
||||
return message.say(`Good Job! You won!`);
|
||||
return msg.say('Nope, your sentence does not match the original. Try again next time!');
|
||||
return msg.say(`Good Job! You won!`);
|
||||
} catch (err) {
|
||||
return message.say('Aw... Too bad, try again next time!');
|
||||
return msg.say('Aw... Too bad, try again next time!');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -11,8 +11,8 @@ module.exports = class EmojiCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message) {
|
||||
return message.say(message.guild.emojis.map(e => e).join(''))
|
||||
.catch(() => message.say('There was an error sending the emoji. Perhaps you have no custom emoji?'));
|
||||
run(msg) {
|
||||
return msg.say(msg.guild.emojis.map(e => e).join(''))
|
||||
.catch(() => msg.say('There was an error sending the emoji. Perhaps you have no custom emoji?'));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -19,26 +19,26 @@ module.exports = class GuildInfoCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message) {
|
||||
if (!message.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
run(msg) {
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
const embed = new RichEmbed()
|
||||
.setColor(0x00AE86)
|
||||
.setThumbnail(message.guild.iconURL)
|
||||
.setThumbnail(msg.guild.iconURL)
|
||||
.addField('**Name:**',
|
||||
message.guild.name, true)
|
||||
msg.guild.name, true)
|
||||
.addField('**ID:**',
|
||||
message.guild.id, true)
|
||||
msg.guild.id, true)
|
||||
.addField('**Created On:**',
|
||||
`${message.guild.createdAt}\n${moment.duration(Date.now() - message.guild.createdTimestamp).format('y[ years], M[ months], w[ weeks, and ]d[ days]')} ago.`, true)
|
||||
`${msg.guild.createdAt}\n${moment.duration(Date.now() - msg.guild.createdTimestamp).format('y[ years], M[ months], w[ weeks, and ]d[ days]')} ago.`, true)
|
||||
.addField('**Default Channel:**',
|
||||
message.guild.defaultChannel, true)
|
||||
msg.guild.defaultChannel, true)
|
||||
.addField('**Region:**',
|
||||
message.guild.region, true)
|
||||
msg.guild.region, true)
|
||||
.addField('**Owner:**',
|
||||
message.guild.owner.user.tag, true)
|
||||
msg.guild.owner.user.tag, true)
|
||||
.addField('**Users:**',
|
||||
message.guild.memberCount, true);
|
||||
return message.embed(embed);
|
||||
msg.guild.memberCount, true);
|
||||
return msg.embed(embed);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -43,12 +43,12 @@ module.exports = class MemeCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
if (message.channel.type !== 'dm')
|
||||
if (!message.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
||||
return message.say('This Command requires the `Attach Files` Permission.');
|
||||
run(msg, args) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
||||
return msg.say('This Command requires the `Attach Files` Permission.');
|
||||
const { type, top, bottom } = args;
|
||||
return message.channel.send({files: [`https://memegen.link/${type}/${top}/${bottom}.jpg`]})
|
||||
.catch(() => message.say('An Unknown Error Occurred.'));
|
||||
return msg.channel.send({files: [`https://memegen.link/${type}/${top}/${bottom}.jpg`]})
|
||||
.catch(() => msg.say('An Unknown Error Occurred.'));
|
||||
}
|
||||
};
|
||||
|
||||
+12
-12
@@ -34,36 +34,36 @@ module.exports = class BanCommand extends Command {
|
||||
return msg.member.permissions.has('BAN_MEMBERS') || msg.member.roles.exists('name', msg.guild.settings.get('staffRole', 'Server Staff'));
|
||||
}
|
||||
|
||||
async run(message, args) {
|
||||
if (!message.channel.permissionsFor(this.client.user).has('BAN_MEMBERS'))
|
||||
return message.say('This Command requires the `Ban Members` Permission.');
|
||||
const modlogs = message.guild.channels.find('name', message.guild.settings.get('modLog', 'mod_logs'));
|
||||
async run(msg, args) {
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('BAN_MEMBERS'))
|
||||
return msg.say('This Command requires the `Ban Members` Permission.');
|
||||
const modlogs = msg.guild.channels.find('name', msg.guild.settings.get('modLog', 'mod_logs'));
|
||||
if (!modlogs)
|
||||
return message.say('This Command requires a channel named `mod_logs` or one custom set with the `modchannel` command.');
|
||||
return msg.say('This Command requires a channel named `mod_logs` or one custom set with the `modchannel` command.');
|
||||
if (!modlogs.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
const { member, reason } = args;
|
||||
if (!member.bannable)
|
||||
return message.say('This member is not bannable. Perhaps they have a higher role than me?');
|
||||
return msg.say('This member is not bannable. Perhaps they have a higher role than me?');
|
||||
try {
|
||||
try {
|
||||
await member.send(`You were banned from ${message.guild.name}!\nReason: ${reason}.`);
|
||||
await member.send(`You were banned from ${msg.guild.name}!\nReason: ${reason}.`);
|
||||
} catch (err) {
|
||||
await message.say('Failed to send DM to user.');
|
||||
await msg.say('Failed to send DM to user.');
|
||||
}
|
||||
await member.ban({
|
||||
days: 7,
|
||||
reason
|
||||
});
|
||||
await message.say(':ok_hand:');
|
||||
await msg.say(':ok_hand:');
|
||||
const embed = new RichEmbed()
|
||||
.setAuthor(message.author.tag, message.author.displayAvatarURL)
|
||||
.setAuthor(msg.author.tag, msg.author.displayAvatarURL)
|
||||
.setColor(0xFF0000)
|
||||
.setTimestamp()
|
||||
.setDescription(`**Member:** ${member.user.tag} (${member.id})\n**Action:** Ban\n**Reason:** ${reason}`);
|
||||
return modlogs.send({embed});
|
||||
} catch (err) {
|
||||
return message.say('An Unknown Error Occurred.');
|
||||
return msg.say('An Unknown Error Occurred.');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
+12
-12
@@ -31,35 +31,35 @@ module.exports = class KickCommand extends Command {
|
||||
return msg.member.permissions.has('KICK_MEMBERS') || msg.member.roles.exists('name', msg.guild.settings.get('staffRole', 'Server Staff'));
|
||||
}
|
||||
|
||||
async run(message, args) {
|
||||
if (!message.channel.permissionsFor(this.client.user).has('KICK_MEMBERS'))
|
||||
return message.say('This Command requires the `Kick Members` Permission.');
|
||||
const modlogs = message.guild.channels.find('name', message.guild.settings.get('modLog', 'mod_logs'));
|
||||
async run(msg, args) {
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('KICK_MEMBERS'))
|
||||
return msg.say('This Command requires the `Kick Members` Permission.');
|
||||
const modlogs = msg.guild.channels.find('name', msg.guild.settings.get('modLog', 'mod_logs'));
|
||||
if (!modlogs)
|
||||
return message.say('This Command requires a channel named `mod_logs` or one custom set with the `modchannel` command.');
|
||||
return msg.say('This Command requires a channel named `mod_logs` or one custom set with the `modchannel` command.');
|
||||
if (!modlogs.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
const { member, reason } = args;
|
||||
if (!member.kickable)
|
||||
return message.say('This member is not kickable. Perhaps they have a higher role than me?');
|
||||
return msg.say('This member is not kickable. Perhaps they have a higher role than me?');
|
||||
try {
|
||||
try {
|
||||
await member.send(`You were kicked from ${message.guild.name}!\nReason: ${reason}.`);
|
||||
await member.send(`You were kicked from ${msg.guild.name}!\nReason: ${reason}.`);
|
||||
} catch (err) {
|
||||
await message.say('Failed to send DM.');
|
||||
await msg.say('Failed to send DM.');
|
||||
}
|
||||
await member.kick({
|
||||
reason
|
||||
});
|
||||
await message.say(':ok_hand:');
|
||||
await msg.say(':ok_hand:');
|
||||
const embed = new RichEmbed()
|
||||
.setAuthor(message.author.tag, message.author.displayAvatarURL)
|
||||
.setAuthor(msg.author.tag, msg.author.displayAvatarURL)
|
||||
.setColor(0xFFA500)
|
||||
.setTimestamp()
|
||||
.setDescription(`**Member:** ${member.user.tag} (${member.id})\n**Action:** Kick\n**Reason:** ${reason}`);
|
||||
return modlogs.send({embed});
|
||||
} catch (err) {
|
||||
return message.say('An Unknown Error Occurred.');
|
||||
return msg.say('An Unknown Error Occurred.');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -26,27 +26,27 @@ module.exports = class LockdownCommand extends Command {
|
||||
return msg.member.permissions.has('ADMINISTRATOR');
|
||||
}
|
||||
|
||||
async run(message, args) {
|
||||
if (!message.channel.permissionsFor(this.client.user).has('ADMINISTRATOR'))
|
||||
return message.say('This Command requires the `Administrator` Permission.');
|
||||
async run(msg, args) {
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('ADMINISTRATOR'))
|
||||
return msg.say('This Command requires the `Administrator` Permission.');
|
||||
const { type } = args;
|
||||
if (type === 'start') {
|
||||
try {
|
||||
await message.channel.overwritePermissions(message.guild.defaultRole, {
|
||||
await msg.channel.overwritePermissions(msg.guild.defaultRole, {
|
||||
SEND_MESSAGES: false
|
||||
});
|
||||
return message.say('Lockdown Started, users without Administrator can no longer post messages. Please use `;lockdown stop` to end the lockdown.');
|
||||
return msg.say('Lockdown Started, users without Administrator can no longer post messages. Please use `;lockdown stop` to end the lockdown.');
|
||||
} catch (err) {
|
||||
return message.say('Something went wrong!');
|
||||
return msg.say('Something went wrong!');
|
||||
}
|
||||
} else if (type === 'stop') {
|
||||
try {
|
||||
await message.channel.overwritePermissions(message.guild.defaultRole, {
|
||||
await msg.channel.overwritePermissions(msg.guild.defaultRole, {
|
||||
SEND_MESSAGES: true
|
||||
});
|
||||
return message.say('Lockdown Ended, users without Administrator can now post messages.');
|
||||
return msg.say('Lockdown Ended, users without Administrator can now post messages.');
|
||||
} catch (err) {
|
||||
return message.say('An Unknown Error Occurred.');
|
||||
return msg.say('An Unknown Error Occurred.');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,20 +29,20 @@ module.exports = class PruneCommand extends Command {
|
||||
return msg.member.permissions.has('MANAGE_MESSAGES') || msg.member.roles.exists('name', msg.guild.settings.get('staffRole', 'Server Staff'));
|
||||
}
|
||||
|
||||
async run(message, args) {
|
||||
if (!message.channel.permissionsFor(this.client.user).has('READ_MESSAGE_HISTORY'))
|
||||
return message.say('This Command requires the `Read Message History` Permission.');
|
||||
if (!message.channel.permissionsFor(this.client.user).has('MANAGE_MESSAGES'))
|
||||
return message.say('This Command requires the `Manage Messages` Permission.');
|
||||
async run(msg, args) {
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('READ_MESSAGE_HISTORY'))
|
||||
return msg.say('This Command requires the `Read Message History` Permission.');
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('MANAGE_MESSAGES'))
|
||||
return msg.say('This Command requires the `Manage Messages` Permission.');
|
||||
const { count } = args;
|
||||
try {
|
||||
const messages = await message.channel.fetchMessages({
|
||||
const messages = await msg.channel.fetchMessages({
|
||||
limit: count + 1
|
||||
});
|
||||
await message.channel.bulkDelete(messages, true);
|
||||
await msg.channel.bulkDelete(messages, true);
|
||||
return null;
|
||||
} catch (err) {
|
||||
return message.say('There are no messages younger than two weeks that can be deleted.');
|
||||
return msg.say('There are no messages younger than two weeks that can be deleted.');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -31,39 +31,39 @@ module.exports = class SoftbanCommand extends Command {
|
||||
return msg.member.permissions.has('KICK_MEMBERS') || msg.member.roles.exists('name', msg.guild.settings.get('staffRole', 'Server Staff'));
|
||||
}
|
||||
|
||||
async run(message, args) {
|
||||
if (!message.channel.permissionsFor(this.client.user).has('BAN_MEMBERS'))
|
||||
return message.say('This Command requires the `Ban Members` Permission.');
|
||||
if (!message.channel.permissionsFor(this.client.user).has('KICK_MEMBERS'))
|
||||
return message.say('This Command requires the `Kick Members` Permission.');
|
||||
const modlogs = message.guild.channels.find('name', message.guild.settings.get('modLog', 'mod_logs'));
|
||||
async run(msg, args) {
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('BAN_MEMBERS'))
|
||||
return msg.say('This Command requires the `Ban Members` Permission.');
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('KICK_MEMBERS'))
|
||||
return msg.say('This Command requires the `Kick Members` Permission.');
|
||||
const modlogs = msg.guild.channels.find('name', msg.guild.settings.get('modLog', 'mod_logs'));
|
||||
if (!modlogs)
|
||||
return message.say('This Command requires a channel named `mod_logs` or one custom set with the `modchannel` command.');
|
||||
return msg.say('This Command requires a channel named `mod_logs` or one custom set with the `modchannel` command.');
|
||||
if (!modlogs.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
const { member, reason } = args;
|
||||
if (!member.bannable)
|
||||
return message.say('This member is not bannable. Perhaps they have a higher role than me?');
|
||||
return msg.say('This member is not bannable. Perhaps they have a higher role than me?');
|
||||
try {
|
||||
try {
|
||||
await member.send(`You were softbanned from ${message.guild.name}!\nReason: ${reason}.`);
|
||||
await member.send(`You were softbanned from ${msg.guild.name}!\nReason: ${reason}.`);
|
||||
} catch (err) {
|
||||
await message.say('Failed to send DM to user.');
|
||||
await msg.say('Failed to send DM to user.');
|
||||
}
|
||||
await member.ban({
|
||||
days: 7,
|
||||
reason
|
||||
});
|
||||
await message.guild.unban(member.user);
|
||||
await message.say(':ok_hand:');
|
||||
await msg.guild.unban(member.user);
|
||||
await msg.say(':ok_hand:');
|
||||
const embed = new RichEmbed()
|
||||
.setAuthor(message.author.tag, message.author.displayAvatarURL)
|
||||
.setAuthor(msg.author.tag, msg.author.displayAvatarURL)
|
||||
.setColor(0xFF4500)
|
||||
.setTimestamp()
|
||||
.setDescription(`**Member:** ${member.user.tag} (${member.id})\n**Action:** Softban\n**Reason:** ${reason}`);
|
||||
return modlogs.send({embed});
|
||||
} catch (err) {
|
||||
return message.say('An Unknown Error Occurred.');
|
||||
return msg.say('An Unknown Error Occurred.');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -38,30 +38,30 @@ module.exports = class UnbanCommand extends Command {
|
||||
return msg.member.permissions.has('BAN_MEMBERS') || msg.member.roles.exists('name', msg.guild.settings.get('staffRole', 'Server Staff'));
|
||||
}
|
||||
|
||||
async run(message, args) {
|
||||
if (!message.channel.permissionsFor(this.client.user).has('BAN_MEMBERS'))
|
||||
return message.say('This Command requires the `Ban Members` Permission.');
|
||||
const modlogs = message.guild.channels.find('name', message.guild.settings.get('modLog', 'mod_logs'));
|
||||
async run(msg, args) {
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('BAN_MEMBERS'))
|
||||
return msg.say('This Command requires the `Ban Members` Permission.');
|
||||
const modlogs = msg.guild.channels.find('name', msg.guild.settings.get('modLog', 'mod_logs'));
|
||||
if (!modlogs)
|
||||
return message.say('This Command requires a channel named `mod_logs` or one custom set with the `modchannel` command.');
|
||||
return msg.say('This Command requires a channel named `mod_logs` or one custom set with the `modchannel` command.');
|
||||
if (!modlogs.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
const { id, reason } = args;
|
||||
const bans = await message.guild.fetchBans();
|
||||
const bans = await msg.guild.fetchBans();
|
||||
if (!bans.has(id))
|
||||
return message.say('This ID is not in the Guild Banlist.');
|
||||
return msg.say('This ID is not in the Guild Banlist.');
|
||||
const member = bans.get(id);
|
||||
try {
|
||||
await message.guild.unban(member);
|
||||
await message.say(':ok_hand:');
|
||||
await msg.guild.unban(member);
|
||||
await msg.say(':ok_hand:');
|
||||
const embed = new RichEmbed()
|
||||
.setAuthor(message.author.tag, message.author.displayAvatarURL)
|
||||
.setAuthor(msg.author.tag, msg.author.displayAvatarURL)
|
||||
.setColor(0x00AE86)
|
||||
.setTimestamp()
|
||||
.setDescription(`**Member:** ${member.tag} (${member.id})\n**Action:** Unban\n**Reason:** ${reason}`);
|
||||
return modlogs.send({embed});
|
||||
} catch (err) {
|
||||
return message.say('An Unknown Error Occurred.');
|
||||
return msg.say('An Unknown Error Occurred.');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -30,23 +30,23 @@ module.exports = class WarnCommand extends Command {
|
||||
return msg.member.permissions.has('KICK_MEMBERS') || msg.member.roles.exists('name', msg.guild.settings.get('staffRole', 'Server Staff'));
|
||||
}
|
||||
|
||||
async run(message, args) {
|
||||
const modlogs = message.guild.channels.find('name', message.guild.settings.get('modLog', 'mod_logs'));
|
||||
async run(msg, args) {
|
||||
const modlogs = msg.guild.channels.find('name', msg.guild.settings.get('modLog', 'mod_logs'));
|
||||
if (!modlogs)
|
||||
return message.say('This Command requires a channel named `mod_logs` or one custom set with the `modchannel` command.');
|
||||
return msg.say('This Command requires a channel named `mod_logs` or one custom set with the `modchannel` command.');
|
||||
if (!modlogs.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
const { member, reason } = args;
|
||||
try {
|
||||
await message.say(':ok_hand:');
|
||||
await msg.say(':ok_hand:');
|
||||
const embed = new RichEmbed()
|
||||
.setAuthor(message.author.tag, message.author.displayAvatarURL)
|
||||
.setAuthor(msg.author.tag, msg.author.displayAvatarURL)
|
||||
.setColor(0xFFFF00)
|
||||
.setTimestamp()
|
||||
.setDescription(`**Member:** ${member.user.tag} (${member.id})\n**Action:** Warn\n**Reason:** ${reason}`);
|
||||
return modlogs.send({embed});
|
||||
} catch (err) {
|
||||
return message.say('An Unknown Error Occurred.');
|
||||
return msg.say('An Unknown Error Occurred.');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -25,8 +25,8 @@ module.exports = class EasterEggCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
run(msg, args) {
|
||||
const { tag } = args;
|
||||
return message.say(eastereggs[tag]);
|
||||
return msg.say(eastereggs[tag]);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -10,7 +10,7 @@ module.exports = class GiveFlowerCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message) {
|
||||
return message.say('Ooh, what a pretty flower. What, I may have it? Thanks! I like flowers, yes? ♪');
|
||||
run(msg) {
|
||||
return msg.say('Ooh, what a pretty flower. What, I may have it? Thanks! I like flowers, yes? ♪');
|
||||
}
|
||||
};
|
||||
|
||||
@@ -10,7 +10,7 @@ module.exports = class LennyCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message) {
|
||||
return message.say('( ͡° ͜ʖ ͡°)');
|
||||
run(msg) {
|
||||
return msg.say('( ͡° ͜ʖ ͡°)');
|
||||
}
|
||||
};
|
||||
|
||||
@@ -16,14 +16,14 @@ module.exports = class MathCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
run(msg, args) {
|
||||
const { expression } = args;
|
||||
try {
|
||||
const solved = math.eval(expression);
|
||||
return message.say(solved)
|
||||
.catch(() => message.say('Invalid statement.'));
|
||||
return msg.say(solved)
|
||||
.catch(() => msg.say('Invalid statement.'));
|
||||
} catch (err) {
|
||||
return message.say('Invalid statement.');
|
||||
return msg.say('Invalid statement.');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -11,16 +11,16 @@ module.exports = class NitroCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message) {
|
||||
if (message.channel.type !== 'dm')
|
||||
if (!message.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
run(msg) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
const embed = new RichEmbed()
|
||||
.setAuthor('Discord Nitro')
|
||||
.setThumbnail('https://pbs.twimg.com/profile_images/814184180649197568/y2eZcVMq.jpg')
|
||||
.setColor(0x748BD9)
|
||||
.setURL('https://discordapp.com/nitro')
|
||||
.setDescription('This Message can only be viewed by members with Discord Nitro.\n[More Information](https://discordapp.com/nitro)');
|
||||
return message.embed(embed);
|
||||
return msg.embed(embed);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -10,10 +10,10 @@ module.exports = class SpamCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message) {
|
||||
if (message.channel.type !== 'dm')
|
||||
if (!message.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
||||
return message.say('This Command requires the `Attach Files` Permission.');
|
||||
return message.channel.send({files: ['https://i.imgur.com/2JFu5xE.jpg']});
|
||||
run(msg) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
||||
return msg.say('This Command requires the `Attach Files` Permission.');
|
||||
return msg.channel.send({files: ['https://i.imgur.com/2JFu5xE.jpg']});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -31,12 +31,12 @@ module.exports = class StrawpollCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(message, args) {
|
||||
async run(msg, args) {
|
||||
const { title, choices } = args;
|
||||
if (choices.length < 2)
|
||||
return message.say('You provided less than two choices.');
|
||||
return msg.say('You provided less than two choices.');
|
||||
if (choices.length > 31)
|
||||
return message.say('You provided more than thirty choices.');
|
||||
return msg.say('You provided more than thirty choices.');
|
||||
try {
|
||||
const { body } = await request
|
||||
.post('https://strawpoll.me/api/v2/polls')
|
||||
@@ -44,10 +44,10 @@ module.exports = class StrawpollCommand extends Command {
|
||||
title: title,
|
||||
options: choices
|
||||
});
|
||||
return message.say(`${body.title}\nhttp://strawpoll.me/${body.id}`);
|
||||
return msg.say(`${body.title}\nhttp://strawpoll.me/${body.id}`);
|
||||
}
|
||||
catch (err) {
|
||||
return message.say('An Unknown Error Occurred.');
|
||||
return msg.say('An Unknown Error Occurred.');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -12,10 +12,10 @@ module.exports = class TodayCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(message) {
|
||||
if (message.channel.type !== 'dm')
|
||||
if (!message.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
async run(msg) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
try {
|
||||
const { text } = await request
|
||||
.get('http://history.muffinlabs.com/date')
|
||||
@@ -29,9 +29,9 @@ module.exports = class TodayCommand extends Command {
|
||||
.setTitle(`On this day (${parsed.date})...`)
|
||||
.setTimestamp()
|
||||
.setDescription(`${events[random].year}: ${events[random].text}`);
|
||||
return message.embed(embed);
|
||||
return msg.embed(embed);
|
||||
} catch (err) {
|
||||
return message.say('An Unknown Error Occurred.');
|
||||
return msg.say('An Unknown Error Occurred.');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -15,10 +15,10 @@ module.exports = class WouldYouRatherCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(message) {
|
||||
if (message.channel.type !== 'dm')
|
||||
if (!message.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
async run(msg) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
try {
|
||||
const { body } = await request
|
||||
.get('http://www.rrrather.com/botapi');
|
||||
@@ -27,9 +27,9 @@ module.exports = class WouldYouRatherCommand extends Command {
|
||||
.setURL(body.link)
|
||||
.setColor(0x9797FF)
|
||||
.setDescription(`${body.choicea} OR ${body.choiceb}?`);
|
||||
return message.embed(embed);
|
||||
return msg.embed(embed);
|
||||
} catch (err) {
|
||||
return message.say('An Unknown Error Occurred.');
|
||||
return msg.say('An Unknown Error Occurred.');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -14,16 +14,16 @@ module.exports = class CatCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(message) {
|
||||
if (message.channel.type !== 'dm')
|
||||
if (!message.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
||||
return message.say('This Command requires the `Attach Files` Permission.');
|
||||
async run(msg) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
||||
return msg.say('This Command requires the `Attach Files` Permission.');
|
||||
try {
|
||||
const { body } = await request
|
||||
.get('http://random.cat/meow');
|
||||
return message.channel.send({files: [body.file]});
|
||||
return msg.channel.send({files: [body.file]});
|
||||
} catch (err) {
|
||||
return message.say('An Unknown Error Occurred.');
|
||||
return msg.say('An Unknown Error Occurred.');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -11,16 +11,16 @@ module.exports = class DogCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(message) {
|
||||
if (message.channel.type !== 'dm')
|
||||
if (!message.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
||||
return message.say('This Command requires the `Attach Files` Permission.');
|
||||
async run(msg) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
||||
return msg.say('This Command requires the `Attach Files` Permission.');
|
||||
try {
|
||||
const { body } = await request
|
||||
.get('https://random.dog/woof.json');
|
||||
return message.channel.send({files: [body.url]});
|
||||
return msg.channel.send({files: [body.url]});
|
||||
} catch (err) {
|
||||
return message.say('An Unknown Error Occurred.');
|
||||
return msg.say('An Unknown Error Occurred.');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -11,8 +11,8 @@ module.exports = class VocaloidCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message) {
|
||||
run(msg) {
|
||||
const song = songs[Math.floor(Math.random() * songs.length)];
|
||||
return message.say(song);
|
||||
return msg.say(song);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -14,11 +14,11 @@ module.exports = class XiaoCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message) {
|
||||
if (message.channel.type !== 'dm')
|
||||
if (!message.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
||||
return message.say('This Command requires the `Attach Files` Permission.');
|
||||
run(msg) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
||||
return msg.say('This Command requires the `Attach Files` Permission.');
|
||||
const xiao = xiaos[Math.floor(Math.random() * xiaos.length)];
|
||||
return message.channel.send({files: [xiao]});
|
||||
return msg.channel.send({files: [xiao]});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -16,9 +16,9 @@ module.exports = class MagicBallCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
run(msg, args) {
|
||||
const { question } = args;
|
||||
const answer = answers[Math.floor(Math.random() * answers.length)];
|
||||
return message.say(`Question: ${question}\n:8ball: ${answer} :8ball:`);
|
||||
return msg.say(`Question: ${question}\n:8ball: ${answer} :8ball:`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -16,9 +16,9 @@ module.exports = class ChooseCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
run(msg, args) {
|
||||
const { choices } = args;
|
||||
const choice = choices[Math.floor(Math.random() * choices.length)];
|
||||
return message.say(`I choose ${choice}!`);
|
||||
return msg.say(`I choose ${choice}!`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -15,8 +15,8 @@ module.exports = class CoinFlipCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message) {
|
||||
run(msg) {
|
||||
const side = sides[Math.floor(Math.random() * sides.length)];
|
||||
return message.say(`It landed on ${side}!`);
|
||||
return msg.say(`It landed on ${side}!`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -16,9 +16,9 @@ module.exports = class ComplimentCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
run(msg, args) {
|
||||
const { thing } = args;
|
||||
const compliment = compliments[Math.floor(Math.random() * compliments.length)];
|
||||
return message.say(`${thing}, ${compliment}`);
|
||||
return msg.say(`${thing}, ${compliment}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -11,8 +11,8 @@ module.exports = class FactCoreCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message) {
|
||||
run(msg) {
|
||||
const fact = facts[Math.floor(Math.random() * facts.length)];
|
||||
return message.say(fact);
|
||||
return msg.say(fact);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -11,8 +11,8 @@ module.exports = class FishyCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message) {
|
||||
run(msg) {
|
||||
const fish = fishes[Math.floor(Math.random() * fishes.length)];
|
||||
return message.say(`You caught a: ${fish}`);
|
||||
return msg.say(`You caught a: ${fish}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -11,8 +11,8 @@ module.exports = class FortuneCookieCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message) {
|
||||
run(msg) {
|
||||
const fortune = fortunes[Math.floor(Math.random() * fortunes.length)];
|
||||
return message.say(fortune);
|
||||
return msg.say(fortune);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -22,15 +22,15 @@ module.exports = class RandomNameCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
run(msg, args) {
|
||||
const { gender } = args;
|
||||
const lastName = lastNames[Math.floor(Math.random() * lastNames.length)];
|
||||
if (gender === 'male') {
|
||||
const name = maleNames[Math.floor(Math.random() * maleNames.length)];
|
||||
return message.say(`${name} ${lastName}`);
|
||||
return msg.say(`${name} ${lastName}`);
|
||||
} else if (gender === 'female') {
|
||||
const name = femaleNames[Math.floor(Math.random() * femaleNames.length)];
|
||||
return message.say(`${name} ${lastName}`);
|
||||
return msg.say(`${name} ${lastName}`);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -11,8 +11,8 @@ module.exports = class OffspringCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message) {
|
||||
run(msg) {
|
||||
const gender = genders[Math.floor(Math.random() * genders.length)];
|
||||
return message.say(`It's a ${gender}!`);
|
||||
return msg.say(`It's a ${gender}!`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -14,8 +14,8 @@ module.exports = class QuantumCoinCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message) {
|
||||
run(msg) {
|
||||
const side = sides[Math.floor(Math.random() * sides.length)];
|
||||
return message.say(`It landed ${side}.`);
|
||||
return msg.say(`It landed ${side}.`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -18,9 +18,9 @@ module.exports = class RateWaifuCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
run(msg, args) {
|
||||
const { waifu } = args;
|
||||
const rating = Math.floor(Math.random() * 10) + 1;
|
||||
return message.say(`I'd give ${waifu} a ${rating}/10!`);
|
||||
return msg.say(`I'd give ${waifu} a ${rating}/10!`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -16,9 +16,9 @@ module.exports = class RoastCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
run(msg, args) {
|
||||
const { thing } = args;
|
||||
const roast = roasts[Math.floor(Math.random() * roasts.length)];
|
||||
return message.say(`${thing}, ${roast}`);
|
||||
return msg.say(`${thing}, ${roast}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -18,9 +18,9 @@ module.exports = class RollCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
run(msg, args) {
|
||||
const { value } = args;
|
||||
const roll = Math.floor(Math.random() * value) + 1;
|
||||
return message.say(`You rolled a ${roll}.`);
|
||||
return msg.say(`You rolled a ${roll}.`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -11,7 +11,7 @@ module.exports = class RouletteCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message) {
|
||||
return message.say(`I choose ${message.guild.members.random().displayName}!`);
|
||||
run(msg) {
|
||||
return msg.say(`I choose ${msg.guild.members.random().displayName}!`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -18,9 +18,9 @@ module.exports = class ShipCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
run(msg, args) {
|
||||
const { things } = args;
|
||||
const rating = Math.floor(Math.random() * 100) + 1;
|
||||
return message.say(`I'd give ${things} a ${rating}%!`);
|
||||
return msg.say(`I'd give ${things} a ${rating}%!`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -15,8 +15,8 @@ module.exports = class CuddleCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
run(msg, args) {
|
||||
const { thing } = args;
|
||||
return message.say(`${message.author} *cuddles* ${thing}`);
|
||||
return msg.say(`${msg.author} *cuddles* ${thing}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -15,8 +15,8 @@ module.exports = class DivorceCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
run(msg, args) {
|
||||
const { thing } = args;
|
||||
return message.say(`${message.author} *divorces* ${thing}`);
|
||||
return msg.say(`${msg.author} *divorces* ${thing}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -15,8 +15,8 @@ module.exports = class EatCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
run(msg, args) {
|
||||
const { thing } = args;
|
||||
return message.say(`${message.author} *eats* ${thing}`);
|
||||
return msg.say(`${msg.author} *eats* ${thing}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -15,8 +15,8 @@ module.exports = class FalconPunchCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
run(msg, args) {
|
||||
const { thing } = args;
|
||||
return message.say(`${message.author} *falcon punches* ${thing}`);
|
||||
return msg.say(`${msg.author} *falcon punches* ${thing}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -15,8 +15,8 @@ module.exports = class FistBumpCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
run(msg, args) {
|
||||
const { thing } = args;
|
||||
return message.say(`${message.author} *fist-bumps* ${thing} *badalalala*`);
|
||||
return msg.say(`${msg.author} *fist-bumps* ${thing} *badalalala*`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -15,8 +15,8 @@ module.exports = class HighFivesCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
run(msg, args) {
|
||||
const { thing } = args;
|
||||
return message.say(`${message.author} *high-fives* ${thing}`);
|
||||
return msg.say(`${msg.author} *high-fives* ${thing}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -15,8 +15,8 @@ module.exports = class HitwithShovelCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
run(msg, args) {
|
||||
const { thing } = args;
|
||||
return message.say(`${message.author} *hits* ${thing} *with a shovel*`);
|
||||
return msg.say(`${msg.author} *hits* ${thing} *with a shovel*`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -15,8 +15,8 @@ module.exports = class HugCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
run(msg, args) {
|
||||
const { thing } = args;
|
||||
return message.say(`${message.author} *hugs* ${thing}`);
|
||||
return msg.say(`${msg.author} *hugs* ${thing}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -15,8 +15,8 @@ module.exports = class InhaleCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
run(msg, args) {
|
||||
const { thing } = args;
|
||||
return message.say(`${message.author} *inhales* ${thing} *but gained no ability...*`);
|
||||
return msg.say(`${msg.author} *inhales* ${thing} *but gained no ability...*`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -15,8 +15,8 @@ module.exports = class KillCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
run(msg, args) {
|
||||
const { thing } = args;
|
||||
return message.say(`${message.author} *kills* ${thing}`);
|
||||
return msg.say(`${msg.author} *kills* ${thing}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -15,8 +15,8 @@ module.exports = class KissCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
run(msg, args) {
|
||||
const { thing } = args;
|
||||
return message.say(`${message.author} *kisses* ${thing}`);
|
||||
return msg.say(`${msg.author} *kisses* ${thing}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -15,8 +15,8 @@ module.exports = class MarryCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
run(msg, args) {
|
||||
const { thing } = args;
|
||||
return message.say(`${message.author} *marries* ${thing}`);
|
||||
return msg.say(`${msg.author} *marries* ${thing}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -15,8 +15,8 @@ module.exports = class PatCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
run(msg, args) {
|
||||
const { thing } = args;
|
||||
return message.say(`${message.author} *pats* ${thing}`);
|
||||
return msg.say(`${msg.author} *pats* ${thing}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -15,8 +15,8 @@ module.exports = class PokeCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
run(msg, args) {
|
||||
const { thing } = args;
|
||||
return message.say(`${message.author} *pokes* ${thing}`);
|
||||
return msg.say(`${msg.author} *pokes* ${thing}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -15,8 +15,8 @@ module.exports = class PunchCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
run(msg, args) {
|
||||
const { thing } = args;
|
||||
return message.say(`${message.author} *punches* ${thing}`);
|
||||
return msg.say(`${msg.author} *punches* ${thing}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -15,8 +15,8 @@ module.exports = class SlapCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
run(msg, args) {
|
||||
const { thing } = args;
|
||||
return message.say(`${message.author} *slaps* ${thing}`);
|
||||
return msg.say(`${msg.author} *slaps* ${thing}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -17,10 +17,10 @@ module.exports = class BotSearchCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(message, args) {
|
||||
if (message.channel.type !== 'dm')
|
||||
if (!message.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
async run(msg, args) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
const { bot } = args;
|
||||
try {
|
||||
const { body } = await request
|
||||
@@ -40,9 +40,9 @@ module.exports = class BotSearchCommand extends Command {
|
||||
`[Here](${body.invite_url})`, true)
|
||||
.addField('**Prefix:**',
|
||||
body.prefix, true);
|
||||
return message.embed(embed);
|
||||
return msg.embed(embed);
|
||||
} catch (err) {
|
||||
return message.say('An Error Occurred. The bot may not have been found.');
|
||||
return msg.say('An Error Occurred. The bot may not have been found.');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -18,10 +18,10 @@ module.exports = class DefineCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(message, args) {
|
||||
if (message.channel.type !== 'dm')
|
||||
if (!message.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
async run(msg, args) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
const { query } = args;
|
||||
try {
|
||||
const { body } = await request
|
||||
@@ -30,9 +30,9 @@ module.exports = class DefineCommand extends Command {
|
||||
.setColor(0x9797FF)
|
||||
.setTitle(body[0].word)
|
||||
.setDescription(body[0].text);
|
||||
return message.embed(embed);
|
||||
return msg.embed(embed);
|
||||
} catch (err) {
|
||||
return message.say('An Error Occurred. The word may not have been found.');
|
||||
return msg.say('An Error Occurred. The word may not have been found.');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -25,15 +25,15 @@ module.exports = class DiscrimCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(message, args) {
|
||||
if (message.channel.type !== 'dm')
|
||||
if (!message.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
async run(msg, args) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.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();
|
||||
const embed = new RichEmbed()
|
||||
.setTitle(`${users.length} Users with the discriminator: ${discrim}`)
|
||||
.setDescription(users.join(', '));
|
||||
return message.embed(embed);
|
||||
return msg.embed(embed);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -17,10 +17,10 @@ module.exports = class ForecastCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(message, args) {
|
||||
if (message.channel.type !== 'dm')
|
||||
if (!message.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
async run(msg, args) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
const { query } = args;
|
||||
try {
|
||||
const { body } = await request
|
||||
@@ -45,9 +45,9 @@ module.exports = class ForecastCommand extends Command {
|
||||
`**High:** ${forecasts[5].high}°F, **Low:** ${forecasts[5].low}°F, **Condition:** ${forecasts[5].text}`)
|
||||
.addField(`**${forecasts[6].day} - ${forecasts[6].date}:**`,
|
||||
`**High:** ${forecasts[6].high}°F, **Low:** ${forecasts[6].low}°F, **Condition:** ${forecasts[6].text}`);
|
||||
return message.embed(embed);
|
||||
return msg.embed(embed);
|
||||
} catch (err) {
|
||||
return message.say('An Error Occurred. The location may not have been found.');
|
||||
return msg.say('An Error Occurred. The location may not have been found.');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -19,9 +19,9 @@ module.exports = class GoogleCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(message, args) {
|
||||
async run(msg, args) {
|
||||
const { query } = args;
|
||||
const msg = await message.say('Searching...');
|
||||
const message = await msg.say('Searching...');
|
||||
try {
|
||||
const { text } = await request
|
||||
.get(`https://www.google.com/search?q=${query}`);
|
||||
@@ -29,9 +29,9 @@ module.exports = class GoogleCommand extends Command {
|
||||
let href = $('.r').first().find('a').first().attr('href');
|
||||
if (!href) throw new Error('No Results');
|
||||
href = querystring.parse(href.replace('/url?', ''));
|
||||
return msg.edit(href.q);
|
||||
return message.edit(href.q);
|
||||
} catch (err) {
|
||||
return msg.edit('No Results Found.');
|
||||
return message.edit('No Results Found.');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -18,10 +18,10 @@ module.exports = class IMDBCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(message, args) {
|
||||
if (message.channel.type !== 'dm')
|
||||
if (!message.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
async run(msg, args) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
const { query } = args;
|
||||
try {
|
||||
const { body } = await request
|
||||
@@ -46,9 +46,9 @@ module.exports = class IMDBCommand extends Command {
|
||||
body.Writer)
|
||||
.addField('**Actors:**',
|
||||
body.Actors);
|
||||
return message.embed(embed);
|
||||
return msg.embed(embed);
|
||||
} catch (err) {
|
||||
return message.say('An Error Occurred. The film may not have been found.');
|
||||
return msg.say('An Error Occurred. The film may not have been found.');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -16,8 +16,8 @@ module.exports = class LMGTFYCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
run(msg, args) {
|
||||
const { query } = args;
|
||||
return message.say(`http://lmgtfy.com/?iie=1&q=${query}`);
|
||||
return msg.say(`http://lmgtfy.com/?iie=1&q=${query}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -26,17 +26,17 @@ module.exports = class MapCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(message, args) {
|
||||
if (message.channel.type !== 'dm')
|
||||
if (!message.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
||||
return message.say('This Command requires the `Attach Files` Permission.');
|
||||
async run(msg, args) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
||||
return msg.say('This Command requires the `Attach Files` Permission.');
|
||||
const { zoom, query } = args;
|
||||
try {
|
||||
const { body } = await request
|
||||
.get(`https://maps.googleapis.com/maps/api/staticmap?center=${query}&zoom=${zoom}&size=500x500&key=${process.env.GOOGLE_KEY}`);
|
||||
return message.channel.send({files: [{attachment: body}]});
|
||||
return msg.channel.send({files: [{attachment: body}]});
|
||||
} catch (err) {
|
||||
return message.say('An Error Occurred. The location may not have been found.');
|
||||
return msg.say('An Error Occurred. The location may not have been found.');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -18,7 +18,7 @@ module.exports = class NeopetCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(message, args) {
|
||||
async run(msg, args) {
|
||||
const { query } = args;
|
||||
try {
|
||||
const { text } = await request
|
||||
@@ -26,10 +26,10 @@ module.exports = class NeopetCommand extends Command {
|
||||
const $ = cheerio.load(text);
|
||||
const link = $('textarea').first().text();
|
||||
if (!link.includes('cp'))
|
||||
return message.say('This is not a valid pet name.');
|
||||
return message.say(link);
|
||||
return msg.say('This is not a valid pet name.');
|
||||
return msg.say(link);
|
||||
} catch (err) {
|
||||
return message.say('An Unknown Error Occurred.');
|
||||
return msg.say('An Unknown Error Occurred.');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -18,10 +18,10 @@ module.exports = class OsuCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(message, args) {
|
||||
if (message.channel.type !== 'dm')
|
||||
if (!message.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
async run(msg, args) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
const { query } = args;
|
||||
try {
|
||||
const { body } = await request
|
||||
@@ -54,9 +54,9 @@ module.exports = class OsuCommand extends Command {
|
||||
body[0].count_rank_s, true)
|
||||
.addField('**A:**',
|
||||
body[0].count_rank_a, true);
|
||||
return message.embed(embed);
|
||||
return msg.embed(embed);
|
||||
} catch (err) {
|
||||
return message.say('An Error Occurred. The user may not have been found.');
|
||||
return msg.say('An Error Occurred. The user may not have been found.');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -18,10 +18,10 @@ module.exports = class SoundCloudCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(message, args) {
|
||||
if (message.channel.type !== 'dm')
|
||||
if (!message.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
async run(msg, args) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
const { query } = args;
|
||||
try {
|
||||
const { body } = await request
|
||||
@@ -41,9 +41,9 @@ module.exports = class SoundCloudCommand extends Command {
|
||||
body[0].playback_count, true)
|
||||
.addField('**Favorited Count:**',
|
||||
body[0].favoritings_count, true);
|
||||
return message.embed(embed);
|
||||
return msg.embed(embed);
|
||||
} catch (err) {
|
||||
return message.say('An Error Occurred. The song may not have been found.');
|
||||
return msg.say('An Error Occurred. The song may not have been found.');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -18,10 +18,10 @@ module.exports = class UrbanCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(message, args) {
|
||||
if (message.channel.type !== 'dm')
|
||||
if (!message.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
async run(msg, args) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
const { query } = args;
|
||||
try {
|
||||
const { body } = await request
|
||||
@@ -34,9 +34,9 @@ module.exports = class UrbanCommand extends Command {
|
||||
.setDescription(body.list[0].definition.substr(0, 2000))
|
||||
.addField('**Example:**',
|
||||
body.list[0].example.substr(0, 2000) || 'None');
|
||||
return message.embed(embed);
|
||||
return msg.embed(embed);
|
||||
} catch (err) {
|
||||
return message.say('An Error Occurred. The word may not have been found.');
|
||||
return msg.say('An Error Occurred. The word may not have been found.');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -18,10 +18,10 @@ module.exports = class WattpadCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(message, args) {
|
||||
if (message.channel.type !== 'dm')
|
||||
if (!message.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
async run(msg, args) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
const { query } = args;
|
||||
try {
|
||||
const { body } = await request
|
||||
@@ -47,9 +47,9 @@ module.exports = class WattpadCommand extends Command {
|
||||
body.stories[0].readCount, true)
|
||||
.addField('**Comments:**',
|
||||
body.stories[0].commentCount, true);
|
||||
return message.embed(embed);
|
||||
return msg.embed(embed);
|
||||
} catch (err) {
|
||||
return message.say('An Error Occurred. The book may not have been found.');
|
||||
return msg.say('An Error Occurred. The book may not have been found.');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -17,10 +17,10 @@ module.exports = class WeatherCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(message, args) {
|
||||
if (message.channel.type !== 'dm')
|
||||
if (!message.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
async run(msg, args) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
const { query } = args;
|
||||
try {
|
||||
const { body } = await request
|
||||
@@ -54,9 +54,9 @@ module.exports = class WeatherCommand extends Command {
|
||||
body.query.results.channel.wind.direction, true)
|
||||
.addField('**Wind Speed:**',
|
||||
body.query.results.channel.wind.speed, true);
|
||||
return message.embed(embed);
|
||||
return msg.embed(embed);
|
||||
} catch (err) {
|
||||
return message.say('An Error Occurred. The location may not have been found.');
|
||||
return msg.say('An Error Occurred. The location may not have been found.');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -18,10 +18,10 @@ module.exports = class WikipediaCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(message, args) {
|
||||
if (message.channel.type !== 'dm')
|
||||
if (!message.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
async run(msg, args) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
const { query } = args;
|
||||
try {
|
||||
const { body } = await request
|
||||
@@ -31,10 +31,10 @@ module.exports = class WikipediaCommand extends Command {
|
||||
.setTitle(body.query.pages[0].title)
|
||||
.setURL(`https://en.wikipedia.org/wiki/${query}`)
|
||||
.setAuthor('Wikipedia', 'https://upload.wikimedia.org/wikipedia/en/thumb/8/80/Wikipedia-logo-v2.svg/1122px-Wikipedia-logo-v2.svg.png')
|
||||
.setDescription(body.query.pages[0].extract.substr(0, 2000).split('\n').join('\n\n'));
|
||||
return message.embed(embed);
|
||||
.setDescription(body.query.pages[0].extract.substr(0, 2000).replace(/[\n]/g, '\n\n'));
|
||||
return msg.embed(embed);
|
||||
} catch (err) {
|
||||
return message.say('An Error Occurred. The page may not have been found.');
|
||||
return msg.say('An Error Occurred. The page may not have been found.');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -18,10 +18,10 @@ module.exports = class YouTubeCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(message, args) {
|
||||
if (message.channel.type !== 'dm')
|
||||
if (!message.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
async run(msg, args) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
const { query } = args;
|
||||
try {
|
||||
const { body } = await request
|
||||
@@ -33,9 +33,9 @@ module.exports = class YouTubeCommand extends Command {
|
||||
.setAuthor(`YouTube - ${body.items[0].snippet.channelTitle}`, 'https://cdn3.iconfinder.com/data/icons/social-icons-5/607/YouTube_Play.png')
|
||||
.setURL(`https://www.youtube.com/watch?v=${body.items[0].id.videoId}`)
|
||||
.setThumbnail(body.items[0].snippet.thumbnails.default.url);
|
||||
return message.embed(embed);
|
||||
return msg.embed(embed);
|
||||
} catch (err) {
|
||||
return message.say('An Error Occurred. The video may not have been found.');
|
||||
return msg.say('An Error Occurred. The video may not have been found.');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -18,10 +18,10 @@ module.exports = class YuGiOhCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(message, args) {
|
||||
if (message.channel.type !== 'dm')
|
||||
if (!message.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
async run(msg, args) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
const { query } = args;
|
||||
try {
|
||||
const { body } = await request
|
||||
@@ -44,7 +44,7 @@ module.exports = class YuGiOhCommand extends Command {
|
||||
body.data.def, true)
|
||||
.addField('**Level:**',
|
||||
body.data.level, true);
|
||||
return message.embed(embed);
|
||||
return msg.embed(embed);
|
||||
}
|
||||
const embed = new RichEmbed()
|
||||
.setColor(0xBE5F1F)
|
||||
@@ -53,9 +53,9 @@ module.exports = class YuGiOhCommand extends Command {
|
||||
.setAuthor('Yu-Gi-Oh!', 'http://vignette3.wikia.nocookie.net/yugioh/images/1/10/Back-TF-EN-VG.png/revision/latest?cb=20120824043558')
|
||||
.addField('**Card Type:**',
|
||||
body.data.card_type, true);
|
||||
return message.embed(embed);
|
||||
return msg.embed(embed);
|
||||
} catch (err) {
|
||||
return message.say('An Error Occurred. The card may not have been found.');
|
||||
return msg.say('An Error Occurred. The card may not have been found.');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const binary = (str) => {
|
||||
const pad = '00000000';
|
||||
return unescape(encodeURIComponent(str))
|
||||
.split('').map(str => {
|
||||
const binary = str.charCodeAt(0).toString(2);
|
||||
return `${pad.slice(binary.length)}${binary}`;
|
||||
return `${'00000000'.slice(binary.length)}${binary}`;
|
||||
}).join('');
|
||||
};
|
||||
|
||||
@@ -29,8 +28,8 @@ module.exports = class BinaryCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
run(msg, args) {
|
||||
const { text } = args;
|
||||
return message.say(text);
|
||||
return msg.say(text);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -20,8 +20,8 @@ module.exports = class CowsayCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
run(msg, args) {
|
||||
const { text } = args;
|
||||
return message.code(null, `< ${text} >\n \\ ^__^\n \\ (oO)\\_______\n (__)\\ )\\/\\\n U ||----w |\n || ||`);
|
||||
return msg.code(null, `< ${text} >\n \\ ^__^\n \\ (oO)\\_______\n (__)\\ )\\/\\\n U ||----w |\n || ||`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -16,16 +16,16 @@ module.exports = class EmbedCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
if (message.channel.type !== 'dm')
|
||||
if (!message.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
run(msg, args) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
const { text } = args;
|
||||
const embed = new RichEmbed()
|
||||
.setAuthor(message.author.username, message.author.displayAvatarURL)
|
||||
.setAuthor(msg.author.tag, msg.author.displayAvatarURL)
|
||||
.setColor(0x00AE86)
|
||||
.setTimestamp()
|
||||
.setDescription(text);
|
||||
return message.embed(embed);
|
||||
return msg.embed(embed);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -23,8 +23,8 @@ module.exports = class MorseCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
run(msg, args) {
|
||||
const { text } = args;
|
||||
return message.say(text);
|
||||
return msg.say(text);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -23,8 +23,8 @@ module.exports = class PirateCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
run(msg, args) {
|
||||
const { text } = args;
|
||||
return message.say(`\u180E${text}`);
|
||||
return msg.say(`\u180E${text}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -16,8 +16,8 @@ module.exports = class ReverseCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
run(msg, args) {
|
||||
const { text } = args;
|
||||
return message.say(`\u180E${text}`);
|
||||
return msg.say(`\u180E${text}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -21,11 +21,11 @@ module.exports = class SayCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
if (!message.channel.permissionsFor(this.client.user).has('MANAGE_MESSAGES'))
|
||||
return message.say('This Command requires the `Manage Messages` Permission.');
|
||||
run(msg, args) {
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('MANAGE_MESSAGES'))
|
||||
return msg.say('This Command requires the `Manage Messages` Permission.');
|
||||
const { text } = args;
|
||||
message.delete();
|
||||
return message.say(`\u180E${text}`);
|
||||
msg.delete();
|
||||
return msg.say(`\u180E${text}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -23,8 +23,8 @@ module.exports = class TemmieCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
run(msg, args) {
|
||||
const { text } = args;
|
||||
return message.say(`\u180E${text}`);
|
||||
return msg.say(`\u180E${text}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -21,8 +21,8 @@ module.exports = class UpsideDownCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
run(msg, args) {
|
||||
const { text } = args;
|
||||
return message.say(text);
|
||||
return msg.say(text);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -25,12 +25,12 @@ module.exports = class WebhookCommand extends Command {
|
||||
return this.client.isOwner(msg.author);
|
||||
}
|
||||
|
||||
async run(message, args) {
|
||||
if (!message.channel.permissionsFor(this.client.user).has('MANAGE_MESSAGES'))
|
||||
return message.say('This Command requires the `Manage Messages` Permission.');
|
||||
async run(msg, args) {
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('MANAGE_MESSAGES'))
|
||||
return msg.say('This Command requires the `Manage Messages` Permission.');
|
||||
const { text } = args;
|
||||
try {
|
||||
message.delete();
|
||||
msg.delete();
|
||||
await request
|
||||
.post(process.env.WEBHOOK_URL)
|
||||
.send({
|
||||
@@ -38,7 +38,7 @@ module.exports = class WebhookCommand extends Command {
|
||||
});
|
||||
return null;
|
||||
} catch (err) {
|
||||
return message.say('An Unknown Error Occurred.');
|
||||
return msg.say('An Unknown Error Occurred.');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -23,8 +23,8 @@ module.exports = class ZalgoCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
run(msg, args) {
|
||||
const { text } = args;
|
||||
return message.say(`\u180E${text}`);
|
||||
return msg.say(`\u180E${text}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -15,8 +15,8 @@ module.exports = class AvatarCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
run(msg, args) {
|
||||
const { user } = args;
|
||||
return message.say(user.displayAvatarURL);
|
||||
return msg.say(user.displayAvatarURL);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -24,12 +24,12 @@ module.exports = class UserInfoCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(message, args) {
|
||||
if (message.channel.type !== 'dm')
|
||||
if (!message.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
async run(msg, args) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
const { user } = args;
|
||||
const member = await message.guild.fetchMember(user);
|
||||
const member = await msg.guild.fetchMember(user);
|
||||
let stat;
|
||||
let color;
|
||||
switch (user.presence.status) {
|
||||
@@ -65,6 +65,6 @@ module.exports = class UserInfoCommand extends Command {
|
||||
stat, true)
|
||||
.addField('**Playing:**',
|
||||
user.presence.game ? user.presence.game.name : 'None', true);
|
||||
return message.embed(embed);
|
||||
return msg.embed(embed);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -25,9 +25,9 @@ module.exports = class ClearSettingCommand extends Command {
|
||||
return msg.member.permissions.has('ADMINISTRATOR');
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
run(msg, args) {
|
||||
const { setting } = args;
|
||||
message.guild.settings.remove(setting);
|
||||
return message.say(`${setting} has been removed from your guild settings.`);
|
||||
msg.guild.settings.remove(setting);
|
||||
return msg.say(`${setting} has been removed from your guild settings.`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -17,10 +17,10 @@ module.exports = class InfoCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(message) {
|
||||
if (message.channel.type !== 'dm')
|
||||
if (!message.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
async run(msg) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
const guilds = await this.client.shard.fetchClientValues('guilds.size');
|
||||
const memory = await this.client.shard.broadcastEval('Math.round(process.memoryUsage().heapUsed / 1024 / 1024)');
|
||||
const embed = new RichEmbed()
|
||||
@@ -48,6 +48,6 @@ module.exports = class InfoCommand extends Command {
|
||||
'[commando](https://github.com/Gawdl3y/discord.js-commando), [zalgoize](https://github.com/clux/zalgolize), [superagent](https://github.com/visionmedia/superagent), [mathjs](http://mathjs.org/), [moment](http://momentjs.com), [moment-duration-format](https://github.com/jsmreese/moment-duration-format), [jimp](https://github.com/oliver-moran/jimp), [cheerio](https://cheerio.js.org/), [sequelize](http://docs.sequelizejs.com/en/v3/), [pg](https://github.com/brianc/node-postgres)')
|
||||
.addField('APIs',
|
||||
'[Wattpad](https://developer.wattpad.com/docs/api), [Wordnik](http://developer.wordnik.com/docs.html), [osu!](https://osu.ppy.sh/p/api), [memegen.link](https://memegen.link/), [Yugioh Prices](http://docs.yugiohprices.apiary.io/#), [YouTube Data](https://developers.google.com/youtube/v3/), [Discord Bots](https://bots.discord.pw/api), [Today in History](http://history.muffinlabs.com/#api), [jService](http://jservice.io/), [Urban Dictionary](https://github.com/zdict/zdict/wiki/Urban-dictionary-API-documentation), [OMDB](http://www.omdbapi.com/), [Yahoo Weather](https://developer.yahoo.com/weather/), [Wikipedia](https://en.wikipedia.org/w/api.php), [Google Static Maps](https://developers.google.com/maps/documentation/static-maps/), [Strawpoll](https://github.com/strawpoll/strawpoll/wiki/API), [rrrather](http://www.rrrather.com/botapi), [SoundCloud](https://developers.soundcloud.com/), [random.cat](http://random.cat/), [random.dog](https://random.dog/)');
|
||||
return message.embed(embed);
|
||||
return msg.embed(embed);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -10,8 +10,8 @@ module.exports = class InviteCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(message) {
|
||||
async run(msg) {
|
||||
const invite = await this.client.generateInvite('1345846343');
|
||||
return message.say(`Add me to your server with this link:\n${invite}\nOr, come to my server with this link:\n${this.client.options.invite}`);
|
||||
return msg.say(`Add me to your server with this link:\n${invite}\nOr, come to my server with this link:\n${this.client.options.invite}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -20,9 +20,9 @@ module.exports = class MemberLogCommand extends Command {
|
||||
return msg.member.permissions.has('ADMINISTRATOR');
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
run(msg, args) {
|
||||
const { channel } = args;
|
||||
message.guild.settings.set('memberLog', channel.name);
|
||||
return message.say(`Member Log channel set to ${channel.name}.`);
|
||||
msg.guild.settings.set('memberLog', channel.name);
|
||||
return msg.say(`Member Log channel set to ${channel.name}.`);
|
||||
}
|
||||
};
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user