mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-08 07:11:49 +02:00
Change arg assignment
This commit is contained in:
@@ -27,8 +27,8 @@ module.exports = class YearsCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const user = args.user || msg.author;
|
||||
async run(msg, { user }) {
|
||||
if (!user) user = msg.author;
|
||||
const avatarURL = user.displayAvatarURL({
|
||||
format: 'png',
|
||||
size: 256
|
||||
|
||||
@@ -27,8 +27,8 @@ module.exports = class ApprovedCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const user = args.user || msg.author;
|
||||
async run(msg, { user }) {
|
||||
if (!user) user = msg.author;
|
||||
const avatarURL = user.displayAvatarURL({
|
||||
format: 'png',
|
||||
size: 256
|
||||
|
||||
@@ -31,9 +31,8 @@ module.exports = class AvatarFusionCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { overlay } = args;
|
||||
const base = args.base || msg.author;
|
||||
async run(msg, { overlay, base }) {
|
||||
if (!base) base = msg.author;
|
||||
const baseAvatarURL = base.displayAvatarURL({
|
||||
format: 'png',
|
||||
size: 256
|
||||
|
||||
@@ -27,8 +27,8 @@ module.exports = class BeautifulCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const user = args.user || msg.author;
|
||||
async run(msg, { user }) {
|
||||
if (!user) user = msg.author;
|
||||
const avatarURL = user.displayAvatarURL({
|
||||
format: 'png',
|
||||
size: 256
|
||||
|
||||
@@ -27,8 +27,8 @@ module.exports = class BobRossCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const user = args.user || msg.author;
|
||||
async run(msg, { user }) {
|
||||
if (!user) user = msg.author;
|
||||
const avatarURL = user.displayAvatarURL({
|
||||
format: 'png',
|
||||
size: 256
|
||||
|
||||
@@ -32,8 +32,8 @@ module.exports = class CardCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const member = args.member || msg.member;
|
||||
async run(msg, { member }) {
|
||||
if (!member) member = msg.member;
|
||||
const avatarURL = member.user.displayAvatarURL({
|
||||
format: 'png',
|
||||
size: 256
|
||||
|
||||
@@ -26,8 +26,8 @@ module.exports = class ChallengerCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const user = args.user || msg.author;
|
||||
async run(msg, { user }) {
|
||||
if (!user) user = msg.author;
|
||||
const avatarURL = user.displayAvatarURL({
|
||||
format: 'png',
|
||||
size: 256
|
||||
|
||||
@@ -26,8 +26,8 @@ module.exports = class DexterCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const user = args.user || msg.author;
|
||||
async run(msg, { user }) {
|
||||
if (!user) user = msg.author;
|
||||
const avatarURL = user.displayAvatarURL({
|
||||
format: 'png',
|
||||
size: 256
|
||||
|
||||
@@ -26,8 +26,8 @@ module.exports = class GreyscaleCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const user = args.user || msg.author;
|
||||
async run(msg, { user }) {
|
||||
if (!user) user = msg.author;
|
||||
const avatarURL = user.displayAvatarURL({
|
||||
format: 'png',
|
||||
size: 256
|
||||
|
||||
@@ -25,8 +25,8 @@ module.exports = class InvertCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const user = args.user || msg.author;
|
||||
async run(msg, { user }) {
|
||||
if (!user) user = msg.author;
|
||||
const avatarURL = user.displayAvatarURL({
|
||||
format: 'png',
|
||||
size: 256
|
||||
|
||||
@@ -27,8 +27,8 @@ module.exports = class RainbowCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const user = args.user || msg.author;
|
||||
async run(msg, { user }) {
|
||||
if (!user) user = msg.author;
|
||||
const avatarURL = user.displayAvatarURL({
|
||||
format: 'png',
|
||||
size: 256
|
||||
|
||||
@@ -27,8 +27,8 @@ module.exports = class RejctedCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const user = args.user || msg.author;
|
||||
async run(msg, { user }) {
|
||||
if (!user) user = msg.author;
|
||||
const avatarURL = user.displayAvatarURL({
|
||||
format: 'png',
|
||||
size: 256
|
||||
|
||||
@@ -27,8 +27,8 @@ module.exports = class RIPCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const user = args.user || msg.author;
|
||||
async run(msg, { user }) {
|
||||
if (!user) user = msg.author;
|
||||
const avatarURL = user.displayAvatarURL({
|
||||
format: 'png',
|
||||
size: 256
|
||||
|
||||
@@ -26,8 +26,8 @@ module.exports = class SimbaCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const user = args.user || msg.author;
|
||||
async run(msg, { user }) {
|
||||
if (!user) user = msg.author;
|
||||
const avatarURL = user.displayAvatarURL({
|
||||
format: 'png',
|
||||
size: 256
|
||||
|
||||
@@ -30,8 +30,8 @@ module.exports = class SteamCardCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const member = args.member || msg.member;
|
||||
async run(msg, { member }) {
|
||||
if (!member) member = msg.member;
|
||||
const avatarURL = member.user.displayAvatarURL({
|
||||
format: 'png',
|
||||
size: 512
|
||||
|
||||
@@ -36,9 +36,8 @@ module.exports = class SteamNowPlayingCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
let { game } = args;
|
||||
const member = args.member || msg.member;
|
||||
async run(msg, { game, member }) {
|
||||
if (!member) member = msg.member;
|
||||
const avatarURL = member.user.displayAvatarURL({
|
||||
format: 'png',
|
||||
size: 128
|
||||
|
||||
@@ -26,8 +26,8 @@ module.exports = class ThugLifeCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const user = args.user || msg.author;
|
||||
async run(msg, { user }) {
|
||||
if (!user) user = msg.author;
|
||||
const avatarURL = user.displayAvatarURL({
|
||||
format: 'png',
|
||||
size: 256
|
||||
|
||||
@@ -26,8 +26,8 @@ module.exports = class TriggeredCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const user = args.user || msg.author;
|
||||
async run(msg, { user }) {
|
||||
if (!user) user = msg.author;
|
||||
const avatarURL = user.displayAvatarURL({
|
||||
format: 'png',
|
||||
size: 512
|
||||
|
||||
@@ -26,8 +26,8 @@ module.exports = class WantedCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const user = args.user || msg.author;
|
||||
async run(msg, { user }) {
|
||||
if (!user) user = msg.author;
|
||||
const avatarURL = user.displayAvatarURL({
|
||||
format: 'png',
|
||||
size: 512
|
||||
|
||||
@@ -26,8 +26,8 @@ module.exports = class YuGiOhTokenCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const user = args.user || msg.author;
|
||||
async run(msg, { user }) {
|
||||
if (!user) user = msg.author;
|
||||
const avatarURL = user.displayAvatarURL({
|
||||
format: 'png',
|
||||
size: 512
|
||||
|
||||
@@ -22,8 +22,8 @@ module.exports = class BattleCommand extends Command {
|
||||
this.fighting = new Set();
|
||||
}
|
||||
|
||||
async run(msg, args) { // eslint-disable-line complexity
|
||||
const opponent = args.opponent || this.client.user;
|
||||
async run(msg, { opponent }) { // eslint-disable-line complexity
|
||||
if (!opponent) opponent = this.client.user;
|
||||
if (opponent.id === msg.author.id) return msg.say('You may not fight yourself.');
|
||||
if (this.fighting.has(msg.channel.id)) return msg.say('Only one fight may be occurring per channel.');
|
||||
this.fighting.add(msg.channel.id);
|
||||
|
||||
@@ -23,8 +23,7 @@ module.exports = class EmojiEmojiRevolutionCommand extends Command {
|
||||
this.playing = new Set();
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { opponent } = args;
|
||||
async run(msg, { opponent }) {
|
||||
if (opponent.bot) return msg.say('Bots may not be played against.');
|
||||
if (opponent.id === msg.author.id) return msg.say('You may not play against yourself.');
|
||||
if (this.playing.has(msg.channel.id)) return msg.say('Only one fight may be occurring per channel.');
|
||||
|
||||
@@ -23,8 +23,7 @@ module.exports = class GunfightCommand extends Command {
|
||||
this.fighting = new Set();
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { opponent } = args;
|
||||
async run(msg, { opponent }) {
|
||||
if (opponent.bot) return msg.say('Bots may not be fought.');
|
||||
if (opponent.id === msg.author.id) return msg.say('You may not fight yourself.');
|
||||
if (this.fighting.has(msg.channel.id)) return msg.say('Only one fight may be occurring per channel.');
|
||||
|
||||
@@ -50,8 +50,7 @@ module.exports = class MathGameCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { operation, difficulty } = args;
|
||||
async run(msg, { operation, difficulty }) {
|
||||
const value1 = Math.floor(Math.random() * maxValues[difficulty]) + 1;
|
||||
const value2 = Math.floor(Math.random() * maxValues[difficulty]) + 1;
|
||||
let answer;
|
||||
|
||||
@@ -40,8 +40,7 @@ module.exports = class QuizCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { type, difficulty } = args;
|
||||
async run(msg, { type, difficulty }) {
|
||||
try {
|
||||
const { body } = await snekfetch
|
||||
.get('https://opentdb.com/api.php')
|
||||
|
||||
@@ -20,8 +20,7 @@ module.exports = class RockPaperScissorsCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { choice } = args;
|
||||
run(msg, { choice }) {
|
||||
const response = choices[Math.floor(Math.random() * choices.length)];
|
||||
if (choice === 'rock') {
|
||||
if (response === 'rock') return msg.say('Rock! Aw... A tie...');
|
||||
|
||||
@@ -21,8 +21,8 @@ module.exports = class TicTacToeCommand extends Command {
|
||||
this.playing = new Set();
|
||||
}
|
||||
|
||||
async run(msg, args) { // eslint-disable-line complexity
|
||||
const opponent = args.opponent || this.client.user;
|
||||
async run(msg, { opponent }) { // eslint-disable-line complexity
|
||||
if (!opponent) opponent = this.client.user;
|
||||
if (opponent.id === msg.author.id) return msg.say('You may not play against yourself.');
|
||||
if (this.playing.has(msg.channel.id)) return msg.say('Only one game may be occurring per channel.');
|
||||
this.playing.add(msg.channel.id);
|
||||
|
||||
@@ -34,8 +34,7 @@ module.exports = class TypingGameCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { difficulty } = args;
|
||||
async run(msg, { difficulty }) {
|
||||
const sentence = sentences[Math.floor(Math.random() * sentences.length)];
|
||||
const time = times[difficulty];
|
||||
await msg.say(stripIndents`
|
||||
|
||||
@@ -30,8 +30,8 @@ module.exports = class ChannelInfoCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const channel = args.channel || msg.channel;
|
||||
run(msg, { channel }) {
|
||||
if (!channel) channel = msg.channel;
|
||||
const embed = new MessageEmbed()
|
||||
.setColor(0x00AE86)
|
||||
.addField('❯ Name',
|
||||
|
||||
@@ -22,8 +22,7 @@ module.exports = class RoleInfoCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { role } = args;
|
||||
run(msg, { role }) {
|
||||
const perms = Object.keys(util.permissions).filter(perm => role.serialize()[perm]);
|
||||
const embed = new MessageEmbed()
|
||||
.setColor(role.hexColor)
|
||||
|
||||
@@ -23,8 +23,7 @@ module.exports = class AchievementCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { text } = args;
|
||||
async run(msg, { text }) {
|
||||
try {
|
||||
const { body } = await snekfetch
|
||||
.get('https://www.minecraftskinstealer.com/achievement/a.php')
|
||||
|
||||
@@ -20,8 +20,7 @@ module.exports = class ColorCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { color } = args;
|
||||
run(msg, { color }) {
|
||||
const canvas = createCanvas(250, 250);
|
||||
const ctx = canvas.getContext('2d');
|
||||
ctx.fillStyle = color;
|
||||
|
||||
@@ -47,8 +47,7 @@ module.exports = class MemeCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { type, top, bottom } = args;
|
||||
async run(msg, { type, top, bottom }) {
|
||||
try {
|
||||
const { body } = await snekfetch
|
||||
.get(`https://memegen.link/api/templates/${type}/${top}/${bottom}`, { followRedirects: true });
|
||||
|
||||
@@ -34,8 +34,7 @@ module.exports = class PokemonFusionCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { body, palette } = args;
|
||||
run(msg, { body, palette }) {
|
||||
return msg.say(`http://images.alexonsager.net/pokemon/fused/${body}/${body}.${palette}.png`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -31,8 +31,7 @@ module.exports = class BanCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { member, reason } = args;
|
||||
async run(msg, { member, reason }) {
|
||||
if (member.id === msg.author.id) return msg.say('I don\'t think you want to ban yourself...');
|
||||
if (member.id === msg.guild.ownerID) return msg.say('Don\'t you think that might be betraying your leader?');
|
||||
if (!member.bannable) return msg.say('This member is not bannable. Perhaps they have a higher role than me?');
|
||||
|
||||
@@ -30,8 +30,7 @@ module.exports = class HackbanCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { id, reason } = args;
|
||||
async run(msg, { id, reason }) {
|
||||
if (id === msg.author.id) return msg.say('I don\'t think you want to ban yourself...');
|
||||
if (id === msg.guild.ownerID) return msg.say('Don\'t you think that might be betraying your leader?');
|
||||
let user;
|
||||
|
||||
@@ -31,8 +31,7 @@ module.exports = class KickCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { member, reason } = args;
|
||||
async run(msg, { member, reason }) {
|
||||
if (member.id === msg.author.id) return msg.say('I don\'t think you want to kick yourself...');
|
||||
if (member.id === msg.guild.ownerID) return msg.say('Don\'t you think that might be betraying your leader?');
|
||||
if (!member.kickable) return msg.say('This member is not kickable. Perhaps they have a higher role than me?');
|
||||
|
||||
@@ -27,8 +27,7 @@ module.exports = class LockdownCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) { // eslint-disable-line consistent-return
|
||||
const { action } = args;
|
||||
async run(msg, { action }) { // eslint-disable-line consistent-return
|
||||
if (action === 'start') {
|
||||
await msg.channel.overwritePermissions(msg.guild.defaultRole, { SEND_MESSAGES: false });
|
||||
return msg.say(stripIndents`
|
||||
|
||||
@@ -29,8 +29,7 @@ module.exports = class PruneCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { count } = args;
|
||||
async run(msg, { count }) {
|
||||
try {
|
||||
const messages = await msg.channel.messages.fetch({ limit: count + 1 });
|
||||
await msg.channel.bulkDelete(messages, true);
|
||||
|
||||
@@ -31,8 +31,7 @@ module.exports = class SoftbanCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { member, reason } = args;
|
||||
async run(msg, { member, reason }) {
|
||||
if (member.id === msg.author.id) return msg.say('I don\'t think you want to softban yourself...');
|
||||
if (member.id === msg.guild.ownerID) return msg.say('Don\'t you think that might be betraying your leader?');
|
||||
if (!member.bannable) return msg.say('This member is not softbannable. Perhaps they have a higher role than me?');
|
||||
|
||||
@@ -30,8 +30,7 @@ module.exports = class UnbanCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { id, reason } = args;
|
||||
async run(msg, { id, reason }) {
|
||||
const bans = await msg.guild.fetchBans();
|
||||
if (!bans.has(id)) return msg.say('This ID is not in the Guild Banlist.');
|
||||
const member = bans.get(id).user;
|
||||
|
||||
@@ -41,8 +41,7 @@ module.exports = class CurrencyCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { base, target, amount } = args;
|
||||
async run(msg, { base, target, amount }) {
|
||||
if (base === target) return msg.say(`Converting ${base} to ${target} is the same value, dummy.`);
|
||||
try {
|
||||
const { body } = await snekfetch
|
||||
|
||||
@@ -39,8 +39,7 @@ module.exports = class TemperatureCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) { // eslint-disable-line consistent-return
|
||||
const { base, target, amount } = args;
|
||||
run(msg, { base, target, amount }) { // eslint-disable-line consistent-return
|
||||
if (base === target) return msg.say(`Converting ${base} to ${target} is the same value, dummy.`);
|
||||
if (base === 'celsius') {
|
||||
if (target === 'fahrenheit') return msg.say(`${amount}°C is ${(amount * 1.8) + 32}°F.`);
|
||||
|
||||
@@ -19,8 +19,7 @@ module.exports = class MagicBallCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { question } = args;
|
||||
run(msg, { question }) {
|
||||
return msg.say(stripIndents`
|
||||
Question: ${question}
|
||||
🎱 ${answers[Math.floor(Math.random() * answers.length)]} 🎱
|
||||
|
||||
@@ -18,8 +18,7 @@ module.exports = class ChooseCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { choices } = args;
|
||||
run(msg, { choices }) {
|
||||
return msg.say(`I choose ${choices[Math.floor(Math.random() * choices.length)]}!`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -20,8 +20,7 @@ module.exports = class ChuckNorrisCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { name } = args;
|
||||
async run(msg, { name }) {
|
||||
try {
|
||||
const { body } = await snekfetch
|
||||
.get('http://api.icndb.com/jokes/random')
|
||||
|
||||
@@ -19,8 +19,8 @@ module.exports = class ComplimentCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const user = args.user || msg.author;
|
||||
run(msg, { user }) {
|
||||
if (!user) user = msg.author;
|
||||
return msg.say(`${user.username}, ${compliments[Math.floor(Math.random() * compliments.length)]}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -22,8 +22,7 @@ module.exports = class HistoryCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { date } = args;
|
||||
async run(msg, { date }) {
|
||||
try {
|
||||
const { text } = await snekfetch
|
||||
.get(`http://history.muffinlabs.com/date${date ? `/${date}` : ''}`);
|
||||
|
||||
@@ -19,8 +19,7 @@ module.exports = class MagicConchCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { question } = args;
|
||||
run(msg, { question }) {
|
||||
return msg.say(stripIndents`
|
||||
Question: ${question}
|
||||
🐚 ${answers[Math.floor(Math.random() * answers.length)]} 🐚
|
||||
|
||||
@@ -26,8 +26,7 @@ module.exports = class NameCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { gender } = args;
|
||||
async run(msg, { gender }) {
|
||||
try {
|
||||
const { body } = await snekfetch
|
||||
.get('http://namey.muffinlabs.com/name.json')
|
||||
|
||||
@@ -18,8 +18,7 @@ module.exports = class NumberFactCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { number } = args;
|
||||
async run(msg, { number }) {
|
||||
try {
|
||||
const { text } = await snekfetch
|
||||
.get(`http://numbersapi.com/${number}`);
|
||||
|
||||
@@ -18,8 +18,7 @@ module.exports = class RateWaifuCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { waifu } = args;
|
||||
run(msg, { waifu }) {
|
||||
return msg.say(`I'd give ${waifu} a ${Math.floor(Math.random() * 10) + 1}/10!`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -19,8 +19,8 @@ module.exports = class RoastCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const user = args.user || msg.author;
|
||||
run(msg, { user }) {
|
||||
if (!user) user = msg.author;
|
||||
return msg.say(`${user.username}, ${roasts[Math.floor(Math.random() * roasts.length)]}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -20,8 +20,7 @@ module.exports = class RollCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { value } = args;
|
||||
run(msg, { value }) {
|
||||
return msg.say(`You rolled a ${Math.floor(Math.random() * value) + 1}.`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -19,8 +19,7 @@ module.exports = class ShipCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { things } = args;
|
||||
run(msg, { things }) {
|
||||
return msg.say(`I'd give ${list(things)} a ${Math.floor(Math.random() * 100) + 1}%!`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -41,8 +41,7 @@ module.exports = class HoroscopeCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { sign } = args;
|
||||
async run(msg, { sign }) {
|
||||
try {
|
||||
const { text } = await snekfetch
|
||||
.get(`http://sandipbgt.com/theastrologer/api/horoscope/${sign}/today/`);
|
||||
|
||||
@@ -18,8 +18,7 @@ module.exports = class LMGTFYCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { query } = args;
|
||||
run(msg, { query }) {
|
||||
return msg.say(`http://lmgtfy.com/?iie=1&q=${query}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -33,8 +33,8 @@ module.exports = class SoundboardCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const sound = args.sound || sounds[Math.floor(Math.random() * sounds.length)];
|
||||
async run(msg, { sound }) {
|
||||
if (!sound) sound = sounds[Math.floor(Math.random() * sounds.length)];
|
||||
const channel = msg.member.voiceChannel;
|
||||
if (!channel) return msg.say('Please enter a voice channel first.');
|
||||
if (!channel.permissionsFor(this.client.user).has(['CONNECT', 'SPEAK'])) {
|
||||
|
||||
@@ -20,8 +20,7 @@ module.exports = class SpoopyLinkCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { site } = args;
|
||||
async run(msg, { site }) {
|
||||
if (/discord(\.gg|app\.com%2Finvite|\.me)%2F/gi.test(site)) return msg.say('Discord invites are safe!');
|
||||
try {
|
||||
const { body } = await snekfetch
|
||||
|
||||
@@ -34,8 +34,7 @@ module.exports = class StrawpollCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { title, options } = args;
|
||||
async run(msg, { title, options }) {
|
||||
if (options.length < 2) return msg.say('Please provide more than one choice.');
|
||||
if (options.length > 31) return msg.say('Please provide thirty or less choices.');
|
||||
try {
|
||||
|
||||
@@ -25,8 +25,7 @@ module.exports = class TagCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { tag } = args;
|
||||
run(msg, { tag }) {
|
||||
return msg.say(tags[tag]);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -23,8 +23,7 @@ module.exports = class XKCDCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { type } = args;
|
||||
async run(msg, { type }) {
|
||||
try {
|
||||
const current = await snekfetch
|
||||
.get('https://xkcd.com/info.0.json');
|
||||
|
||||
@@ -26,8 +26,7 @@ module.exports = class BreakUpCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { user } = args;
|
||||
run(msg, { user }) {
|
||||
return msg.say(stripIndents`
|
||||
**${msg.author.username}** *breaks up with* **${user.username}**
|
||||
${gifs[Math.floor(Math.random() * gifs.length)]}
|
||||
|
||||
@@ -25,8 +25,7 @@ module.exports = class CuddleCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { user } = args;
|
||||
run(msg, { user }) {
|
||||
return msg.say(stripIndents`
|
||||
**${msg.author.username}** *cuddles* **${user.username}**
|
||||
${gifs[Math.floor(Math.random() * gifs.length)]}
|
||||
|
||||
@@ -25,8 +25,7 @@ module.exports = class EatCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { user } = args;
|
||||
run(msg, { user }) {
|
||||
return msg.say(stripIndents`
|
||||
**${msg.author.username}** *eats* **${user.username}**
|
||||
${gifs[Math.floor(Math.random() * gifs.length)]}
|
||||
|
||||
@@ -25,8 +25,7 @@ module.exports = class EvolveCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { user } = args;
|
||||
run(msg, { user }) {
|
||||
return msg.say(stripIndents`
|
||||
**${user.username}** *is evolving!*
|
||||
${gifs[Math.floor(Math.random() * gifs.length)]}
|
||||
|
||||
@@ -25,8 +25,7 @@ module.exports = class FalconPunchCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { user } = args;
|
||||
run(msg, { user }) {
|
||||
return msg.say(stripIndents`
|
||||
**${msg.author.username}** *falcon punches* **${user.username}**
|
||||
${gifs[Math.floor(Math.random() * gifs.length)]}
|
||||
|
||||
@@ -25,8 +25,7 @@ module.exports = class FistBumpCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { user } = args;
|
||||
run(msg, { user }) {
|
||||
return msg.say(stripIndents`
|
||||
**${msg.author.username}** *fist-bumps* **${user.username}**
|
||||
${gifs[Math.floor(Math.random() * gifs.length)]}
|
||||
|
||||
@@ -25,8 +25,7 @@ module.exports = class HighFivesCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { user } = args;
|
||||
run(msg, { user }) {
|
||||
return msg.say(stripIndents`
|
||||
**${msg.author.username}** *high-fives* **${user.username}**
|
||||
${gifs[Math.floor(Math.random() * gifs.length)]}
|
||||
|
||||
@@ -18,8 +18,7 @@ module.exports = class HitwithShovelCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { user } = args;
|
||||
run(msg, { user }) {
|
||||
return msg.say(stripIndents`
|
||||
**${msg.author.username}** *hits* **${user.username}** *with a shovel*
|
||||
https://i.imgur.com/4yvqw81.gif
|
||||
|
||||
@@ -25,8 +25,7 @@ module.exports = class HugCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { user } = args;
|
||||
run(msg, { user }) {
|
||||
return msg.say(stripIndents`
|
||||
**${msg.author.username}** *hugs* **${user.username}**
|
||||
${gifs[Math.floor(Math.random() * gifs.length)]}
|
||||
|
||||
@@ -25,8 +25,7 @@ module.exports = class InhaleCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { user } = args;
|
||||
run(msg, { user }) {
|
||||
return msg.say(stripIndents`
|
||||
**${msg.author.username}** *inhales* **${user.username}** *but gained no ability...*
|
||||
${gifs[Math.floor(Math.random() * gifs.length)]}
|
||||
|
||||
@@ -18,8 +18,7 @@ module.exports = class KillCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { user } = args;
|
||||
run(msg, { user }) {
|
||||
return msg.say(stripIndents`
|
||||
**${msg.author.username}** *kills* **${user.username}**
|
||||
https://i.imgur.com/WxD4XMe.gif
|
||||
|
||||
@@ -25,8 +25,7 @@ module.exports = class KissCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { user } = args;
|
||||
run(msg, { user }) {
|
||||
return msg.say(stripIndents`
|
||||
**${msg.author.username}** *kisses* **${user.username}**
|
||||
${gifs[Math.floor(Math.random() * gifs.length)]}
|
||||
|
||||
@@ -24,8 +24,7 @@ module.exports = class MarryCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { user } = args;
|
||||
run(msg, { user }) {
|
||||
return msg.say(stripIndents`
|
||||
**${msg.author.username}** *marries* **${user.username}**
|
||||
${gifs[Math.floor(Math.random() * gifs.length)]}
|
||||
|
||||
@@ -25,8 +25,7 @@ module.exports = class PatCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { user } = args;
|
||||
run(msg, { user }) {
|
||||
return msg.say(stripIndents`
|
||||
**${msg.author.username}** *pats* **${user.username}**
|
||||
${gifs[Math.floor(Math.random() * gifs.length)]}
|
||||
|
||||
@@ -25,8 +25,7 @@ module.exports = class PokeCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { user } = args;
|
||||
run(msg, { user }) {
|
||||
return msg.say(stripIndents`
|
||||
**${msg.author.username}** *pokes* **${user.username}**
|
||||
${gifs[Math.floor(Math.random() * gifs.length)]}
|
||||
|
||||
@@ -25,8 +25,7 @@ module.exports = class PunchCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { user } = args;
|
||||
run(msg, { user }) {
|
||||
return msg.say(stripIndents`
|
||||
**${msg.author.username}** *punches* **${user.username}**
|
||||
${gifs[Math.floor(Math.random() * gifs.length)]}
|
||||
|
||||
@@ -25,8 +25,7 @@ module.exports = class SlapCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { user } = args;
|
||||
run(msg, { user }) {
|
||||
return msg.say(stripIndents`
|
||||
**${msg.author.username}** *slaps* **${user.username}**
|
||||
${gifs[Math.floor(Math.random() * gifs.length)]}
|
||||
|
||||
@@ -22,8 +22,7 @@ module.exports = class AnimeCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { query } = args;
|
||||
async run(msg, { query }) {
|
||||
try {
|
||||
const { text } = await snekfetch
|
||||
.get('https://kitsu.io/api/edge/anime')
|
||||
|
||||
@@ -21,8 +21,7 @@ module.exports = class BotSearchCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { bot } = args;
|
||||
async run(msg, { bot }) {
|
||||
try {
|
||||
const { body } = await snekfetch
|
||||
.get(`https://bots.discord.pw/api/bots/${bot.id}`)
|
||||
|
||||
@@ -22,8 +22,7 @@ module.exports = class BulbapediaCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { query } = args;
|
||||
async run(msg, { query }) {
|
||||
try {
|
||||
const { body } = await snekfetch
|
||||
.get('https://bulbapedia.bulbagarden.net/w/api.php')
|
||||
|
||||
@@ -22,8 +22,7 @@ module.exports = class DefineCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { query } = args;
|
||||
async run(msg, { query }) {
|
||||
try {
|
||||
const { body } = await snekfetch
|
||||
.get(`http://api.wordnik.com:80/v4/word.json/${query}/definitions`)
|
||||
|
||||
@@ -25,8 +25,8 @@ module.exports = class DiscrimCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const discrim = args.discrim || msg.author.discriminator;
|
||||
run(msg, { discrim }) {
|
||||
if (!discrim) discrim = msg.author.discriminator;
|
||||
const users = this.client.users.filter(user => user.discriminator === discrim).map(user => user.username);
|
||||
return msg.say(stripIndents`
|
||||
**Found ${users.length} users with the discriminator #${discrim}**
|
||||
|
||||
@@ -19,8 +19,7 @@ module.exports = class GiphyCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { query } = args;
|
||||
async run(msg, { query }) {
|
||||
try {
|
||||
const { body } = await snekfetch
|
||||
.get('http://api.giphy.com/v1/gifs/search')
|
||||
|
||||
@@ -28,8 +28,7 @@ module.exports = class GitHubCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { author, repository } = args;
|
||||
async run(msg, { author, repository }) {
|
||||
try {
|
||||
const { body } = await snekfetch
|
||||
.get(`https://${GITHUB_LOGIN}@api.github.com/repos/${author}/${repository}`);
|
||||
|
||||
@@ -33,8 +33,7 @@ module.exports = class iTunesCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { country, query } = args;
|
||||
async run(msg, { country, query }) {
|
||||
try {
|
||||
const { text } = await snekfetch
|
||||
.get('https://itunes.apple.com/search')
|
||||
|
||||
@@ -22,8 +22,7 @@ module.exports = class MangaCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { query } = args;
|
||||
async run(msg, { query }) {
|
||||
try {
|
||||
const { text } = await snekfetch
|
||||
.get('https://kitsu.io/api/edge/manga')
|
||||
|
||||
@@ -30,8 +30,7 @@ module.exports = class MapCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { zoom, query } = args;
|
||||
async run(msg, { zoom, query }) {
|
||||
try {
|
||||
const { body } = await snekfetch
|
||||
.get('https://maps.googleapis.com/maps/api/staticmap')
|
||||
|
||||
@@ -21,8 +21,7 @@ module.exports = class MDNCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { query } = args;
|
||||
async run(msg, { query }) {
|
||||
try {
|
||||
const { body } = await snekfetch
|
||||
.get('https://developer.mozilla.org/en-US/search.json')
|
||||
|
||||
@@ -23,8 +23,7 @@ module.exports = class MovieCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { query } = args;
|
||||
async run(msg, { query }) {
|
||||
try {
|
||||
const search = await snekfetch
|
||||
.get('http://api.themoviedb.org/3/search/movie')
|
||||
|
||||
@@ -21,8 +21,7 @@ module.exports = class NASACommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { query } = args;
|
||||
async run(msg, { query }) {
|
||||
try {
|
||||
const { body } = await snekfetch
|
||||
.get('https://images-api.nasa.gov/search')
|
||||
|
||||
@@ -18,8 +18,7 @@ module.exports = class NeopetCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { query } = args;
|
||||
async run(msg, { query }) {
|
||||
try {
|
||||
const { text } = await snekfetch
|
||||
.get('http://www.sunnyneo.com/petimagefinder.php')
|
||||
|
||||
@@ -22,8 +22,7 @@ module.exports = class NPMCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { query } = args;
|
||||
async run(msg, { query }) {
|
||||
try {
|
||||
const { body } = await snekfetch
|
||||
.get(`https://registry.npmjs.com/${query}`);
|
||||
|
||||
@@ -22,8 +22,7 @@ module.exports = class OsuCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { query } = args;
|
||||
async run(msg, { query }) {
|
||||
try {
|
||||
const { body } = await snekfetch
|
||||
.get('https://osu.ppy.sh/api/get_user')
|
||||
|
||||
@@ -24,8 +24,7 @@ module.exports = class PokedexCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { pokemon } = args;
|
||||
async run(msg, { pokemon }) {
|
||||
try {
|
||||
const { body } = await snekfetch
|
||||
.get(`https://pokeapi.co/api/v2/pokemon-species/${pokemon}/`);
|
||||
|
||||
@@ -20,9 +20,8 @@ module.exports = class RecipeCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
async run(msg, { query }) {
|
||||
try {
|
||||
const { query } = args;
|
||||
const { text } = await snekfetch
|
||||
.get('http://www.recipepuppy.com/api/')
|
||||
.query({ q: query });
|
||||
|
||||
@@ -21,9 +21,8 @@ module.exports = class RedditCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
async run(msg, { subreddit }) {
|
||||
try {
|
||||
const { subreddit } = args;
|
||||
const { body } = await snekfetch
|
||||
.get(`https://www.reddit.com/r/${subreddit}/new.json`)
|
||||
.query({ sort: 'new' });
|
||||
|
||||
@@ -20,8 +20,7 @@ module.exports = class SteamCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { query } = args;
|
||||
async run(msg, { query }) {
|
||||
try {
|
||||
const { body } = await snekfetch
|
||||
.get('https://store.steampowered.com/api/storesearch')
|
||||
|
||||
@@ -21,8 +21,7 @@ module.exports = class StocksCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { symbol } = args;
|
||||
async run(msg, { symbol }) {
|
||||
try {
|
||||
const { body } = await snekfetch
|
||||
.get('https://www.alphavantage.co/query')
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user