mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-06 06:10:49 +02:00
Destructuring Args
This commit is contained in:
@@ -25,7 +25,7 @@ module.exports = class YearsCommand extends Command {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('ATTACH_FILES')) return message.say(':x: Error! I don\'t have the Attach Files Permission!');
|
||||
}
|
||||
const user = args.user;
|
||||
const { user } = args;
|
||||
let userAvatar = user.displayAvatarURL;
|
||||
userAvatar = userAvatar.replace('.jpg', '.png');
|
||||
userAvatar = userAvatar.replace('.gif', '.png');
|
||||
|
||||
@@ -25,7 +25,7 @@ module.exports = class BeautifulCommand extends Command {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('ATTACH_FILES')) return message.say(':x: Error! I don\'t have the Attach Files Permission!');
|
||||
}
|
||||
const user = args.user;
|
||||
const { user } = args;
|
||||
let userAvatar = user.displayAvatarURL;
|
||||
userAvatar = userAvatar.replace('.jpg', '.png');
|
||||
userAvatar = userAvatar.replace('.gif', '.png');
|
||||
|
||||
@@ -26,7 +26,7 @@ module.exports = class BobRossCommand extends Command {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('ATTACH_FILES')) return message.say(':x: Error! I don\'t have the Attach Files Permission!');
|
||||
}
|
||||
const user = args.user;
|
||||
const { user } = args;
|
||||
let userAvatar = user.displayAvatarURL;
|
||||
userAvatar = userAvatar.replace('.jpg', '.png');
|
||||
userAvatar = userAvatar.replace('.gif', '.png');
|
||||
|
||||
@@ -26,7 +26,7 @@ module.exports = class RIPCommand extends Command {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('ATTACH_FILES')) return message.say(':x: Error! I don\'t have the Attach Files Permission!');
|
||||
}
|
||||
const user = args.user;
|
||||
const { user } = args;
|
||||
let userAvatar = user.displayAvatarURL;
|
||||
userAvatar = userAvatar.replace('.jpg', '.png');
|
||||
userAvatar = userAvatar.replace('.gif', '.png');
|
||||
|
||||
@@ -25,7 +25,7 @@ module.exports = class SteamCardCommand extends Command {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('ATTACH_FILES')) return message.say(':x: Error! I don\'t have the Attach Files Permission!');
|
||||
}
|
||||
const user = args.user;
|
||||
const { user } = args;
|
||||
const userDisplayName = user.username;
|
||||
let userAvatar = user.displayAvatarURL;
|
||||
userAvatar = userAvatar.replace('.jpg', '.png');
|
||||
|
||||
@@ -19,6 +19,9 @@ module.exports = class MathGameCommand extends Command {
|
||||
return true;
|
||||
}
|
||||
return 'Please set the difficulty to either `easy`, `medium`, `hard`, or `extreme`.';
|
||||
},
|
||||
parse: text => {
|
||||
return text.toLowerCase();
|
||||
}
|
||||
}]
|
||||
});
|
||||
@@ -29,11 +32,11 @@ module.exports = class MathGameCommand extends Command {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say(':x: Error! I don\'t have the Embed Links Permission!');
|
||||
}
|
||||
const level = args.difficulty.toLowerCase();
|
||||
const { difficulty } = args;
|
||||
let operation = ['+', '-', '*'];
|
||||
operation = operation[Math.floor(Math.random() * operation.length)];
|
||||
let value;
|
||||
switch (level) {
|
||||
switch (difficulty) {
|
||||
case 'easy':
|
||||
value = 10;
|
||||
break;
|
||||
|
||||
@@ -20,6 +20,9 @@ module.exports = class RockPaperScissorsCommand extends Command {
|
||||
return true;
|
||||
}
|
||||
return 'Please enter either `rock`, `paper`, or `scissors`.';
|
||||
},
|
||||
parse: text => {
|
||||
return text.toLowerCase();
|
||||
}
|
||||
}]
|
||||
});
|
||||
@@ -29,18 +32,18 @@ module.exports = class RockPaperScissorsCommand extends Command {
|
||||
if (message.channel.type !== 'dm') {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
}
|
||||
const rps = args.choice.toLowerCase();
|
||||
const { choice } = args;
|
||||
let response = ['Paper', 'Rock', 'Scissors'];
|
||||
response = response[Math.floor(Math.random() * response.length)];
|
||||
if (rps === 'rock') {
|
||||
if (choice === 'rock') {
|
||||
if (response === 'Rock') return message.say('Rock! Aw, it\'s a tie!');
|
||||
if (response === 'Paper') return message.say('Paper! Yes! I win!');
|
||||
if (response === 'Scissors') return message.say('Scissors! Aw... I lose...');
|
||||
} else if (rps === 'paper') {
|
||||
} else if (choice === 'paper') {
|
||||
if (response === 'Rock') return message.say('Rock! Aw... I lose...');
|
||||
if (response === 'Paper') return message.say('Paper! Aw, it\'s a tie!');
|
||||
if (response === 'Scissors') return message.say('Scissors! Yes! I win!');
|
||||
} else if (rps === 'scissors') {
|
||||
} else if (choice === 'scissors') {
|
||||
if (response === 'Rock') return message.say('Rock! Yes! I win!');
|
||||
if (response === 'Paper') return message.say('Paper! Aw... I lose...');
|
||||
if (response === 'Scissors') return message.say('Scissors! Aw, it\'s a tie!');
|
||||
|
||||
@@ -18,6 +18,9 @@ module.exports = class TypingGameCommand extends Command {
|
||||
return true;
|
||||
}
|
||||
return 'Please set the difficulty to either `easy`, `medium`, `hard`, or `extreme`.';
|
||||
},
|
||||
parse: text => {
|
||||
return text.toLowerCase();
|
||||
}
|
||||
}]
|
||||
});
|
||||
@@ -28,12 +31,12 @@ module.exports = class TypingGameCommand extends Command {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say(':x: Error! I don\'t have the Embed Links Permission!');
|
||||
}
|
||||
const level = args.difficulty.toLowerCase();
|
||||
const { difficulty } = args;
|
||||
let sentence = ['The quick brown fox jumps over the lazy dog.', 'Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo.', 'How razorback-jumping frogs can level six piqued gymnasts!', 'Amazingly few discotheques provide jukeboxes.'];
|
||||
sentence = sentence[Math.floor(Math.random() * sentence.length)];
|
||||
let time;
|
||||
let levelWord;
|
||||
switch (level) {
|
||||
switch (difficulty) {
|
||||
case 'easy':
|
||||
time = 25000;
|
||||
levelWord = 'twenty-five';
|
||||
|
||||
@@ -22,6 +22,9 @@ module.exports = class MemeCommand extends Command {
|
||||
return true;
|
||||
}
|
||||
return 'Please enter a valid meme type. Use `;help meme` to view a list of types.';
|
||||
},
|
||||
parse: text => {
|
||||
return text.toLowerCase();
|
||||
}
|
||||
}, {
|
||||
key: 'toprow',
|
||||
@@ -32,6 +35,9 @@ module.exports = class MemeCommand extends Command {
|
||||
return true;
|
||||
}
|
||||
return 'Please do not use special characters and keep the rows under 100 characters each.';
|
||||
},
|
||||
parse: text => {
|
||||
return text.replace(/[ ]/g, '-').replace(/[?]/g, '~q');
|
||||
}
|
||||
}, {
|
||||
key: 'bottomrow',
|
||||
@@ -42,6 +48,9 @@ module.exports = class MemeCommand extends Command {
|
||||
return true;
|
||||
}
|
||||
return 'Please do not use special characters and keep the rows under 100 characters each.';
|
||||
},
|
||||
parse: text => {
|
||||
return text.replace(/[ ]/g, '-').replace(/[?]/g, '~q');
|
||||
}
|
||||
}]
|
||||
});
|
||||
@@ -52,11 +61,7 @@ module.exports = class MemeCommand extends Command {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('ATTACH_FILES')) return message.say(':x: Error! I don\'t have the Attach Files Permission!');
|
||||
}
|
||||
const type = args.type.toLowerCase();
|
||||
let toprow = args.toprow.replace(/[ ]/g, '-');
|
||||
toprow = toprow.replace(/[?]/g, '~q');
|
||||
let bottomrow = args.bottomrow.replace(/[ ]/g, '-');
|
||||
bottomrow = bottomrow.replace(/[?]/g, '~q');
|
||||
const { type, toprow, bottomrow } = args;
|
||||
const link = `https://memegen.link/${type}/${toprow}/${bottomrow}.jpg`;
|
||||
return message.channel.send({file: link}).catch(() => message.say(':x: Error! Something went wrong!'));
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ module.exports = class BanCommand extends Command {
|
||||
args: [{
|
||||
key: 'member',
|
||||
prompt: 'What member do you want to ban?',
|
||||
type: 'user'
|
||||
type: 'member'
|
||||
}, {
|
||||
key: 'reason',
|
||||
prompt: 'What do you want to set the reason as?',
|
||||
@@ -42,9 +42,7 @@ module.exports = class BanCommand extends Command {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('BAN_MEMBERS')) return message.say(':x: Error! I don\'t have the Ban Members Permission!');
|
||||
}
|
||||
if (!message.guild.channels.exists('name', 'mod_logs')) return message.say(':x: Error! Could not find the mod_logs channel! Please create it!');
|
||||
let member = message.guild.member(args.member);
|
||||
if (!member) member = await message.guild.fetchMember(args.member);
|
||||
const reason = args.reason;
|
||||
const { member, reason } = args;
|
||||
if (!member.bannable) return message.say(':x: Error! This member cannot be banned! Perhaps they have a higher role than me?');
|
||||
try {
|
||||
await member.ban(7);
|
||||
|
||||
@@ -13,7 +13,7 @@ module.exports = class KickCommand extends Command {
|
||||
args: [{
|
||||
key: 'member',
|
||||
prompt: 'What member do you want to kick?',
|
||||
type: 'user'
|
||||
type: 'member'
|
||||
}, {
|
||||
key: 'reason',
|
||||
prompt: 'What do you want to set the reason as?',
|
||||
@@ -39,9 +39,7 @@ module.exports = class KickCommand extends Command {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('KICK_MEMBERS')) return message.say(':x: Error! I don\'t have the Kick Members Permission!');
|
||||
}
|
||||
if (!message.guild.channels.exists('name', 'mod_logs')) return message.say(':x: Error! Could not find the mod_logs channel! Please create it!');
|
||||
let member = message.guild.member(args.member);
|
||||
if (!member) member = await message.guild.fetchMember(args.member);
|
||||
const reason = args.reason;
|
||||
const { member, reason } = args;
|
||||
if (!member.bannable) return message.say(':x: Error! This member cannot be kicked! Perhaps they have a higher role than me?');
|
||||
try {
|
||||
await member.kick();
|
||||
|
||||
@@ -18,6 +18,9 @@ module.exports = class LockdownCommand extends Command {
|
||||
return true;
|
||||
}
|
||||
return 'Please enter either start or stop.';
|
||||
},
|
||||
parse: text => {
|
||||
return text.toLowerCase();
|
||||
}
|
||||
}]
|
||||
});
|
||||
@@ -32,7 +35,7 @@ module.exports = class LockdownCommand extends Command {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['READ_MESSAGES', 'SEND_MESSAGES'])) return;
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('ADMINISTRATOR')) return message.say(':x: Error! I don\'t have the Administrator permission! This is not given by default, as that\'s quite bad practice. Please give it to me to use the lockdown command!');
|
||||
}
|
||||
const type = args.type.toLowerCase();
|
||||
const { type } = args;
|
||||
if (type === 'start') {
|
||||
try {
|
||||
await message.channel.overwritePermissions(message.guild.defaultRole, {
|
||||
|
||||
@@ -30,6 +30,9 @@ module.exports = class PruneCommand extends Command {
|
||||
return true;
|
||||
}
|
||||
return 'Too many or two few messages to delete. Limit 1-99.';
|
||||
},
|
||||
parse: count => {
|
||||
return count + 1;
|
||||
}
|
||||
}]
|
||||
});
|
||||
@@ -45,7 +48,7 @@ module.exports = class PruneCommand extends Command {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('READ_MESSAGE_HISTORY')) return message.say(':x: Error! I don\'t have the Read Message History Permission!');
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('MANAGE_MESSAGES')) return message.say(':x: Error! I don\'t have the Manage Messages Permission!');
|
||||
}
|
||||
const count = args.count + 1;
|
||||
const { count } = args;
|
||||
try {
|
||||
const messages = await message.channel.fetchMessages({
|
||||
limit: count
|
||||
|
||||
@@ -48,8 +48,7 @@ module.exports = class UnbanCommand extends Command {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('BAN_MEMBERS')) return message.say(':x: Error! I don\'t have the Ban Members Permission!');
|
||||
}
|
||||
if (!message.guild.channels.exists('name', 'mod_logs')) return message.say(':x: Error! Could not find the mod_logs channel! Please create it!');
|
||||
const memberID = args.memberID;
|
||||
const reason = args.reason;
|
||||
const { memberID, reason } = args;
|
||||
const bans = await message.guild.fetchBans();
|
||||
if (!bans.has(memberID)) return message.say(':x: Error! Could not find this user in the bans.');
|
||||
const unbanUser = await bans.get(memberID);
|
||||
|
||||
@@ -13,7 +13,7 @@ module.exports = class WarnCommand extends Command {
|
||||
args: [{
|
||||
key: 'member',
|
||||
prompt: 'What member do you want to warn?',
|
||||
type: 'user'
|
||||
type: 'member'
|
||||
}, {
|
||||
key: 'reason',
|
||||
prompt: 'What do you want to set the reason as?',
|
||||
@@ -37,9 +37,7 @@ module.exports = class WarnCommand extends Command {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say(':x: Error! I don\'t have the Embed Links Permission!');
|
||||
}
|
||||
let member = message.guild.member(args.member);
|
||||
if (!member) member = await message.guild.fetchMember(args.member);
|
||||
const reason = args.reason;
|
||||
const { member, reason } = args;
|
||||
if (!message.guild.channels.exists('name', 'mod_logs')) return message.say(':x: Error! Could not find the mod_logs channel! Please create it!');
|
||||
try {
|
||||
await message.say(':ok_hand:');
|
||||
|
||||
@@ -27,7 +27,7 @@ module.exports = class MathCommand extends Command {
|
||||
if (message.channel.type !== 'dm') {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
}
|
||||
const expression = args.expression;
|
||||
const { expression } = args;
|
||||
try {
|
||||
const solved = math.eval(expression);
|
||||
return message.say(solved).catch(() => message.say(':x: Error! Invalid statement!'));
|
||||
|
||||
@@ -15,8 +15,7 @@ module.exports = class MotivateCommand extends Command {
|
||||
args: [{
|
||||
key: 'thing',
|
||||
prompt: 'What do you want to motivate?',
|
||||
type: 'string',
|
||||
default: ''
|
||||
type: 'string'
|
||||
}]
|
||||
});
|
||||
}
|
||||
@@ -25,7 +24,7 @@ module.exports = class MotivateCommand extends Command {
|
||||
if (message.channel.type !== 'dm') {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
}
|
||||
const motivated = args.thing || message.author;
|
||||
return message.say(`${motivated}, https://www.youtube.com/watch?v=ZXsQAXx_ao0`);
|
||||
const { thing } = args;
|
||||
return message.say(`${thing}, https://www.youtube.com/watch?v=ZXsQAXx_ao0`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -36,8 +36,7 @@ module.exports = class StrawpollCommand extends Command {
|
||||
if (message.channel.type !== 'dm') {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
}
|
||||
const title = args.title;
|
||||
const choices = args.choices;
|
||||
const { title, choices } = args;
|
||||
if (choices.length < 2) return message.say(':x: Error! You provided less than two choices!');
|
||||
if (choices.length > 31) return message.say(':x: Error! You provided more than thirty choices!');
|
||||
try {
|
||||
|
||||
@@ -20,7 +20,7 @@ module.exports = class MagicBallCommand extends Command {
|
||||
if (message.channel.type !== 'dm') {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
}
|
||||
const question = args.question;
|
||||
const { question } = args;
|
||||
let answer = ['It is certain', 'It is decidedly so', 'Without a doubt', 'Yes definitely', 'You may rely on it', 'As I see it, yes', 'Most likely', 'Outlook good', 'Yes', 'Signs point to yes', 'Reply hazy try again', 'Ask again later', 'Better not tell you now', 'Cannot predict now', 'Concentrate and ask again', 'Don\'t count on it', 'My reply is no', 'My sources say no', 'Outlook not so good', 'Very doubtful'];
|
||||
answer = answer[Math.floor(Math.random() * answer.length)];
|
||||
return message.say(`Question: ${question}\n:8ball: ${answer} :8ball:`);
|
||||
|
||||
@@ -24,8 +24,8 @@ module.exports = class ChooseCommand extends Command {
|
||||
if (message.channel.type !== 'dm') {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
}
|
||||
let choice = args.choices;
|
||||
choice = choice[Math.floor(Math.random() * choice.length)];
|
||||
return message.say(`I choose ${choice}!`);
|
||||
let { choices } = args;
|
||||
choices = choices[Math.floor(Math.random() * choices.length)];
|
||||
return message.say(`I choose ${choices}!`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -11,8 +11,7 @@ module.exports = class ComplimentCommand extends Command {
|
||||
args: [{
|
||||
key: 'thing',
|
||||
prompt: 'What do you want to compliment?',
|
||||
type: 'string',
|
||||
default: ''
|
||||
type: 'string'
|
||||
}]
|
||||
});
|
||||
}
|
||||
@@ -21,9 +20,9 @@ module.exports = class ComplimentCommand extends Command {
|
||||
if (message.channel.type !== 'dm') {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
}
|
||||
const complimented = args.thing || message.author;
|
||||
const { thing } = args;
|
||||
let compliment = ['Your smile is contagious.', 'You look great today.', 'You\'re a smart cookie.', 'I bet you make babies smile.', 'You have impeccable manners.', 'I like your style.', 'You have the best laugh.', 'I appreciate you.', 'You are the most perfect you there is.', 'You are enough.', 'You\'re strong.', 'Your perspective is refreshing.', 'You\'re an awesome friend.', 'You light up the room.', 'You shine brighter than a shooting star.', 'You deserve a hug right now.', 'You should be proud of yourself.', 'You\'re more helpful than you realize.', 'You have a great sense of humor.', 'You\'ve got all the right moves!', 'Is that your picture next to \'charming\' in the dictionary?', 'Your kindness is a balm to all who encounter it.', 'You\'re all that and a super-size bag of chips.', 'On a scale from 1 to 10, you\'re an 11.', 'You are brave.', 'You\'re even more beautiful on the inside than you are on the outside.', 'You have the courage of your convictions.', 'Your eyes are breathtaking.', 'If cartoon bluebirds were real, a bunch of them would be sitting on your shoulders singing right now.', 'You are making a difference.', 'You\'re like sunshine on a rainy day.', 'You bring out the best in other people.', 'Your ability to recall random factoids at just the right time is impressive.', 'You\'re a great listener.', 'How is it that you always look great, even in sweatpants?', 'Everything would be better if more people were like you!', 'I bet you sweat glitter.', 'You were cool way before hipsters were cool.', 'That color is perfect on you.', 'Hanging out with you is always a blast.', 'You always know -- and say -- exactly what I need to hear when I need to hear it.', 'You smell really good.', 'You may dance like no one\'s watching, but everyone\'s watching because you\'re an amazing dancer!', 'Being around you makes everything better!', 'When you say, \'I meant to do that,\' I totally believe you.', 'When you\'re not afraid to be yourself is when you\'re most incredible.', 'Colors seem brighter when you\'re around.', 'You\'re more fun than a ball pit filled with candy. (And seriously, what could be more fun than that?)', 'That thing you don\'t like about yourself is what makes you so interesting.', 'You\'re wonderful.', 'You have cute elbows. For reals!', 'Jokes are funnier when you tell them.', 'You\'re better than a triple-scoop ice cream cone. With sprinkles.', 'Your bellybutton is kind of adorable.', 'Your hair looks stunning.', 'You\'re one of a kind!', 'You\'re inspiring.', 'If you were a box of crayons, you\'d be the giant name-brand one with the built-in sharpener.', 'You should be thanked more often. So thank you!!', 'Our community is better because you\'re in it.', 'Someone is getting through something hard right now because you\'ve got their back.', 'You have the best ideas.', 'You always know how to find that silver lining.', 'Everyone gets knocked down sometimes, but you always get back up and keep going.', 'You\'re a candle in the darkness.', 'You\'re a great example to others.', 'Being around you is like being on a happy little vacation.', 'You always know just what to say.', 'You\'re always learning new things and trying to better yourself, which is awesome.', 'If someone based an Internet meme on you, it would have impeccable grammar.', 'You could survive a Zombie apocalypse.', 'You\'re more fun than bubble wrap.', 'When you make a mistake, you fix it.', 'Who raised you? They deserve a medal for a job well done.', 'You\'re great at figuring stuff out.', 'Your voice is magnificent.', 'The people you love are lucky to have you in their lives.', 'You\'re like a breath of fresh air.', 'You\'re gorgeous -- and that\'s the least interesting thing about you, too.', 'You\'re so thoughtful.', 'Your creative potential seems limitless.', 'Your name suits you to a T.', 'You\'re irresistible when you blush.', 'Actions speak louder than words, and yours tell an incredible story.', 'Somehow you make time stop and fly at the same time.', 'When you make up your mind about something, nothing stands in your way.', 'You seem to really know who you are.', 'Any team would be lucky to have you on it.', 'In high school I bet you were voted \'most likely to keep being awesome.\'', 'I bet you do the crossword puzzle in ink.', 'Babies and small animals probably love you.', 'If you were a scented candle they\'d call it Perfectly Imperfect (and it would smell like summer).', 'There\'s ordinary, and then there\'s you.', 'You\'re someone\'s reason to smile.', 'You\'re even better than a unicorn, because you\'re real.', 'How do you keep being so funny and making everyone laugh?', 'You have a good head on your shoulders.', 'Has anyone ever told you that you have great posture?', 'The way you treasure your loved ones is incredible.', 'You\'re really something special.', 'You\'re a gift to those around you.', 'You don\'t deserve it.'];
|
||||
compliment = compliment[Math.floor(Math.random() * compliment.length)];
|
||||
return message.say(`${complimented}, ${compliment}`);
|
||||
return message.say(`${thing}, ${compliment}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -21,6 +21,9 @@ module.exports = class RandomNameCommand extends Command {
|
||||
return true;
|
||||
}
|
||||
return 'Please enter either `male` or `female`.';
|
||||
},
|
||||
parse: text => {
|
||||
return text.toLowerCase();
|
||||
}
|
||||
}]
|
||||
});
|
||||
@@ -30,7 +33,7 @@ module.exports = class RandomNameCommand extends Command {
|
||||
if (message.channel.type !== 'dm') {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
}
|
||||
const gender = args.gender.toLowerCase();
|
||||
const { gender } = args;
|
||||
let lastName = ['Walker', 'Tworni', 'Ross', 'Smith', 'Odendahl', 'Deere', 'Brown', 'Williams', 'Jones', 'Miles', 'Moss', 'Roberto', 'McFly', 'McDonald', 'Lewis', 'Armstrong', 'Stevenson', 'Schwarzenegger', 'Robinson', 'Parker', 'Piper', 'Johnson', 'Brantley', 'Stewart', 'Ree', 'Talbot', 'Seville', 'Peace', 'Spielberg', 'Baggins', 'Wilborn', 'Vankirk', 'Shireman', 'Jimerson', 'Masters', 'Hack', 'Satcher', 'Younkin', 'Aguila', 'Duffey', 'Burgin', 'Highfall', 'Wee', 'Solari', 'Tomaselli', 'Basler', 'Difranco', 'Latch', 'Rives', 'Dolan', 'Abraham', 'Holter', 'Portugal', 'Lininger', 'Holst', 'Mccroy', 'Follmer', 'Hotchkiss', 'Gassaway', 'Wang', 'Agron', 'Raasch', 'Gourd', 'Czaja', 'Marquart', 'Papadopoulos', 'Ringer', 'Lax', 'Sperling', 'Galusha', 'Alston'];
|
||||
lastName = lastName[Math.floor(Math.random() * lastName.length)];
|
||||
if (gender === 'male') {
|
||||
|
||||
@@ -23,7 +23,7 @@ module.exports = class RateWaifuCommand extends Command {
|
||||
if (message.channel.type !== 'dm') {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
}
|
||||
const waifu = args.waifu;
|
||||
const { waifu } = args;
|
||||
const rating = Math.floor(Math.random() * 10) + 1;
|
||||
return message.say(`I'd give ${waifu} a ${rating}/10!`);
|
||||
}
|
||||
|
||||
@@ -14,8 +14,7 @@ module.exports = class RoastCommand extends Command {
|
||||
args: [{
|
||||
key: 'thing',
|
||||
prompt: 'What do you want to roast?',
|
||||
type: 'string',
|
||||
default: ''
|
||||
type: 'string'
|
||||
}]
|
||||
});
|
||||
}
|
||||
@@ -24,9 +23,9 @@ module.exports = class RoastCommand extends Command {
|
||||
if (message.channel.type !== 'dm') {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
}
|
||||
const roasted = args.thing || message.author;
|
||||
const { thing } = args;
|
||||
let roast = ['*puts you in the oven*', 'You\'re so stupid.', 'Sorry, I can\'t hear you over how annoying you are.', 'I\'ve got better things to do.', 'You\'re as dumb as Cleverbot.', 'Your IQ is lower than the Mariana Trench.', 'You\'re so annoying even the flies stay away from your stench.', 'Go away, please.', 'I\'d give you a nasty look but you\'ve already got one.', 'It looks like your face caught fire and someone tried to put it out with a hammer.', 'Your family tree must be a cactus because everyone on it is a prick.', 'Someday you will go far, and I hope you stay there.', 'The zoo called. They\'re wondering how you got out of your cage.', 'I was hoping for a battle of wits, but you appear to be unarmed.', 'You are proof that evolution can go in reverse.', 'Brains aren\'t everything, in your case, they\'re nothing.', 'Sorry I didn\'t get that, I don\'t speak idiot.', 'Why is it acceptable for you to be an idiot, but not for me to point it out?', 'We all sprang from apes, but you did not spring far enough.', 'You\'re an unknown command.', 'If you could go anywhere I chose, I\'d choose dead.', 'Even monkeys can go to space, so clearly you lack some potential.', 'It\'s brains over brawn, yet you have neither.', 'You look like a monkey, and you smell like one too.', 'Even among idiots you\'re lacking.', 'You fail even when you\'re doing absolutely nothing.', 'If there was a vote for \'least likely to succeed\' you\'d win first prize.', 'I\'m surrounded by idiots... Or, wait, that\'s just you.', 'I wanna go home. Well, really I just want to get away from the awful aroma you\'ve got going there.', 'Every time you touch me I have to go home and wash all my clothes nine times just to get a normal smell back.', 'If I had a dollar for every brain you don\'t have, I\'d have one dollar.', 'I\'d help you succeed but you\'re incapable.', 'Your hairline is built like a graph chart, positive and negative forces attract but the clippers and your hair repel', 'I know a good joke! You!'];
|
||||
roast = roast[Math.floor(Math.random() * roast.length)];
|
||||
return message.say(`${roasted}, ${roast}`);
|
||||
return message.say(`${thing}, ${roast}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -13,10 +13,9 @@ module.exports = class RollCommand extends Command {
|
||||
description: 'Rolls a Dice of your choice. (;roll 6)',
|
||||
examples: [';roll 6'],
|
||||
args: [{
|
||||
key: 'number',
|
||||
key: 'value',
|
||||
prompt: 'Which number do you want to roll?',
|
||||
type: 'integer',
|
||||
default: 6
|
||||
type: 'integer'
|
||||
}]
|
||||
});
|
||||
}
|
||||
@@ -25,7 +24,7 @@ module.exports = class RollCommand extends Command {
|
||||
if (message.channel.type !== 'dm') {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
}
|
||||
const value = args.number;
|
||||
const { value } = args;
|
||||
const roll = Math.floor(Math.random() * value) + 1;
|
||||
return message.say(`You rolled a ${roll}.`);
|
||||
}
|
||||
|
||||
@@ -23,8 +23,8 @@ module.exports = class ShipCommand extends Command {
|
||||
if (message.channel.type !== 'dm') {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
}
|
||||
const shipped = args.things;
|
||||
const { things } = args;
|
||||
const percentage = Math.floor(Math.random() * 100) + 1;
|
||||
return message.say(`I'd give ${shipped} a ${percentage}%!`);
|
||||
return message.say(`I'd give ${things} a ${percentage}%!`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -20,7 +20,7 @@ module.exports = class CuddleCommand extends Command {
|
||||
if (message.channel.type !== 'dm') {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
}
|
||||
const roleplayed = args.thing;
|
||||
return message.say(`${message.author} *cuddles* ${roleplayed}`);
|
||||
const { thing } = args;
|
||||
return message.say(`${message.author} *cuddles* ${thing}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -20,7 +20,7 @@ module.exports = class DivorceCommand extends Command {
|
||||
if (message.channel.type !== 'dm') {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
}
|
||||
const roleplayed = args.thing;
|
||||
return message.say(`${message.author} *divorces* ${roleplayed}`);
|
||||
const { thing } = args;
|
||||
return message.say(`${message.author} *divorces* ${thing}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -20,7 +20,7 @@ module.exports = class EatCommand extends Command {
|
||||
if (message.channel.type !== 'dm') {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
}
|
||||
const roleplayed = args.thing;
|
||||
return message.say(`${message.author} *eats* ${roleplayed}`);
|
||||
const { thing } = args;
|
||||
return message.say(`${message.author} *eats* ${thing}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -20,7 +20,7 @@ module.exports = class FalconPunchCommand extends Command {
|
||||
if (message.channel.type !== 'dm') {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
}
|
||||
const roleplayed = args.thing;
|
||||
return message.say(`${message.author} *falcon punches* ${roleplayed}`);
|
||||
const { thing } = args;
|
||||
return message.say(`${message.author} *falcon punches* ${thing}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -20,7 +20,7 @@ module.exports = class FistBumpCommand extends Command {
|
||||
if (message.channel.type !== 'dm') {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
}
|
||||
const roleplayed = args.thing;
|
||||
return message.say(`${message.author} *fist-bumps* ${roleplayed} *badalalala*`);
|
||||
const { thing } = args;
|
||||
return message.say(`${message.author} *fist-bumps* ${thing} *badalalala*`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -20,7 +20,7 @@ module.exports = class HighFivesCommand extends Command {
|
||||
if (message.channel.type !== 'dm') {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
}
|
||||
const roleplayed = args.thing;
|
||||
return message.say(`${message.author} *high-fives* ${roleplayed}`);
|
||||
const { thing } = args;
|
||||
return message.say(`${message.author} *high-fives* ${thing}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -20,7 +20,7 @@ module.exports = class HitwithShovelCommand extends Command {
|
||||
if (message.channel.type !== 'dm') {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
}
|
||||
const roleplayed = args.thing;
|
||||
return message.say(`${message.author} *hits* ${roleplayed} *with a shovel*`);
|
||||
const { thing } = args;
|
||||
return message.say(`${message.author} *hits* ${thing} *with a shovel*`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -20,7 +20,7 @@ module.exports = class HugCommand extends Command {
|
||||
if (message.channel.type !== 'dm') {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
}
|
||||
const roleplayed = args.thing;
|
||||
return message.say(`${message.author} *hugs* ${roleplayed}`);
|
||||
const { thing } = args;
|
||||
return message.say(`${message.author} *hugs* ${thing}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -20,7 +20,7 @@ module.exports = class InhaleCommand extends Command {
|
||||
if (message.channel.type !== 'dm') {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
}
|
||||
const roleplayed = args.thing;
|
||||
return message.say(`${message.author} *inhales* ${roleplayed} *but gained no ability...*`);
|
||||
const { thing } = args;
|
||||
return message.say(`${message.author} *inhales* ${thing} *but gained no ability...*`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -20,7 +20,7 @@ module.exports = class KillCommand extends Command {
|
||||
if (message.channel.type !== 'dm') {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
}
|
||||
const roleplayed = args.thing;
|
||||
return message.say(`${message.author} *kills* ${roleplayed}`);
|
||||
const { thing } = args;
|
||||
return message.say(`${message.author} *kills* ${thing}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -20,7 +20,7 @@ module.exports = class KissCommand extends Command {
|
||||
if (message.channel.type !== 'dm') {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
}
|
||||
const roleplayed = args.thing;
|
||||
return message.say(`${message.author} *kisses* ${roleplayed}`);
|
||||
const { thing } = args;
|
||||
return message.say(`${message.author} *kisses* ${thing}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -20,7 +20,7 @@ module.exports = class MarryCommand extends Command {
|
||||
if (message.channel.type !== 'dm') {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
}
|
||||
const roleplayed = args.thing;
|
||||
return message.say(`${message.author} *marries* ${roleplayed}`);
|
||||
const { thing } = args;
|
||||
return message.say(`${message.author} *marries* ${thing}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -20,7 +20,7 @@ module.exports = class PatCommand extends Command {
|
||||
if (message.channel.type !== 'dm') {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
}
|
||||
const roleplayed = args.thing;
|
||||
return message.say(`${message.author} *pats* ${roleplayed}`);
|
||||
const { thing } = args;
|
||||
return message.say(`${message.author} *pats* ${thing}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -20,7 +20,7 @@ module.exports = class PokeCommand extends Command {
|
||||
if (message.channel.type !== 'dm') {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
}
|
||||
const roleplayed = args.thing;
|
||||
return message.say(`${message.author} *pokes* ${roleplayed}`);
|
||||
const { thing } = args;
|
||||
return message.say(`${message.author} *pokes* ${thing}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -20,7 +20,7 @@ module.exports = class PunchCommand extends Command {
|
||||
if (message.channel.type !== 'dm') {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
}
|
||||
const roleplayed = args.thing;
|
||||
return message.say(`${message.author} *punches* ${roleplayed}`);
|
||||
const { thing } = args;
|
||||
return message.say(`${message.author} *punches* ${thing}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -20,7 +20,7 @@ module.exports = class SlapCommand extends Command {
|
||||
if (message.channel.type !== 'dm') {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
}
|
||||
const roleplayed = args.thing;
|
||||
return message.say(`${message.author} *slaps* ${roleplayed}`);
|
||||
const { thing } = args;
|
||||
return message.say(`${message.author} *slaps* ${thing}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -17,7 +17,16 @@ module.exports = class BotSearchCommand extends Command {
|
||||
args: [{
|
||||
key: 'bot',
|
||||
prompt: 'Which bot do you want to get information for?',
|
||||
type: 'user'
|
||||
type: 'user',
|
||||
validate: user => {
|
||||
if (user.bot) {
|
||||
return true;
|
||||
}
|
||||
return 'Please only use a bot account.';
|
||||
},
|
||||
parse: bot => {
|
||||
return bot.id;
|
||||
}
|
||||
}]
|
||||
});
|
||||
}
|
||||
@@ -27,7 +36,7 @@ module.exports = class BotSearchCommand extends Command {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say(':x: Error! I don\'t have the Embed Links Permission!');
|
||||
}
|
||||
const bot = args.bot.id;
|
||||
let { bot } = args;
|
||||
try {
|
||||
const response = await request
|
||||
.get(`https://bots.discord.pw/api/bots/${bot}`)
|
||||
|
||||
@@ -19,7 +19,10 @@ module.exports = class DefineCommand extends Command {
|
||||
args: [{
|
||||
key: 'word',
|
||||
prompt: 'What would you like to define?',
|
||||
type: 'string'
|
||||
type: 'string',
|
||||
parse: text => {
|
||||
return encodeURIComponent(text);
|
||||
}
|
||||
}]
|
||||
});
|
||||
}
|
||||
@@ -29,7 +32,7 @@ module.exports = class DefineCommand extends Command {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say(':x: Error! I don\'t have the Embed Links Permission!');
|
||||
}
|
||||
const word = encodeURIComponent(args.word);
|
||||
const { word } = args;
|
||||
try {
|
||||
const response = await request
|
||||
.get(`http://api.wordnik.com:80/v4/word.json/${word}/definitions?limit=1&includeRelated=false&useCanonical=false&api_key=${process.env.WORDNIK_KEY}`);
|
||||
|
||||
@@ -32,7 +32,7 @@ module.exports = class DiscrimCommand extends Command {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say(':x: Error! I don\'t have the Embed Links Permission!');
|
||||
}
|
||||
const discrim = args.discrim;
|
||||
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}`)
|
||||
|
||||
@@ -14,7 +14,7 @@ module.exports = class ForecastCommand extends Command {
|
||||
description: 'Gets the seven-day forecast for a specified location. (;forecast San Francisco)',
|
||||
examples: [';forecast San Francisco'],
|
||||
args: [{
|
||||
key: 'locationQ',
|
||||
key: 'location',
|
||||
prompt: 'What location would you like to get the forecast for?',
|
||||
type: 'string'
|
||||
}]
|
||||
@@ -26,7 +26,7 @@ module.exports = class ForecastCommand extends Command {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say(':x: Error! I don\'t have the Embed Links Permission!');
|
||||
}
|
||||
const location = args.locationQ;
|
||||
const { location } = args;
|
||||
try {
|
||||
const response = await request
|
||||
.get(`https://query.yahooapis.com/v1/public/yql?q=select * from weather.forecast where u=\'f\' AND woeid in (select woeid from geo.places(1) where text="${location}")&format=json`);
|
||||
|
||||
@@ -17,7 +17,10 @@ module.exports = class GoogleCommand extends Command {
|
||||
args: [{
|
||||
key: 'query',
|
||||
prompt: 'What would you like to search for?',
|
||||
type: 'string'
|
||||
type: 'string',
|
||||
parse: text => {
|
||||
return encodeURIComponent(text);
|
||||
}
|
||||
}]
|
||||
});
|
||||
}
|
||||
@@ -26,7 +29,7 @@ module.exports = class GoogleCommand extends Command {
|
||||
if (message.channel.type !== 'dm') {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
}
|
||||
const query = encodeURIComponent(args.query);
|
||||
const { query } = args;
|
||||
const msg = await message.say('Searching...');
|
||||
try {
|
||||
const response = await request
|
||||
|
||||
@@ -18,7 +18,10 @@ module.exports = class IMDBCommand extends Command {
|
||||
args: [{
|
||||
key: 'movie',
|
||||
prompt: 'What movie or TV Show would you like to search for?',
|
||||
type: 'string'
|
||||
type: 'string',
|
||||
parse: text => {
|
||||
return encodeURIComponent(text);
|
||||
}
|
||||
}]
|
||||
});
|
||||
}
|
||||
@@ -28,7 +31,7 @@ module.exports = class IMDBCommand extends Command {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say(':x: Error! I don\'t have the Embed Links Permission!');
|
||||
}
|
||||
const movie = encodeURIComponent(args.movie);
|
||||
const { movie } = args;
|
||||
try {
|
||||
const response = await request
|
||||
.get(`http://www.omdbapi.com/?t=${movie}&plot=full`);
|
||||
|
||||
@@ -23,9 +23,12 @@ module.exports = class MapCommand extends Command {
|
||||
return 'Please enter a zoom value from 1-20';
|
||||
}
|
||||
}, {
|
||||
key: 'locationQ',
|
||||
key: 'location',
|
||||
prompt: 'What location you like to get a map image for?',
|
||||
type: 'string'
|
||||
type: 'string',
|
||||
parse: text => {
|
||||
return encodeURIComponent(text);
|
||||
}
|
||||
}]
|
||||
});
|
||||
}
|
||||
@@ -35,8 +38,7 @@ module.exports = class MapCommand extends Command {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('ATTACH_FILES')) return message.say(':x: Error! I don\'t have the Attach Files Permission!');
|
||||
}
|
||||
const zoom = args.zoom;
|
||||
const location = encodeURIComponent(args.locationQ);
|
||||
const { zoom, location } = args;
|
||||
try {
|
||||
const response = await request
|
||||
.get(`https://maps.googleapis.com/maps/api/staticmap?center=${location}&zoom=${zoom}&size=500x500&key=${process.env.GOOGLE_KEY}`);
|
||||
|
||||
@@ -13,7 +13,10 @@ module.exports = class NeopetCommand extends Command {
|
||||
args: [{
|
||||
key: 'pet',
|
||||
prompt: 'What pet would you like to get the image of?',
|
||||
type: 'string'
|
||||
type: 'string',
|
||||
parse: text => {
|
||||
return encodeURIComponent(text);
|
||||
}
|
||||
}]
|
||||
});
|
||||
}
|
||||
@@ -23,7 +26,7 @@ module.exports = class NeopetCommand extends Command {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('ATTACH_FILES')) return message.say(':x: Error! I don\'t have the Attach Files Permission!');
|
||||
}
|
||||
const pet = encodeURIComponent(args.pet);
|
||||
const { pet } = args;
|
||||
try {
|
||||
const response = await request
|
||||
.get(`http://www.sunnyneo.com/petimagefinder.php?name=${pet}&size=5&mood=1`);
|
||||
|
||||
@@ -18,7 +18,10 @@ module.exports = class OsuCommand extends Command {
|
||||
args: [{
|
||||
key: 'username',
|
||||
prompt: 'What osu username would you like to search for?',
|
||||
type: 'string'
|
||||
type: 'string',
|
||||
parse: text => {
|
||||
return encodeURIComponent(text);
|
||||
}
|
||||
}]
|
||||
});
|
||||
}
|
||||
@@ -28,7 +31,7 @@ module.exports = class OsuCommand extends Command {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say(':x: Error! I don\'t have the Embed Links Permission!');
|
||||
}
|
||||
const username = encodeURIComponent(args.username);
|
||||
const { username } = args;
|
||||
try {
|
||||
const response = await request
|
||||
.get(`https://osu.ppy.sh/api/get_user?k=${process.env.OSU_KEY}&u=${username}&type=string`);
|
||||
|
||||
@@ -18,7 +18,10 @@ module.exports = class UrbanCommand extends Command {
|
||||
args: [{
|
||||
key: 'word',
|
||||
prompt: 'What would you like to define?',
|
||||
type: 'string'
|
||||
type: 'string',
|
||||
parse: text => {
|
||||
return encodeURIComponent(text);
|
||||
}
|
||||
}]
|
||||
});
|
||||
}
|
||||
@@ -28,7 +31,7 @@ module.exports = class UrbanCommand extends Command {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say(':x: Error! I don\'t have the Embed Links Permission!');
|
||||
}
|
||||
const word = encodeURIComponent(args.word);
|
||||
const { word } = args;
|
||||
try {
|
||||
const response = await request
|
||||
.get(`http://api.urbandictionary.com/v0/define?term=${word}`);
|
||||
|
||||
@@ -13,7 +13,10 @@ module.exports = class WattpadCommand extends Command {
|
||||
args: [{
|
||||
key: 'book',
|
||||
prompt: 'What book would you like to search for?',
|
||||
type: 'string'
|
||||
type: 'string',
|
||||
parse: text => {
|
||||
return encodeURIComponent(text);
|
||||
}
|
||||
}]
|
||||
});
|
||||
}
|
||||
@@ -23,7 +26,7 @@ module.exports = class WattpadCommand extends Command {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say(':x: Error! I don\'t have the Embed Links Permission!');
|
||||
}
|
||||
const book = encodeURIComponent(args.book);
|
||||
const { book } = args;
|
||||
try {
|
||||
const response = await request
|
||||
.get(`https://api.wattpad.com:443/v4/stories?query=${book}&limit=1`)
|
||||
|
||||
@@ -11,7 +11,7 @@ module.exports = class WeatherCommand extends Command {
|
||||
description: 'Searches weather for a specified location. (;weather San Francisco)',
|
||||
examples: [';weather San Francisco'],
|
||||
args: [{
|
||||
key: 'locationQ',
|
||||
key: 'location',
|
||||
prompt: 'What location would you like to get the current weather for?',
|
||||
type: 'string'
|
||||
}]
|
||||
@@ -23,7 +23,7 @@ module.exports = class WeatherCommand extends Command {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say(':x: Error! I don\'t have the Embed Links Permission!');
|
||||
}
|
||||
const location = args.locationQ;
|
||||
const { location } = args;
|
||||
try {
|
||||
const response = await request
|
||||
.get(`https://query.yahooapis.com/v1/public/yql?q=select * from weather.forecast where u=\'f\' AND woeid in (select woeid from geo.places(1) where text="${location}")&format=json`);
|
||||
|
||||
@@ -13,7 +13,10 @@ module.exports = class WikipediaCommand extends Command {
|
||||
args: [{
|
||||
key: 'query',
|
||||
prompt: 'What would you like to search for?',
|
||||
type: 'string'
|
||||
type: 'string',
|
||||
parse: text => {
|
||||
return encodeURIComponent(text).replace(/[)]/g, '%29');
|
||||
}
|
||||
}]
|
||||
});
|
||||
}
|
||||
@@ -23,8 +26,7 @@ module.exports = class WikipediaCommand extends Command {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say(':x: Error! I don\'t have the Embed Links Permission!');
|
||||
}
|
||||
let query = encodeURIComponent(args.query);
|
||||
query = query.replace(/[)]/g, '%29');
|
||||
const { query } = args;
|
||||
try {
|
||||
const response = await request
|
||||
.get(`https://en.wikipedia.org/w/api.php?action=query&prop=extracts&format=json&titles=${query}&exintro=&explaintext=&redirects=&formatversion=2`);
|
||||
|
||||
@@ -16,7 +16,10 @@ module.exports = class YouTubeCommand extends Command {
|
||||
args: [{
|
||||
key: 'video',
|
||||
prompt: 'What would you like to search for?',
|
||||
type: 'string'
|
||||
type: 'string',
|
||||
parse: text => {
|
||||
return encodeURIComponent(text);
|
||||
}
|
||||
}]
|
||||
});
|
||||
}
|
||||
@@ -26,7 +29,7 @@ module.exports = class YouTubeCommand extends Command {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say(':x: Error! I don\'t have the Embed Links Permission!');
|
||||
}
|
||||
const video = encodeURIComponent(args.video);
|
||||
const { video } = args;
|
||||
try {
|
||||
const response = await request
|
||||
.get(`https://www.googleapis.com/youtube/v3/search?part=snippet&type=video&maxResults=1&q=${video}&key=${process.env.GOOGLE_KEY}`);
|
||||
|
||||
@@ -13,7 +13,10 @@ module.exports = class YuGiOhCommand extends Command {
|
||||
args: [{
|
||||
key: 'card',
|
||||
prompt: 'What card would you like to get data for?',
|
||||
type: 'string'
|
||||
type: 'string',
|
||||
parse: text => {
|
||||
return encodeURIComponent(text);
|
||||
}
|
||||
}]
|
||||
});
|
||||
}
|
||||
@@ -23,7 +26,7 @@ module.exports = class YuGiOhCommand extends Command {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say(':x: Error! I don\'t have the Embed Links Permission!');
|
||||
}
|
||||
const card = encodeURIComponent(args.card);
|
||||
const { card } = args;
|
||||
try {
|
||||
const response = await request
|
||||
.get(`http://yugiohprices.com/api/card_data/${card}`);
|
||||
|
||||
@@ -25,6 +25,9 @@ module.exports = class BinaryCommand extends Command {
|
||||
return 'Your message content is too long.';
|
||||
}
|
||||
return true;
|
||||
},
|
||||
parse: text => {
|
||||
return stringToBinary(text);
|
||||
}
|
||||
}]
|
||||
});
|
||||
@@ -34,8 +37,7 @@ module.exports = class BinaryCommand extends Command {
|
||||
if (message.channel.type !== 'dm') {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
}
|
||||
const text = args.text;
|
||||
const binary = stringToBinary(text);
|
||||
return message.say(binary);
|
||||
const { text } = args;
|
||||
return message.say(text);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -26,7 +26,7 @@ module.exports = class CowsayCommand extends Command {
|
||||
if (message.channel.type !== 'dm') {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
}
|
||||
const text = args.text;
|
||||
const { text } = args;
|
||||
return message.code(null, `< ${text} >\n \\ ^__^\n \\ (oO)\\_______\n (__)\\ )\\/\\\n U ||----w |\n || ||`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -18,19 +18,19 @@ module.exports = class EmbedCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(message, args) {
|
||||
run(message, args) {
|
||||
if (message.channel.type !== 'dm') {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say(':x: Error! I don\'t have the Embed Links Permission!');
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('MANAGE_MESSAGES')) return message.say(':x: Error! I don\'t have the Manage Messages Permission!');
|
||||
}
|
||||
const text = args.text;
|
||||
const { text } = args;
|
||||
const embed = new RichEmbed()
|
||||
.setAuthor(message.author.username, message.author.avatarURL)
|
||||
.setColor(0x00AE86)
|
||||
.setTimestamp()
|
||||
.setDescription(text);
|
||||
await message.delete();
|
||||
message.delete();
|
||||
return message.embed(embed);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -22,6 +22,9 @@ module.exports = class MorseCommand extends Command {
|
||||
return true;
|
||||
}
|
||||
return 'Your text to encode is too long.';
|
||||
},
|
||||
parse: text => {
|
||||
return translator.letterTrans(text.toLowerCase(), dictionary, ' ');
|
||||
}
|
||||
}]
|
||||
});
|
||||
@@ -31,8 +34,7 @@ module.exports = class MorseCommand extends Command {
|
||||
if (message.channel.type !== 'dm') {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
}
|
||||
const text = args.text.toLowerCase();
|
||||
const encoded = translator.letterTrans(text, dictionary, ' ');
|
||||
return message.say(encoded);
|
||||
const { text } = args;
|
||||
return message.say(text);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -23,6 +23,9 @@ module.exports = class PirateCommand extends Command {
|
||||
return 'Your message content is too long.';
|
||||
}
|
||||
return true;
|
||||
},
|
||||
parse: text => {
|
||||
return translator.wordTrans(text, dictionary);
|
||||
}
|
||||
}]
|
||||
});
|
||||
@@ -32,8 +35,7 @@ module.exports = class PirateCommand extends Command {
|
||||
if (message.channel.type !== 'dm') {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
}
|
||||
const text = args.text;
|
||||
const pirate = translator.wordTrans(text, dictionary);
|
||||
return message.say(`\u180E${pirate}`);
|
||||
const { text } = args;
|
||||
return message.say(`\u180E${text}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -11,7 +11,10 @@ module.exports = class ReverseCommand extends Command {
|
||||
args: [{
|
||||
key: 'text',
|
||||
prompt: 'What text would you like to reverse?',
|
||||
type: 'string'
|
||||
type: 'string',
|
||||
parse: text => {
|
||||
return text.split('').reverse().join('');
|
||||
}
|
||||
}]
|
||||
});
|
||||
}
|
||||
@@ -20,8 +23,7 @@ module.exports = class ReverseCommand extends Command {
|
||||
if (message.channel.type !== 'dm') {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
}
|
||||
const text = args.text;
|
||||
const reversed = text.split('').reverse().join('');
|
||||
return message.say(`\u180E${reversed}`);
|
||||
const { text } = args;
|
||||
return message.say(`\u180E${text}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -23,13 +23,13 @@ module.exports = class SayCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(message, args) {
|
||||
run(message, args) {
|
||||
if (message.channel.type !== 'dm') {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('MANAGE_MESSAGES')) return message.say(':x: Error! I don\'t have the Manage Messages Permission!');
|
||||
}
|
||||
const text = args.text;
|
||||
await message.delete();
|
||||
const { text } = args;
|
||||
message.delete();
|
||||
return message.say(`\u180E${text}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -19,6 +19,9 @@ module.exports = class TemmieCommand extends Command {
|
||||
return 'Your message content is too long.';
|
||||
}
|
||||
return true;
|
||||
},
|
||||
parse: text => {
|
||||
return translator.wordTrans(text, dictionary);
|
||||
}
|
||||
}]
|
||||
});
|
||||
@@ -28,8 +31,7 @@ module.exports = class TemmieCommand extends Command {
|
||||
if (message.channel.type !== 'dm') {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
}
|
||||
const text = args.text;
|
||||
const temmized = translator.wordTrans(text, dictionary);
|
||||
return message.say(`\u180E${temmized}`);
|
||||
const { text } = args;
|
||||
return message.say(`\u180E${text}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -17,7 +17,10 @@ module.exports = class UpsideDownCommand extends Command {
|
||||
args: [{
|
||||
key: 'text',
|
||||
prompt: 'What text would you like to flip upside-down?',
|
||||
type: 'string'
|
||||
type: 'string',
|
||||
parse: text => {
|
||||
return translator.letterTrans(text, dictionary);
|
||||
}
|
||||
}]
|
||||
});
|
||||
}
|
||||
@@ -26,8 +29,7 @@ module.exports = class UpsideDownCommand extends Command {
|
||||
if (message.channel.type !== 'dm') {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
}
|
||||
const text = args.text;
|
||||
const upsideDown = translator.letterTrans(text, dictionary);
|
||||
return message.say(upsideDown);
|
||||
const { text } = args;
|
||||
return message.say(text);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -31,9 +31,9 @@ module.exports = class WebhookCommand extends Command {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('MANAGE_MESSAGES')) return message.say(':x: Error! I don\'t have the Manage Messages Permission!');
|
||||
}
|
||||
const text = args.text;
|
||||
const { text } = args;
|
||||
try {
|
||||
await message.delete();
|
||||
message.delete();
|
||||
await request
|
||||
.post(process.env.WEBHOOK_URL)
|
||||
.send({
|
||||
|
||||
@@ -18,6 +18,9 @@ module.exports = class ZalgoCommand extends Command {
|
||||
return 'Your message content is too long.';
|
||||
}
|
||||
return true;
|
||||
},
|
||||
parse: text => {
|
||||
return zalgo(text);
|
||||
}
|
||||
}]
|
||||
});
|
||||
@@ -27,8 +30,7 @@ module.exports = class ZalgoCommand extends Command {
|
||||
if (message.channel.type !== 'dm') {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
}
|
||||
const text = args.text;
|
||||
const zalgoified = zalgo(text);
|
||||
return message.say(`\u180E${zalgoified}`);
|
||||
const { text } = args;
|
||||
return message.say(`\u180E${text}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -20,7 +20,7 @@ module.exports = class AvatarCommand extends Command {
|
||||
if (message.channel.type !== 'dm') {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
}
|
||||
const user = args.user;
|
||||
const { user } = args;
|
||||
return message.say(user.displayAvatarURL);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -30,11 +30,8 @@ module.exports = class UserInfoCommand extends Command {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say(':x: Error! I don\'t have the Embed Links Permission!');
|
||||
}
|
||||
const user = args.user;
|
||||
let member = message.guild.member(user);
|
||||
if (!member) {
|
||||
member = await message.guild.fetchMember(user);
|
||||
}
|
||||
const { user } = args;
|
||||
const member = await message.guild.fetchMember(user);
|
||||
let stat;
|
||||
let color;
|
||||
switch (user.presence.status) {
|
||||
@@ -55,7 +52,6 @@ module.exports = class UserInfoCommand extends Command {
|
||||
color = 0x808080;
|
||||
break;
|
||||
}
|
||||
const userGame = user.presence.game ? user.presence.game.name : 'None';
|
||||
const embed = new RichEmbed()
|
||||
.setColor(color)
|
||||
.setThumbnail(user.displayAvatarURL)
|
||||
@@ -70,7 +66,7 @@ module.exports = class UserInfoCommand extends Command {
|
||||
.addField('**Status:**',
|
||||
stat, true)
|
||||
.addField('**Playing:**',
|
||||
userGame, true);
|
||||
user.presence.game ? user.presence.game.name : 'None', true);
|
||||
return message.embed(embed);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -31,7 +31,7 @@ module.exports = class ShardInfoCommand extends Command {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say(':x: Error! I don\'t have the Embed Links Permission!');
|
||||
}
|
||||
const shardID = args.shardID;
|
||||
const { shardID } = args;
|
||||
if (shardID > this.client.options.shardCount - 1 || shardID < 0) return message.say(':x: Error! Invalid Shard!');
|
||||
const memory = await this.client.shard.broadcastEval('Math.round(process.memoryUsage().heapUsed / 1024 / 1024)');
|
||||
const uptime = await this.client.shard.fetchClientValues('uptime');
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiaobot",
|
||||
"version": "28.1.0",
|
||||
"version": "29.0.0",
|
||||
"description": "A Discord Bot",
|
||||
"main": "shardingmanager.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user