Lots of Changes

This commit is contained in:
Daniel Odendahl Jr
2017-08-26 01:20:43 +00:00
parent d2008c749d
commit 56e72f7509
78 changed files with 393 additions and 389 deletions
+2 -2
View File
@@ -5,7 +5,7 @@
"tag": "This command is *easter egg*, not *tag* :yum:",
"easter egg": ":egg:",
"snek": "*Blame :snake:*",
"snekfetch": "superagent is better.",
"snekfetch": "The best.",
"xiaobot": "That's my name.",
"dragonfire535": "http://dragonfire535.tk",
"heroes of dreamland": "https://www.wattpad.com/story/8712240-heroes-of-dreamland-book-1-kirby-and-the-monstrous",
@@ -32,7 +32,7 @@
"book1": "Book.",
"new": "Nope, not quite yet.",
"adam": "Adam pls.",
"token": "[READACTED]",
"token": "[REDACTED]",
"nom": "https://cdn.discordapp.com/attachments/256055608279695360/308434352377954304/tumblr_ojzfs3jjoJ1qz64n4o1_540.gif",
"good vs evil": "https://cdn.discordapp.com/attachments/256055608279695360/308404323392684033/837631b64ef351ddabe8c2200c2feca54d81af62_hq.jpg",
"ebearskittychan": "The best :heart:",
-8
View File
@@ -1,8 +0,0 @@
[
"Maybe someday",
"Nothing",
"Neither",
"I don't think so",
"Yes",
"Try asking again"
]
-38
View File
@@ -1,38 +0,0 @@
{
"operations": {
"easy": [
"+",
"-"
],
"medium": [
"+",
"-"
],
"hard": [
"-",
"*"
],
"extreme": [
"*",
"/"
],
"impossible": [
"/",
"^"
]
},
"difficulties": [
"easy",
"medium",
"hard",
"extreme",
"impossible"
],
"maxValues": {
"easy": 5,
"medium": 10,
"hard": 50,
"extreme": 75,
"impossible": 100
}
}
-14
View File
@@ -1,14 +0,0 @@
{
"filterLevels": [
"Off",
"No Role",
"Everyone"
],
"verificationLevels": [
"None",
"Low",
"Medium",
"(╯°□°)╯︵ ┻━┻",
"┻━┻ ミヽ(ಠ益ಠ)ノ彡┻━┻"
]
}
-7
View File
@@ -1,7 +0,0 @@
[
"airhorn",
"cat",
"dun-dun-dun",
"pikachu",
"space"
]
+32 -48
View File
@@ -1,48 +1,32 @@
{
"sentences": [
"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.",
"I am so blue I'm greener than purple.",
"I stepped on a Corn Flake, now I'm a Cereal Killer.",
"On a scale from one to ten what is your favourite colour of the alphabet?",
"The sparkly lamp ate a pillow then punched Larry.",
"My world is where everybody is a pony and we all eat rainbows and poop butterflies.",
"If your canoe is stuck in a tree with the headlights on, how many pancakes does it take to get to the moon?",
"There's a purple mushroom in my backyard, screaming Taco's!",
"When life gives you lemons, chuck them at people you hate.",
"I think I will buy the red car, or I will lease the blue one.",
"Italy is my favorite country; in fact, I plan to spend two weeks there next year.",
"She borrowed the book from him many years ago and hasn't yet returned it.",
"Lets all be unique together until we realise we are all the same.",
"If Purple People Eaters are real… where do they find purple people to eat?",
"The waves were crashing on the shore; it was a lovely sight.",
"This is the last random sentence I will be writing and I am going to stop mid-sent.",
"The memory we used to share is no longer coherent.",
"She did not cheat on the test, for it was not the right thing to do.",
"She only paints with bold colors; she does not like pastels.",
"Malls are great places to shop; I can find everything I need under one roof.",
"The body may perhaps compensates for the loss of a true metaphysics.",
"They got there early, and they got really good seats.",
"Everyone was busy, so I went to the movie alone.",
"Yeah, I think it's a good environment for learning English.",
"I would have gotten the promotion, but my attendance wasnt good enough.",
"There were white out conditions in the town; subsequently, the roads were impassable.",
"If you like tuna and tomato sauce- try combining the two. Its really not as bad as it sounds."
],
"difficulties": [
"easy",
"medium",
"hard",
"extreme",
"impossible"
],
"times": {
"easy": 25000,
"medium": 20000,
"hard": 15000,
"extreme": 10000,
"impossible": 5000
}
}
[
"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.",
"I am so blue I'm greener than purple.",
"I stepped on a Corn Flake, now I'm a Cereal Killer.",
"On a scale from one to ten what is your favourite colour of the alphabet?",
"The sparkly lamp ate a pillow then punched Larry.",
"My world is where everybody is a pony and we all eat rainbows and poop butterflies.",
"If your canoe is stuck in a tree with the headlights on, how many pancakes does it take to get to the moon?",
"There's a purple mushroom in my backyard, screaming Taco's!",
"When life gives you lemons, chuck them at people you hate.",
"I think I will buy the red car, or I will lease the blue one.",
"Italy is my favorite country; in fact, I plan to spend two weeks there next year.",
"She borrowed the book from him many years ago and hasn't yet returned it.",
"Lets all be unique together until we realise we are all the same.",
"If Purple People Eaters are real… where do they find purple people to eat?",
"The waves were crashing on the shore; it was a lovely sight.",
"This is the last random sentence I will be writing and I am going to stop mid-sent.",
"The memory we used to share is no longer coherent.",
"She did not cheat on the test, for it was not the right thing to do.",
"She only paints with bold colors; she does not like pastels.",
"Malls are great places to shop; I can find everything I need under one roof.",
"The body may perhaps compensates for the loss of a true metaphysics.",
"They got there early, and they got really good seats.",
"Everyone was busy, so I went to the movie alone.",
"Yeah, I think it's a good environment for learning English.",
"I would have gotten the promotion, but my attendance wasnt good enough.",
"There were white out conditions in the town; subsequently, the roads were impassable.",
"If you like tuna and tomato sauce- try combining the two. Its really not as bad as it sounds."
]
-6
View File
@@ -1,6 +0,0 @@
{
"online": "<:online:313956277808005120> Online",
"idle": "<:away:313956277220802560> Idle",
"dnd": "<:dnd:313956276893646850> Do Not Disturb",
"offline": "<:offline:313956277237710868> Offline"
}
+9 -10
View File
@@ -9,11 +9,10 @@ module.exports = class BattleCommand extends Command {
group: 'games',
memberName: 'battle',
description: 'Engage in a turn-based battle against another user or the AI.',
guildOnly: true,
args: [
{
key: 'opponent',
prompt: 'Who would you like to battle?',
prompt: 'What user would you like to battle?',
type: 'user',
default: ''
}
@@ -26,17 +25,17 @@ module.exports = class BattleCommand extends Command {
async run(msg, args) { // eslint-disable-line complexity
const opponent = args.opponent || this.client.user;
if (opponent.id === msg.author.id) return msg.say('You may not fight yourself.');
if (this.fighting.has(msg.guild.id)) return msg.say('Only one fight may be occurring per server.');
this.fighting.add(msg.guild.id);
if (this.fighting.has(msg.channel.id)) return msg.say('Only one fight may be occurring per channel.');
this.fighting.add(msg.channel.id);
try {
if (!opponent.bot) {
await msg.say(`${opponent}, do you accept this challenge? **__Y__es** or **No**?`);
await msg.say(`${opponent}, do you accept this challenge?`);
const verify = await msg.channel.awaitMessages(res => res.author.id === opponent.id, {
max: 1,
time: 30000
});
if (!verify.size || !['yes', 'y'].includes(verify.first().content.toLowerCase())) {
this.fighting.delete(msg.guild.id);
this.fighting.delete(msg.channel.id);
return msg.say('Looks like they declined...');
}
}
@@ -65,7 +64,7 @@ module.exports = class BattleCommand extends Command {
await msg.say(stripIndents`
${user}, do you **fight**, **guard**, **special**, or **run**?
**${msg.author.username}**: ${userHP}HP
**${opponent === 'AI' ? 'AI' : opponent.username}**: ${oppoHP}HP
**${opponent.username}**: ${oppoHP}HP
`);
const turn = await msg.channel.awaitMessages(res => res.author.id === id, {
max: 1,
@@ -109,15 +108,15 @@ module.exports = class BattleCommand extends Command {
await msg.say(`${user}, I do not understand what you want to do.`);
}
}
this.fighting.delete(msg.guild.id);
this.fighting.delete(msg.channel.id);
return msg.say(stripIndents`
The match is over!
**Winner:** ${userHP > oppoHP ? `${msg.author} (${userHP}HP)` : `${opponent} (${oppoHP}HP)`}
**Loser:** ${userHP > oppoHP ? `${opponent} (${oppoHP}HP)` : `${msg.author} (${userHP}HP)`}
`);
} catch (err) {
this.fighting.delete(msg.guild.id);
return msg.say(`Oh no, an Error occurred: \`${err.message}\`. Try again later!`);
this.fighting.delete(msg.channel.id);
return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
}
}
};
+1
View File
@@ -5,6 +5,7 @@ module.exports = class FishyCommand extends Command {
constructor(client) {
super(client, {
name: 'fishy',
aliases: ['fish'],
group: 'games',
memberName: 'fishy',
description: 'Catches a fish.'
+7 -7
View File
@@ -27,16 +27,16 @@ module.exports = class GunfightCommand extends Command {
const { opponent } = args;
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.guild.id)) return msg.say('Only one fight may be occurring per server.');
this.fighting.add(msg.guild.id);
if (this.fighting.has(msg.channel.id)) return msg.say('Only one fight may be occurring per channel.');
this.fighting.add(msg.channel.id);
try {
await msg.say(`${opponent}, do you accept this challenge? **__Y__es** or **No**?`);
await msg.say(`${opponent}, do you accept this challenge?`);
const verify = await msg.channel.awaitMessages(res => res.author.id === opponent.id, {
max: 1,
time: 30000
});
if (!verify.size || !['yes', 'y'].includes(verify.first().content.toLowerCase())) {
this.fighting.delete(msg.guild.id);
this.fighting.delete(msg.channel.id);
return msg.say('Looks like they declined...');
}
await msg.say('Get Ready...');
@@ -49,12 +49,12 @@ module.exports = class GunfightCommand extends Command {
max: 1,
time: 30000
});
this.fighting.delete(msg.guild.id);
this.fighting.delete(msg.channel.id);
if (!winner.size) return msg.say('Oh... No one won.');
return msg.say(`And the winner is ${winner.first().author.username}!`);
} catch (err) {
this.fighting.delete(msg.guild.id);
return msg.say(`Oh no, an Error occurred: \`${err.message}\`. Try again later!`);
this.fighting.delete(msg.channel.id);
return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
}
}
};
+9 -10
View File
@@ -17,8 +17,8 @@ module.exports = class HangmanCommand extends Command {
}
async run(msg) {
if (this.playing.has(msg.guild.id)) return msg.say('Only one game may be occurring per server.');
this.playing.add(msg.guild.id);
if (this.playing.has(msg.channel.id)) return msg.say('Only one game may be occurring per channel.');
this.playing.add(msg.channel.id);
try {
const { body } = await snekfetch
.get('http://api.wordnik.com:80/v4/words.json/randomWord')
@@ -32,7 +32,7 @@ module.exports = class HangmanCommand extends Command {
maxLength: -1,
api_key: WORDNIK_KEY
});
const word = body.word.toLowerCase().replace(/[ ]/g, '-');
const word = body.word.toLowerCase().replace(/ /g, '-');
let points = 0;
const confirmation = [];
const incorrect = [];
@@ -61,10 +61,9 @@ module.exports = class HangmanCommand extends Command {
} else if (word.includes(choice)) {
await msg.say('Nice job!');
for (let i = 0; i < word.length; i++) {
if (word[i] === choice) { // eslint-disable-line max-depth
confirmation.push(word[i]);
display[i] = word[i];
}
if (word[i] !== choice) continue; // eslint-disable-line max-depth
confirmation.push(word[i]);
display[i] = word[i];
}
} else {
await msg.say('Nope!');
@@ -72,12 +71,12 @@ module.exports = class HangmanCommand extends Command {
points++;
}
}
this.playing.delete(msg.guild.id);
this.playing.delete(msg.channel.id);
if (word.length === confirmation.length) return msg.say(`You won, it was ${word}!`);
return msg.say(`Too bad... It was ${word}...`);
} catch (err) {
this.playing.delete(msg.guild.id);
return msg.say(`Oh no, an Error occurred: \`${err.message}\`. Try again later!`);
this.playing.delete(msg.channel.id);
return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
}
}
};
+2 -2
View File
@@ -12,7 +12,7 @@ module.exports = class LotteryCommand extends Command {
run(msg) {
const lottery = Math.floor(Math.random() * 100) + 1;
if (lottery === 1) return msg.reply(`Wow! You actually won! Great job!`);
return msg.reply(`Nope, sorry, you lost.`);
if (lottery === 1) return msg.reply('Nice job! 10/10! You deserve some cake!');
return msg.reply('Nope, sorry, you lost.');
}
};
+18 -3
View File
@@ -1,7 +1,22 @@
const Command = require('../../structures/Command');
const { MessageEmbed } = require('discord.js');
const math = require('mathjs');
const { operations, difficulties, maxValues } = require('../../assets/json/math-game');
const { list } = require('../../structures/Util');
const difficulties = ['easy', 'medium', 'hard', 'extreme', 'impossible'];
const operations = {
easy: ['+', '-'],
medium: ['+', '-'],
hard: ['-', '*'],
extreme: ['*', '/'],
impossible: ['/', '^']
};
const maxValues = {
easy: 5,
medium: 10,
hard: 50,
extreme: 75,
impossible: 100
};
module.exports = class MathGameCommand extends Command {
constructor(client) {
@@ -14,11 +29,11 @@ module.exports = class MathGameCommand extends Command {
args: [
{
key: 'difficulty',
prompt: `What should the difficulty of the game be? One of: ${difficulties.join(', ')}`,
prompt: `What should the difficulty of the game be? Either ${list(difficulties, 'or')}.`,
type: 'string',
validate: difficulty => {
if (difficulties.includes(difficulty.toLowerCase())) return true;
return `The difficulty must be one of: ${difficulties.join(', ')}`;
return `Invalid difficulty, please enter either ${list(difficulties, 'or')}.`;
},
parse: difficulty => difficulty.toLowerCase()
}
+6 -5
View File
@@ -3,6 +3,7 @@ const { MessageEmbed } = require('discord.js');
const { stripIndents } = require('common-tags');
const snekfetch = require('snekfetch');
const { shuffle, list } = require('../../structures/Util');
const types = ['multiple', 'boolean'];
const difficulties = ['easy', 'medium', 'hard'];
module.exports = class QuizCommand extends Command {
@@ -17,22 +18,22 @@ module.exports = class QuizCommand extends Command {
args: [
{
key: 'type',
prompt: 'Which type of question would you like to have? `multiple` or `boolean`.',
prompt: `Which type of question would you like to have? Either ${list(types, 'or')}.`,
type: 'string',
validate: type => {
if (['multiple', 'boolean'].includes(type.toLowerCase())) return true;
return 'Please enter either `multiple` or `boolean`.';
if (types.includes(type.toLowerCase())) return true;
return `Invalid type, please enter either ${list(types, 'or')}.`;
},
parse: type => type.toLowerCase()
},
{
key: 'difficulty',
prompt: `What should the difficulty of the game be? One of: ${difficulties.join(', ')}`,
prompt: `What should the difficulty of the game be? Either ${list(difficulties, 'or')}.`,
type: 'string',
default: '',
validate: difficulty => {
if (difficulties.includes(difficulty.toLowerCase())) return true;
return `The difficulty must be one of: ${difficulties.join(', ')}`;
return `Invalid difficulty, please enter either ${list(difficulties, 'or')}.`;
},
parse: difficulty => difficulty.toLowerCase()
}
+15 -14
View File
@@ -1,5 +1,5 @@
const Command = require('../../structures/Command');
const choices = ['paper', 'rock', 'scissors'];
const choices = ['rock', 'paper', 'scissors'];
module.exports = class RockPaperScissorsCommand extends Command {
constructor(client) {
@@ -20,23 +20,24 @@ module.exports = class RockPaperScissorsCommand extends Command {
});
}
run(msg, args) { // eslint-disable-line consistent-return
run(msg, args) {
const { choice } = args;
const response = choices[Math.floor(Math.random() * choices.length)];
if (choice === 'rock') {
if (response === 'rock') return msg.say('Rock! Aw... A tie...');
else if (response === 'paper') return msg.say('Paper! Yes! I win!');
else if (response === 'scissors') return msg.say('Scissors! Aw... I lose...');
} else if (choice === 'paper') {
if (response === 'rock') return msg.say('Rock! Aw... I lose...');
else if (response === 'paper') return msg.say('Paper! Aw... A tie...');
else if (response === 'scissors') return msg.say('Scissors! Yes! I win!');
} else if (choice === 'scissors') {
if (response === 'rock') return msg.say('Rock! Yes! I win!');
else if (response === 'paper') return msg.say('Paper! Aw... I lose...');
else if (response === 'scissors') return msg.say('Scissors! Aw... A tie...');
} else {
return msg.say('I win by default, you little cheater.');
if (response === 'paper') return msg.say('Paper! Yes! I win!');
if (response === 'scissors') return msg.say('Scissors! Aw... I lose...');
}
if (choice === 'paper') {
if (response === 'rock') return msg.say('Rock! Aw... I lose...');
if (response === 'paper') return msg.say('Paper! Aw... A tie...');
if (response === 'scissors') return msg.say('Scissors! Yes! I win!');
}
if (choice === 'scissors') {
if (response === 'rock') return msg.say('Rock! Yes! I win!');
if (response === 'paper') return msg.say('Paper! Aw... I lose...');
if (response === 'scissors') return msg.say('Scissors! Aw... A tie...');
}
return msg.say('I win by default, you little cheater.');
}
};
+4 -5
View File
@@ -21,11 +21,10 @@ module.exports = class SlotsCommand extends Command {
${slotOne}|${slotTwo}|${slotThree}
Wow! You won! Great job... er... luck!
`);
} else {
return msg.say(stripIndents`
${slotOne}|${slotTwo}|${slotThree}
Aww... You lost... Guess it's just bad luck, huh?
`);
}
return msg.say(stripIndents`
${slotOne}|${slotTwo}|${slotThree}
Aww... You lost... Guess it's just bad luck, huh?
`);
}
};
+12 -3
View File
@@ -1,6 +1,15 @@
const Command = require('../../structures/Command');
const { MessageEmbed } = require('discord.js');
const { sentences, difficulties, times } = require('../../assets/json/typing-game');
const { list } = require('../../structures/Util');
const difficulties = ['easy', 'medium', 'hard', 'extreme', 'impossible'];
const times = {
easy: 25000,
medium: 20000,
hard: 15000,
extreme: 10000,
impossible: 5000
};
const sentences = require('../../assets/json/typing-game');
module.exports = class TypingGameCommand extends Command {
constructor(client) {
@@ -13,11 +22,11 @@ module.exports = class TypingGameCommand extends Command {
args: [
{
key: 'difficulty',
prompt: `What should the difficulty of the game be? One of: ${difficulties.join(', ')}`,
prompt: `What should the difficulty of the game be? Either ${list(difficulties, 'or')}.`,
type: 'string',
validate: difficulty => {
if (difficulties.includes(difficulty.toLowerCase())) return true;
return `The difficulty must be one of: ${difficulties.join(', ')}`;
return `Invalid difficulty, please enter either ${list(difficulties, 'or')}.`;
},
parse: difficulty => difficulty.toLowerCase()
}
+42
View File
@@ -0,0 +1,42 @@
const Command = require('../../structures/Command');
const { MessageEmbed } = require('discord.js');
const moment = require('moment');
module.exports = class ChannelInfoCommand extends Command {
constructor(client) {
super(client, {
name: 'channel-info',
aliases: ['channel'],
group: 'guild-info',
memberName: 'channel-info',
description: 'Responds with detailed information on a channel.',
guildOnly: true,
clientPermissions: ['EMBED_LINKS'],
args: [
{
key: 'channel',
prompt: 'Which channel would you like to get information on?',
type: 'channel',
default: ''
}
]
});
}
run(msg, args) {
const channel = args.channel || msg.channel;
const embed = new MessageEmbed()
.setColor(0x00AE86)
.addField(' Name',
channel.name, true)
.addField(' ID',
channel.id, true)
.addField(' NSFW',
channel.nsfw ? 'Yes' : 'No', true)
.addField(' Creation Date',
moment(channel.createdAt).format('MMMM Do YYYY'), true)
.addField(' Topic',
channel.topic || 'None');
return msg.embed(embed);
}
};
+1 -1
View File
@@ -16,7 +16,7 @@ module.exports = class RoleInfoCommand extends Command {
args: [
{
key: 'role',
prompt: 'Which role would you like to get info on?',
prompt: 'Which role would you like to get information on?',
type: 'role'
}
]
+2 -1
View File
@@ -1,7 +1,8 @@
const Command = require('../../structures/Command');
const { MessageEmbed } = require('discord.js');
const moment = require('moment');
const { filterLevels, verificationLevels } = require('../../assets/json/server-info');
const filterLevels = ['Off', 'No Role', 'Everyone'];
const verificationLevels = ['None', 'Low', 'Medium', '(╯°□°)╯︵ ┻━┻', '┻━┻ ミヽ(ಠ益ಠ)ノ彡┻━┻'];
module.exports = class GuildInfoCommand extends Command {
constructor(client) {
+1 -1
View File
@@ -16,7 +16,7 @@ module.exports = class AchievementCommand extends Command {
type: 'string',
validate: text => {
if (text.length < 25) return true;
return 'Text must be under 25 characters.';
return 'Please keep the text under 25 characters.';
}
}
]
+6 -5
View File
@@ -1,4 +1,5 @@
const Command = require('../../structures/Command');
const { list } = require('../../structures/Util');
const codes = require('../../assets/json/meme');
module.exports = class MemeCommand extends Command {
@@ -7,17 +8,17 @@ module.exports = class MemeCommand extends Command {
name: 'meme',
group: 'image-edit',
memberName: 'meme',
description: 'Sends a meme with text of your choice, and a background of your choice.',
description: 'Sends a meme with the text and background of your choice.',
clientPermissions: ['ATTACH_FILES'],
details: `**Codes:** ${codes.join(', ')}`,
args: [
{
key: 'type',
prompt: 'What meme type do you want to use?',
prompt: `What meme type do you want to use? Either ${list(codes, 'or')}.`,
type: 'string',
validate: type => {
if (codes.includes(type.toLowerCase())) return true;
return 'Invalid meme type. Use `help meme` to view a list of meme types.';
return `Invalid meme type, please enter either ${list(codes, 'or')}.`;
},
parse: type => type.toLowerCase()
},
@@ -29,7 +30,7 @@ module.exports = class MemeCommand extends Command {
if (top.length < 200) return true;
return 'Please keep the top text under 200 characters.';
},
parse: top => encodeURIComponent(top.replace(/[ ]/g, '-'))
parse: top => encodeURIComponent(top.replace(/ /g, '-'))
},
{
key: 'bottom',
@@ -39,7 +40,7 @@ module.exports = class MemeCommand extends Command {
if (bottom.length < 200) return true;
return 'Please keep the bottom text under 200 characters.';
},
parse: bottom => encodeURIComponent(bottom.replace(/[ ]/g, '-'))
parse: bottom => encodeURIComponent(bottom.replace(/ /g, '-'))
}
]
});
+13 -13
View File
@@ -5,37 +5,37 @@ module.exports = class PokemonFusionCommand extends Command {
constructor(client) {
super(client, {
name: 'pokemon-fusion',
aliases: ['poke-fusion', 'poke-fuse'],
aliases: ['poke-fusion', 'poke-fuse', 'pokémon-fusion', 'poké-fusion', 'poké-fuse'],
group: 'image-edit',
memberName: 'pokemon-fusion',
description: 'Fuses two Generation I Pokémon together.',
args: [
{
key: 'source1',
key: 'body',
prompt: 'What Pokémon should be fused?',
type: 'string',
validate: source1 => {
if (pokemon[source1.toLowerCase()]) return true;
return 'Only Pokémon from Generation I may be used.';
validate: body => {
if (pokemon[body.toLowerCase()]) return true;
return 'Invalid body, only Pokémon from Generation I may be used.';
},
parse: source1 => pokemon[source1.toLowerCase()]
parse: body => pokemon[body.toLowerCase()]
},
{
key: 'source2',
key: 'palette',
prompt: 'What Pokémon should be fused?',
type: 'string',
validate: source2 => {
if (pokemon[source2.toLowerCase()]) return true;
return 'Only Pokémon from Generation I may be used.';
validate: palette => {
if (pokemon[palette.toLowerCase()]) return true;
return 'Invalid palette, only Pokémon from Generation I may be used.';
},
parse: source2 => pokemon[source2.toLowerCase()]
parse: palette => pokemon[palette.toLowerCase()]
}
]
});
}
run(msg, args) {
const { source1, source2 } = args;
return msg.say(`http://images.alexonsager.net/pokemon/fused/${source1}/${source1}.${source2}.png`);
const { body, palette } = args;
return msg.say(`http://images.alexonsager.net/pokemon/fused/${body}/${palette}.${body}.png`);
}
};
+1 -1
View File
@@ -26,7 +26,7 @@ module.exports = class BanCommand extends Command {
type: 'string',
validate: reason => {
if (reason.length < 140) return true;
return 'Reason must be under 140 characters.';
return 'Please keep the reason under 140 characters.';
}
}
]
+2 -2
View File
@@ -26,7 +26,7 @@ module.exports = class HackbanCommand extends Command {
type: 'string',
validate: reason => {
if (reason.length < 140) return true;
return 'Reason must be under 140 characters.';
return 'Please keep the reason under 140 characters.';
}
}
]
@@ -40,7 +40,7 @@ module.exports = class HackbanCommand extends Command {
if (id === msg.guild.ownerID) return msg.say('Don\'t you think that might be betraying your leader?');
let user;
try {
user = await this.client.fetchUser(id);
user = await this.client.users.fetch(id);
} catch (err) {
return msg.say('Could not resolve user.');
}
+1 -1
View File
@@ -26,7 +26,7 @@ module.exports = class KickCommand extends Command {
type: 'string',
validate: reason => {
if (reason.length < 140) return true;
return 'Reason must be under 140 characters.';
return 'Please keep the reason under 140 characters.';
}
}
]
+30 -13
View File
@@ -1,5 +1,6 @@
const Command = require('../../structures/Command');
const { stripIndents } = require('common-tags');
const { wait } = require('../../structures/Util');
module.exports = class LockdownCommand extends Command {
constructor(client) {
@@ -13,31 +14,47 @@ module.exports = class LockdownCommand extends Command {
userPermissions: ['ADMINISTRATOR'],
args: [
{
key: 'type',
prompt: 'Please enter either start or stop.',
key: 'action',
prompt: 'What action should be performed? Either start or stop.',
type: 'string',
default: 'start',
validate: type => {
if (['start', 'stop'].includes(type.toLowerCase())) return true;
return 'Please enter either start or stop.';
validate: action => {
if (['start', 'stop'].includes(action.toLowerCase())) return true;
return 'Invalid action, please enter either start or stop.';
},
parse: type => type.toLowerCase()
parse: action => action.toLowerCase()
},
{
key: 'time',
prompt: 'How long should the channel be locked down (in minutes)?',
type: 'integer',
default: '',
validate: time => {
if (time > 0 && time < 11) return true;
return 'Please keep the time under 10 minutes.';
},
parse: time => time * 60000
}
]
});
}
async run(msg, args) { // eslint-disable-line consistent-return
const { type } = args;
if (type === 'start') {
const { action, time } = args;
if (action === 'start') {
await msg.channel.overwritePermissions(msg.guild.defaultRole, { SEND_MESSAGES: false });
return msg.say(stripIndents`
Lockdown Started, users without Administrator can no longer post messages.
Please use \`lockdown stop\` to end the lockdown.
await msg.say(stripIndents`
Lockdown started, users without overwrites can no longer post messages.
${time ? 'Please use `lockdown stop` to end the lockdown.' : `Please wait ${time / 60000} minutes.`}
`);
} else if (type === 'stop') {
if (!time) return null;
await wait(time);
await msg.channel.overwritePermissions(msg.guild.defaultRole, { SEND_MESSAGES: null });
return msg.say('Lockdown Ended.');
return msg.say('Lockdown ended, all users can now post messages.');
}
if (action === 'stop') {
await msg.channel.overwritePermissions(msg.guild.defaultRole, { SEND_MESSAGES: null });
return msg.say('Lockdown ended, all users can now post messages.');
}
}
};
+1 -1
View File
@@ -32,7 +32,7 @@ module.exports = class PruneCommand extends Command {
async run(msg, args) {
const { count } = args;
try {
const messages = await msg.channel.fetchMessages({ limit: count + 1 });
const messages = await msg.channel.messages.fetch({ limit: count + 1 });
await msg.channel.bulkDelete(messages, true);
return null;
} catch (err) {
+1 -1
View File
@@ -26,7 +26,7 @@ module.exports = class SoftbanCommand extends Command {
type: 'string',
validate: reason => {
if (reason.length < 140) return true;
return 'Reason must be under 140 characters.';
return 'Please keep the reason under 140 characters.';
}
}
]
+1 -1
View File
@@ -26,7 +26,7 @@ module.exports = class UnbanCommand extends Command {
type: 'string',
validate: reason => {
if (reason.length < 140) return true;
return 'Reason must be under 140 characters.';
return 'Please keep the reason under 140 characters.';
}
}
]
+1 -1
View File
@@ -25,7 +25,7 @@ module.exports = class WarnCommand extends Command {
type: 'string',
validate: reason => {
if (reason.length < 140) return true;
return 'Invalid Reason. Reason must be under 140 characters.';
return 'Please keep the reason under 140 characters.';
}
}
]
+11 -10
View File
@@ -1,5 +1,6 @@
const Command = require('../../structures/Command');
const snekfetch = require('snekfetch');
const { list } = require('../../structures/Util');
const codes = require('../../assets/json/currency');
module.exports = class CurrencyCommand extends Command {
@@ -17,19 +18,19 @@ module.exports = class CurrencyCommand extends Command {
type: 'string',
validate: base => {
if (codes.includes(base.toUpperCase())) return true;
return 'Invalid Currency Code. Use `help currency` to view a list of currency codes.';
return `Invalid base, please enter either ${list(codes, 'or')}.`;
},
parse: base => base.toUpperCase()
},
{
key: 'to',
key: 'target',
prompt: 'What currency code do you want to convert to?',
type: 'string',
validate: to => {
if (codes.includes(to.toUpperCase())) return true;
return 'Invalid Currency Code. Use `help currency` to view a list of currency codes.';
validate: target => {
if (codes.includes(target.toUpperCase())) return true;
return `Invalid target, please enter either ${list(codes, 'or')}.`;
},
parse: to => to.toUpperCase()
parse: target => target.toUpperCase()
},
{
key: 'amount',
@@ -41,14 +42,14 @@ module.exports = class CurrencyCommand extends Command {
}
async run(msg, args) {
const { base, to, amount } = args;
if (base === to) return msg.say(`Converting ${base} to ${to} is the same value, dummy.`);
const { base, target, amount } = args;
if (base === target) return msg.say(`Converting ${base} to ${target} is the same value, dummy.`);
const { body } = await snekfetch
.get('http://api.fixer.io/latest')
.query({
base,
symbols: to
symbols: target
});
return msg.say(`${amount} ${base} is ${amount * body.rates[to]} ${to}.`);
return msg.say(`${amount} ${base} is ${amount * body.rates[target]} ${target}.`);
}
};
+23 -20
View File
@@ -1,4 +1,6 @@
const Command = require('../../structures/Command');
const { list } = require('../../structures/Util');
const units = ['celsius', 'fahrenheit', 'kelvin'];
module.exports = class TemperatureCommand extends Command {
constructor(client) {
@@ -6,27 +8,27 @@ module.exports = class TemperatureCommand extends Command {
name: 'temperature',
group: 'num-edit',
memberName: 'temperature',
description: 'Converts temperatures to/from Celsius, Fahrenheit, or Kelvin.',
description: `Converts temperatures to/from ${list(units, 'or')}.`,
args: [
{
key: 'base',
prompt: 'What temperature unit do you want to use as the base?',
type: 'string',
validate: base => {
if (['celsius', 'fahrenheit', 'kelvin'].includes(base.toLowerCase())) return true;
return 'Please enter either celsius, fahrenheit, or kelvin.';
if (units.includes(base.toLowerCase())) return true;
return `Invalid base, please enter either ${list(units, 'or')}.`;
},
parse: base => base.toLowerCase()
},
{
key: 'to',
key: 'target',
prompt: 'What temperature unit do you want to convert to?',
type: 'string',
validate: to => {
if (['celsius', 'fahrenheit', 'kelvin'].includes(to.toLowerCase())) return true;
return 'Please enter either celsius, fahrenheit, or kelvin.';
validate: target => {
if (units.includes(target.toLowerCase())) return true;
return `Invalid target, please enter either ${list(units, 'or')}.`;
},
parse: to => to.toLowerCase()
parse: target => target.toLowerCase()
},
{
key: 'amount',
@@ -38,18 +40,19 @@ module.exports = class TemperatureCommand extends Command {
}
run(msg, args) { // eslint-disable-line consistent-return
const { base, to, amount } = args;
if (base === to) {
return msg.say(`Converting ${base} to ${to} is the same value, dummy.`);
} else if (base === 'celsius') {
if (to === 'fahrenheit') return msg.say(`${amount}°C is ${(amount * 1.8) + 32}°F.`);
else if (to === 'kelvin') return msg.say(`${amount}°C is ${amount + 273.15}°K.`);
} else if (base === 'fahrenheit') {
if (to === 'celsius') return msg.say(`${amount}°F is ${(amount - 32) / 1.8}°C.`);
else if (to === 'kelvin') return msg.say(`${amount}°F is ${(amount + 459.67) * (5 / 9)}°K.`);
} else if (base === 'kelvin') {
if (to === 'celsius') return msg.say(`${amount}°K is ${amount - 273.15}°C.`);
else if (to === 'fahrenheit') return msg.say(`${amount}°K is ${(amount * 1.8) - 459.67}°F.`);
const { base, target, amount } = args;
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.`);
if (target === 'kelvin') return msg.say(`${amount}°C is ${amount + 273.15}°K.`);
}
if (base === 'fahrenheit') {
if (target === 'celsius') return msg.say(`${amount}°F is ${(amount - 32) / 1.8}°C.`);
if (target === 'kelvin') return msg.say(`${amount}°F is ${(amount + 459.67) * (5 / 9)}°K.`);
}
if (base === 'kelvin') {
if (target === 'celsius') return msg.say(`${amount}°K is ${amount - 273.15}°C.`);
if (target === 'fahrenheit') return msg.say(`${amount}°K is ${(amount * 1.8) - 459.67}°F.`);
}
}
};
+1 -1
View File
@@ -1,6 +1,6 @@
const Command = require('../../structures/Command');
const { stripIndents } = require('common-tags');
const answers = require('../../assets/json/magic-conch');
const answers = ['Maybe someday', 'Nothing', 'Neither', 'I don\'t think so', 'Yes', 'Try asking again'];
module.exports = class MagicConchCommand extends Command {
constructor(client) {
+5 -3
View File
@@ -1,5 +1,7 @@
const Command = require('../../structures/Command');
const snekfetch = require('snekfetch');
const { list } = require('../../structures/Util');
const genders = ['male', 'female', 'both'];
module.exports = class NameCommand extends Command {
constructor(client) {
@@ -11,12 +13,12 @@ module.exports = class NameCommand extends Command {
args: [
{
key: 'gender',
prompt: 'Which gender do you want to generate a name for?',
prompt: `Which gender do you want to generate a name for? Either ${list(genders, 'or')}.`,
type: 'string',
default: 'both',
validate: gender => {
if (['male', 'female', 'both'].includes(gender.toLowerCase())) return true;
return 'Please enter either male, female, or both.';
if (genders.includes(gender.toLowerCase())) return true;
return `Invalid gender, please enter either ${list(genders, 'or')}.`;
},
parse: gender => gender.toLowerCase()
}
+1 -1
View File
@@ -38,7 +38,7 @@ module.exports = class TodayCommand extends Command {
.setDescription(`${event.year}: ${event.text}`);
return msg.embed(embed);
} catch (err) {
if (err.status === 404 || err.status === 500) return msg.say('Invalid Date.');
if (err.status === 404 || err.status === 500) return msg.say('Invalid date.');
throw err;
}
}
+3 -2
View File
@@ -1,6 +1,7 @@
const Command = require('../../structures/Command');
const { MessageEmbed } = require('discord.js');
const snekfetch = require('snekfetch');
const { list } = require('../../structures/Util');
const signs = require('../../assets/json/horoscope');
module.exports = class HoroscopeCommand extends Command {
@@ -15,11 +16,11 @@ module.exports = class HoroscopeCommand extends Command {
args: [
{
key: 'sign',
prompt: 'Which sign would you like to get the horoscope for?',
prompt: `Which sign would you like to get the horoscope for? Either ${list(signs, 'or')}.`,
type: 'string',
validate: sign => {
if (signs.includes(sign.toLowerCase())) return true;
return 'Invalid sign. Use `help horoscope` for a list of signs.';
return `Invalid sign, please enter either ${list(signs, 'or')}.`;
},
parse: sign => sign.toLowerCase()
}
+6 -6
View File
@@ -1,6 +1,7 @@
const Command = require('../../structures/Command');
const sounds = require('../../assets/json/soundboard');
const { list } = require('../../structures/Util');
const path = require('path');
const sounds = ['airhorn', 'cat', 'dun-dun-dun', 'pikachu', 'space'];
module.exports = class SoundboardCommand extends Command {
constructor(client) {
@@ -20,14 +21,13 @@ module.exports = class SoundboardCommand extends Command {
args: [
{
key: 'sound',
prompt: 'What sound would you like to play?',
prompt: `What sound would you like to play? Either ${list(sounds, 'or')}.`,
type: 'string',
default: sounds[Math.floor(Math.random() * sounds.length)],
validate: sound => {
if (sounds.includes(sound.toLowerCase())) return true;
return 'Invalid Sound. Use `help soundboard` for a list of sounds.';
return `Invalid sound, please enter either ${list(sounds, 'or')}.`;
},
parse: sound => path.join(__dirname, '..', '..', 'assets', 'sounds', `${sound.toLowerCase()}.mp3`)
parse: sound => sound.toLowerCase()
}
]
});
@@ -44,7 +44,7 @@ module.exports = class SoundboardCommand extends Command {
if (this.client.voiceConnections.has(channel.guild.id)) return msg.say('I am already playing a sound.');
const connection = await channel.join();
await msg.react('🔊');
const dispatcher = connection.playFile(sound, { volume: 0.25 });
const dispatcher = connection.playFile(path.join(__dirname, '..', '..', 'assets', 'sounds', `${sound}.mp3`));
dispatcher.once('end', () => {
channel.leave();
msg.react('✅');
+6 -5
View File
@@ -6,6 +6,7 @@ module.exports = class StrawpollCommand extends Command {
constructor(client) {
super(client, {
name: 'strawpoll',
aliases: ['poll'],
group: 'random',
memberName: 'strawpoll',
description: 'Creates a Strawpoll from the options you provide.',
@@ -16,7 +17,7 @@ module.exports = class StrawpollCommand extends Command {
type: 'string',
validate: title => {
if (title.length < 200) return true;
return 'Title must be under 200 characters.';
return 'Please keep the title under 200 characters.';
}
},
{
@@ -26,7 +27,7 @@ module.exports = class StrawpollCommand extends Command {
infinite: true,
validate: choice => {
if (choice.length < 140) return true;
return 'Choices must be under 140 characters each.';
return 'Please keep choices under 140 characters each.';
}
}
]
@@ -35,14 +36,14 @@ module.exports = class StrawpollCommand extends Command {
async run(msg, args) {
const { title, options } = args;
if (options.length < 2) return msg.say('You provided less than two choices.');
if (options.length > 31) return msg.say('You provided more than thirty choices.');
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.');
const { body } = await snekfetch
.post('https://strawpoll.me/api/v2/polls')
.send({ title, options });
return msg.say(stripIndents`
${body.title}
http://strawpoll.me/${body.id}
http://www.strawpoll.me/${body.id}
`);
}
};
+13 -13
View File
@@ -35,7 +35,8 @@ module.exports = class XKCDCommand extends Command {
.setImage(current.body.img)
.setFooter(current.body.alt);
return msg.embed(embed);
} else if (type === 'random') {
}
if (type === 'random') {
const random = Math.floor(Math.random() * current.body.num) + 1;
const { body } = await snekfetch
.get(`https://xkcd.com/${random}/info.0.json`);
@@ -46,18 +47,17 @@ module.exports = class XKCDCommand extends Command {
.setImage(body.img)
.setFooter(body.alt);
return msg.embed(embed);
} else {
const choice = parseInt(type, 10);
if (isNaN(choice) || current.body.num < choice || choice < 1) return msg.say('Invalid Number.');
const { body } = await snekfetch
.get(`https://xkcd.com/${choice}/info.0.json`);
const embed = new MessageEmbed()
.setTitle(`${body.num} - ${body.title}`)
.setColor(0x9797FF)
.setURL(`https://xkcd.com/${body.num}`)
.setImage(body.img)
.setFooter(body.alt);
return msg.embed(embed);
}
const choice = parseInt(type, 10);
if (isNaN(choice) || current.body.num < choice || choice < 1) return msg.say('Invalid number.');
const { body } = await snekfetch
.get(`https://xkcd.com/${choice}/info.0.json`);
const embed = new MessageEmbed()
.setTitle(`${body.num} - ${body.title}`)
.setColor(0x9797FF)
.setURL(`https://xkcd.com/${body.num}`)
.setImage(body.img)
.setFooter(body.alt);
return msg.embed(embed);
}
};
+1 -1
View File
@@ -49,7 +49,7 @@ module.exports = class AnimeCommand extends Command {
anime.entry[0].end_date[0], true);
return msg.embed(embed);
} catch (err) {
if (err.message === 'Parse Error') return msg.say('No Results.');
if (err.message === 'Parse Error') return msg.say('Could not find any results.');
throw err;
}
}
+3 -3
View File
@@ -9,12 +9,12 @@ module.exports = class BotSearchCommand extends Command {
name: 'bot-info',
group: 'search',
memberName: 'bot-info',
description: 'Searches Discord Bots for info on a bot.',
description: 'Searches Discord Bots for information on a bot.',
clientPermissions: ['EMBED_LINKS'],
args: [
{
key: 'bot',
prompt: 'Which bot do you want to get information for?',
prompt: 'Which bot do you want to get information on?',
type: 'user'
}
]
@@ -41,7 +41,7 @@ module.exports = class BotSearchCommand extends Command {
body.prefix, true);
return msg.embed(embed);
} catch (err) {
if (err.status === 404) return msg.say('Bot Not Found.');
if (err.status === 404) return msg.say('Could not find any results.');
throw err;
}
}
+2 -2
View File
@@ -15,7 +15,7 @@ module.exports = class BulbapediaCommand extends Command {
args: [
{
key: 'query',
prompt: 'What would you like to search for?',
prompt: 'What article would you like to search for?',
type: 'string'
}
]
@@ -36,7 +36,7 @@ module.exports = class BulbapediaCommand extends Command {
redirects: '',
formatversion: 2
});
if (body.query.pages[0].missing) return msg.say('No Results.');
if (body.query.pages[0].missing) return msg.say('Could not find any results.');
const embed = new MessageEmbed()
.setColor(0x3E7614)
.setTitle(body.query.pages[0].title)
+1 -1
View File
@@ -32,7 +32,7 @@ module.exports = class DefineCommand extends Command {
useCanonical: false,
api_key: WORDNIK_KEY
});
if (!body.length) return msg.say('No Results.');
if (!body.length) return msg.say('Could not find any results.');
const embed = new MessageEmbed()
.setColor(0x9797FF)
.setTitle(body[0].word)
+1 -1
View File
@@ -29,7 +29,7 @@ module.exports = class DiscrimCommand extends Command {
const discrim = args.discrim || msg.author.discriminator;
const users = this.client.users.filter(user => user.discriminator === discrim).map(user => user.username);
const embed = new MessageEmbed()
.setTitle(`${users.length} Users with the discriminator: ${discrim}`)
.setTitle(`${users.length} Users with the discriminator #${discrim}`)
.setColor(0x9797FF)
.setDescription(users.join(', '));
return msg.embed(embed);
+1 -1
View File
@@ -29,7 +29,7 @@ module.exports = class ForecastCommand extends Command {
q: `select * from weather.forecast where u='f' AND woeid in (select woeid from geo.places(1) where text="${query}")`, // eslint-disable-line max-len
format: 'json'
});
if (!body.query.count) return msg.say('Location Not Found.');
if (!body.query.count) return msg.say('Could not find any results.');
const forecasts = body.query.results.channel.item.forecast;
const embed = new MessageEmbed()
.setColor(0x0000FF)
+1 -1
View File
@@ -12,7 +12,7 @@ module.exports = class GiphyCommand extends Command {
args: [
{
key: 'query',
prompt: 'What would you like to search for?',
prompt: 'What GIF would you like to search for?',
type: 'string'
}
]
+4 -4
View File
@@ -10,7 +10,7 @@ module.exports = class GitHubCommand extends Command {
name: 'github',
group: 'search',
memberName: 'github',
description: 'Searches GitHub for info on a GitHub repository.',
description: 'Searches GitHub for information on a repository.',
clientPermissions: ['EMBED_LINKS'],
args: [
{
@@ -20,7 +20,7 @@ module.exports = class GitHubCommand extends Command {
},
{
key: 'repository',
prompt: 'What is the name of the repository you would like to get information for?',
prompt: 'What is the name of the repository?',
type: 'string'
}
]
@@ -37,7 +37,7 @@ module.exports = class GitHubCommand extends Command {
.setAuthor('GitHub', 'https://i.imgur.com/bRROLzk.png')
.setTitle(body.full_name)
.setURL(body.html_url)
.setDescription(body.description || 'No Description.')
.setDescription(body.description || 'No description.')
.setThumbnail(body.owner.avatar_url || null)
.addField(' Stars',
body.stargazers_count, true)
@@ -53,7 +53,7 @@ module.exports = class GitHubCommand extends Command {
moment(body.updated_at).format('MMMM Do YYYY'), true);
return msg.embed(embed);
} catch (err) {
if (err.status === 404) return msg.say('Not Found.');
if (err.status === 404) return msg.say('Could not find the repository.');
throw err;
}
}
+1 -1
View File
@@ -49,7 +49,7 @@ module.exports = class MangaCommand extends Command {
manga.entry[0].end_date[0], true);
return msg.embed(embed);
} catch (err) {
if (err.message === 'Parse Error') return msg.say('No Results.');
if (err.message === 'Parse Error') return msg.say('Could not find any results.');
throw err;
}
}
+3 -3
View File
@@ -14,16 +14,16 @@ module.exports = class MapCommand extends Command {
{
key: 'zoom',
label: 'zoom level',
prompt: 'What would you like the zoom level for the map to be? Limit 1-20.',
prompt: 'What would you like the zoom level to be? Must be a number from 1-20.',
type: 'integer',
validate: zoom => {
if (zoom < 21 && zoom > 0) return true;
return 'Please enter a zoom value from 1-20';
return 'Please enter a zoom value from 1-20.';
}
},
{
key: 'query',
prompt: 'What location you like to get a map image for?',
prompt: 'What location would you like to get a map of?',
type: 'string'
}
]
+2 -2
View File
@@ -16,7 +16,7 @@ module.exports = class MovieCommand extends Command {
args: [
{
key: 'query',
prompt: 'What would you like to search for?',
prompt: 'What movie would you like to search for?',
type: 'string'
}
]
@@ -32,7 +32,7 @@ module.exports = class MovieCommand extends Command {
include_adult: msg.channel.nsfw || false,
query
});
if (!search.body.results.length) return msg.say('No Results.');
if (!search.body.results.length) return msg.say('Could not find any results.');
const { body } = await snekfetch
.get(`https://api.themoviedb.org/3/movie/${search.body.results[0].id}`)
.query({ api_key: TMDB_KEY });
+2 -2
View File
@@ -11,7 +11,7 @@ module.exports = class NeopetCommand extends Command {
args: [
{
key: 'query',
prompt: 'What pet would you like to get the image of?',
prompt: 'What pet would you like to get an image of?',
type: 'string'
}
]
@@ -28,7 +28,7 @@ module.exports = class NeopetCommand extends Command {
mood: 1
});
const link = text.match(/http:\/\/pets\.neopets\.com\/cp\/.+\.png/);
if (!link) return msg.say('Invalid Pet Name.');
if (!link) return msg.say('Could not find any results.');
return msg.say(link[0]);
}
};
+2 -2
View File
@@ -15,7 +15,7 @@ module.exports = class NPMCommand extends Command {
args: [
{
key: 'query',
prompt: 'What package do you want to get information for?',
prompt: 'What package would you like to search for?',
type: 'string'
}
]
@@ -51,7 +51,7 @@ module.exports = class NPMCommand extends Command {
body.maintainers.map(user => user.name).join(', '));
return msg.embed(embed);
} catch (err) {
if (err.status === 404) return msg.say('Not Found.');
if (err.status === 404) return msg.say('Could not find any results.');
throw err;
}
}
+11 -11
View File
@@ -14,7 +14,7 @@ module.exports = class OsuCommand extends Command {
args: [
{
key: 'query',
prompt: 'What osu username would you like to search for?',
prompt: 'What user would you like to get information on?',
type: 'string'
}
]
@@ -30,7 +30,7 @@ module.exports = class OsuCommand extends Command {
u: query,
type: 'string'
});
if (!body.length) return msg.say('No Results.');
if (!body.length) return msg.say('Could not find any results.');
const embed = new MessageEmbed()
.setColor(0xFF66AA)
.setAuthor('osu!', 'https://i.imgur.com/EmnUp00.png')
@@ -40,25 +40,25 @@ module.exports = class OsuCommand extends Command {
.addField(' ID',
body[0].user_id, true)
.addField(' Level',
body[0].level, true)
body[0].level || 'N/A', true)
.addField(' Accuracy',
body[0].accuracy, true)
body[0].accuracy || 'N/A', true)
.addField(' Rank',
body[0].pp_rank, true)
body[0].pp_rank || 'N/A', true)
.addField(' Play Count',
body[0].playcount, true)
body[0].playcount || 'N/A', true)
.addField(' Country',
body[0].country || 'N/A', true)
.addField(' Ranked Score',
body[0].ranked_score, true)
body[0].ranked_score || 'N/A', true)
.addField(' Total Score',
body[0].total_score, true)
body[0].total_score || 'N/A', true)
.addField(' SS',
body[0].count_rank_ss, true)
body[0].count_rank_ss || 'N/A', true)
.addField(' S',
body[0].count_rank_s, true)
body[0].count_rank_s || 'N/A', true)
.addField(' A',
body[0].count_rank_a, true);
body[0].count_rank_a || 'N/A', true);
return msg.embed(embed);
}
};
+3 -3
View File
@@ -16,9 +16,9 @@ module.exports = class PokedexCommand extends Command {
args: [
{
key: 'pokemon',
prompt: 'What Pokémon would you like to search for?',
prompt: 'What Pokémon would you like to get information on?',
type: 'string',
parse: pokemon => pokemon.toLowerCase().replace(/[ ]/g, '-')
parse: pokemon => pokemon.toLowerCase().replace(/ /g, '-')
}
]
});
@@ -41,7 +41,7 @@ module.exports = class PokedexCommand extends Command {
.setThumbnail(`https://www.serebii.net/sunmoon/pokemon/${id}.png`);
return msg.embed(embed);
} catch (err) {
if (err.status === 404) return msg.say('Pokémon Not Found.');
if (err.status === 404) return msg.say('Could not find any results.');
throw err;
}
}
+3 -3
View File
@@ -13,7 +13,7 @@ module.exports = class RecipeCommand extends Command {
args: [
{
key: 'query',
prompt: 'What would you like to search for?',
prompt: 'What recipe would you like to search for?',
type: 'string'
}
]
@@ -27,7 +27,7 @@ module.exports = class RecipeCommand extends Command {
.get('http://www.recipepuppy.com/api/')
.query({ q: query });
const body = JSON.parse(text);
if (!body.results.length) return msg.say('No Results.');
if (!body.results.length) return msg.say('Could not find any results.');
const recipe = body.results[Math.floor(Math.random() * body.results.length)];
const embed = new MessageEmbed()
.setColor(0xC20000)
@@ -37,7 +37,7 @@ module.exports = class RecipeCommand extends Command {
.setThumbnail(recipe.thumbnail);
return msg.embed(embed);
} catch (err) {
return msg.say('No Results.');
return msg.say('Could not find any results.');
}
}
};
+5 -5
View File
@@ -13,7 +13,7 @@ module.exports = class RedditCommand extends Command {
args: [
{
key: 'subreddit',
prompt: 'What subreddit would you like to get data for?',
prompt: 'What subreddit would you like to get a post from?',
type: 'string'
}
]
@@ -26,10 +26,10 @@ module.exports = class RedditCommand extends Command {
const { body } = await snekfetch
.get(`https://www.reddit.com/r/${subreddit}/new.json`)
.query({ sort: 'new' });
if (!body.data.children.length) return msg.say('Subreddit Not Found.');
if (!body.data.children.length) return msg.say('Could not find any results.');
const post = body.data.children[Math.floor(Math.random() * body.data.children.length)];
if (!post.data) return msg.say('This post has no data, try again!');
if (!msg.channel.nsfw && post.data.over_18) return msg.say('This post is only viewable in NSFW Channels.');
if (!msg.channel.nsfw && post.data.over_18) return msg.say('This post is only viewable in NSFW channels.');
const embed = new MessageEmbed()
.setColor(0xFF4500)
.setAuthor('Reddit', 'https://i.imgur.com/V6hXniU.png')
@@ -45,8 +45,8 @@ module.exports = class RedditCommand extends Command {
post.data.score, true);
return msg.embed(embed);
} catch (err) {
if (err.status === 403) return msg.say('This Subreddit is Private.');
if (err.status === 404) return msg.say('Subreddit Not Found.');
if (err.status === 403) return msg.say('This subreddit is private.');
if (err.status === 404) return msg.say('Could not find the subreddit.');
throw err;
}
}
+1 -1
View File
@@ -14,7 +14,7 @@ module.exports = class SoundCloudCommand extends Command {
args: [
{
key: 'query',
prompt: 'What do you want to search SoundCloud for?',
prompt: 'What song would you like to search for?',
type: 'string'
}
]
+1 -1
View File
@@ -29,7 +29,7 @@ module.exports = class SteamCommand extends Command {
l: 'en',
term: query
});
if (!body.total) return msg.say('No Results.');
if (!body.total) return msg.say('Could not find any results.');
const current = body.items[0].price ? body.items[0].price.final / 100 : 0.00;
const original = body.items[0].price ? body.items[0].price.initial / 100 : 0.00;
const price = current === original ? `$${current}` : `~~$${original}~~ $${current}`;
+2 -2
View File
@@ -16,7 +16,7 @@ module.exports = class TVShowCommand extends Command {
args: [
{
key: 'query',
prompt: 'What would you like to search for?',
prompt: 'What TV show would you like to search for?',
type: 'string'
}
]
@@ -32,7 +32,7 @@ module.exports = class TVShowCommand extends Command {
include_adult: msg.channel.nsfw || false,
query
});
if (!search.body.results.length) return msg.say('No Results.');
if (!search.body.results.length) return msg.say('Could not find any results.');
const { body } = await snekfetch
.get(`https://api.themoviedb.org/3/tv/${search.body.results[0].id}`)
.query({ api_key: TMDB_KEY });
+1 -1
View File
@@ -26,7 +26,7 @@ module.exports = class UrbanCommand extends Command {
const { body } = await snekfetch
.get('http://api.urbandictionary.com/v0/define')
.query({ term: query });
if (!body.list.length) return msg.say('No Results.');
if (!body.list.length) return msg.say('Could not find any results.');
const embed = new MessageEmbed()
.setColor(0x32A8F0)
.setAuthor('Urban Dictionary', 'https://i.imgur.com/fzFuuL7.png')
+1 -1
View File
@@ -35,7 +35,7 @@ module.exports = class VocaloidCommand extends Command {
nameMatchMode: 'Words',
fields: 'ThumbUrl,Lyrics'
});
if (!body.totalCount) return msg.say('No Results.');
if (!body.totalCount) return msg.say('Could not find any results.');
const embed = new MessageEmbed()
.setColor(0x86D2D0)
.setAuthor('VocaDB', 'https://i.imgur.com/9Tx9UIc.jpg')
+1 -1
View File
@@ -32,7 +32,7 @@ module.exports = class WattpadCommand extends Command {
limit: 1
})
.set({ Authorization: `Basic ${WATTPAD_KEY}` });
if (!body.stories.length) return msg.say('No Results.');
if (!body.stories.length) return msg.say('Could not find any results.');
const embed = new MessageEmbed()
.setColor(0xF89C34)
.setAuthor('Wattpad', 'https://i.imgur.com/Rw9vRQB.png')
+2 -2
View File
@@ -13,7 +13,7 @@ module.exports = class WeatherCommand extends Command {
args: [
{
key: 'query',
prompt: 'What location would you like to get the current weather for?',
prompt: 'What location would you like to get the weather of?',
type: 'string'
}
]
@@ -28,7 +28,7 @@ module.exports = class WeatherCommand extends Command {
q: `select * from weather.forecast where u='f' AND woeid in (select woeid from geo.places(1) where text="${query}")`, // eslint-disable-line max-len
format: 'json'
});
if (!body.query.count) return msg.say('Location Not Found.');
if (!body.query.count) return msg.say('Could not find any results.');
const embed = new MessageEmbed()
.setColor(0x0000FF)
.setAuthor(body.query.results.channel.title, 'https://i.imgur.com/2MT0ViC.png')
+3 -3
View File
@@ -15,12 +15,12 @@ module.exports = class WikiaCommand extends Command {
args: [
{
key: 'wiki',
prompt: 'What is the subdomain of the wikia you want to search?',
prompt: 'What is the subdomain of the wiki you want to search?',
type: 'string'
},
{
key: 'query',
prompt: 'What would you like to search for?',
prompt: 'What article would you like to search for?',
type: 'string'
}
]
@@ -49,7 +49,7 @@ module.exports = class WikiaCommand extends Command {
.setThumbnail(body.sections[0].images.length ? body.sections[0].images[0].src : null);
return msg.embed(embed);
} catch (err) {
return msg.say('No Results or Invalid Wiki.');
return msg.say('Could not find any results.');
}
}
};
+2 -2
View File
@@ -14,7 +14,7 @@ module.exports = class WikipediaCommand extends Command {
args: [
{
key: 'query',
prompt: 'What would you like to search for?',
prompt: 'What article would you like to search for?',
type: 'string'
}
]
@@ -35,7 +35,7 @@ module.exports = class WikipediaCommand extends Command {
redirects: '',
formatversion: 2
});
if (body.query.pages[0].missing) return msg.say('No Results.');
if (body.query.pages[0].missing) return msg.say('Could not find any results.');
const embed = new MessageEmbed()
.setColor(0xE7E7E7)
.setTitle(body.query.pages[0].title)
+2 -2
View File
@@ -14,7 +14,7 @@ module.exports = class YouTubeCommand extends Command {
args: [
{
key: 'query',
prompt: 'What would you like to search for?',
prompt: 'What video would you like to search for?',
type: 'string'
}
]
@@ -32,7 +32,7 @@ module.exports = class YouTubeCommand extends Command {
q: query,
key: GOOGLE_KEY
});
if (!body.items.length) return msg.say('No Results.');
if (!body.items.length) return msg.say('Could not find any results.');
const embed = new MessageEmbed()
.setColor(0xDD2825)
.setTitle(body.items[0].snippet.title)
+2 -2
View File
@@ -13,7 +13,7 @@ module.exports = class YuGiOhCommand extends Command {
args: [
{
key: 'query',
prompt: 'What card would you like to get data for?',
prompt: 'What card would you like to get information on?',
type: 'string',
parse: text => encodeURIComponent(text)
}
@@ -25,7 +25,7 @@ module.exports = class YuGiOhCommand extends Command {
const { query } = args;
const { body } = await snekfetch
.get(`http://yugiohprices.com/api/card_data/${query}`);
if (body.status === 'fail') return msg.say('No Results.');
if (body.status === 'fail') return msg.say('Could not find any results.');
const embed = new MessageEmbed()
.setColor(0xBE5F1F)
.setTitle(body.data.name)
+4 -7
View File
@@ -27,12 +27,9 @@ module.exports = class BinaryCommand extends Command {
}
binary(text) {
return unescape(encodeURIComponent(text))
.split('')
.map(str => {
const converted = str.charCodeAt(0).toString(2);
return `${'00000000'.slice(converted.length)}${converted}`;
})
.join('');
return text.split('').map(str => {
const converted = str.charCodeAt(0).toString(2);
return `${'00000000'.slice(converted.length)}${converted}`;
}).join('');
}
};
+1 -1
View File
@@ -7,7 +7,7 @@ module.exports = class CowsayCommand extends Command {
name: 'cow-say',
group: 'text-edit',
memberName: 'cow-say',
description: 'Converts text to cowsay.',
description: 'Converts text to cow-say.',
args: [
{
key: 'text',
+2 -3
View File
@@ -8,7 +8,6 @@ module.exports = class SayCommand extends Command {
group: 'text-edit',
memberName: 'say',
description: 'Make XiaoBot say what you wish.',
guildOnly: true,
args: [
{
key: 'text',
@@ -19,9 +18,9 @@ module.exports = class SayCommand extends Command {
});
}
run(msg, args) {
async run(msg, args) {
const { text } = args;
if (msg.channel.permissionsFor(this.client.user).has('MANAGE_MESSAGES')) msg.delete();
if (msg.guild && msg.channel.permissionsFor(this.client.user).has('MANAGE_MESSAGES')) await msg.delete();
return msg.say(text);
}
};
+17 -16
View File
@@ -1,6 +1,7 @@
const Command = require('../../structures/Command');
const { MessageEmbed } = require('discord.js');
const snekfetch = require('snekfetch');
const { list } = require('../../structures/Util');
const codes = require('../../assets/json/translate');
const { YANDEX_KEY } = process.env;
@@ -11,7 +12,7 @@ module.exports = class TranslateCommand extends Command {
group: 'text-edit',
memberName: 'translate',
description: 'Translates text to a specified language.',
details: '**Codes:** https://tech.yandex.com/translate/doc/dg/concepts/api-overview-docpage/#languages',
details: `**Codes:** ${Object.keys(codes).join(', ')}`,
clientPermissions: ['EMBED_LINKS'],
args: [
{
@@ -20,42 +21,42 @@ module.exports = class TranslateCommand extends Command {
type: 'string',
validate: text => {
if (text.length < 500) return true;
return 'Text must be under 500 characters.';
return 'Please keep text under 500 characters.';
}
},
{
key: 'to',
prompt: 'Which language is being translated to?',
key: 'target',
prompt: 'Which language would you like to translate to?',
type: 'string',
validate: to => {
if (codes[to.toLowerCase()]) return true;
return 'Invalid Language Code. Use `help translate` for a list of codes.';
validate: target => {
if (codes[target.toLowerCase()]) return true;
return `Invalid target, please enter either ${list(Object.keys(codes), 'or')}.`;
},
parse: to => to.toLowerCase()
parse: target => target.toLowerCase()
},
{
key: 'from',
prompt: 'Which language is being translated from?',
key: 'original',
prompt: 'Which language is your text in?',
type: 'string',
default: '',
validate: from => {
if (codes[from.toLowerCase()]) return true;
return 'Invalid Language Code. Use `help translate` for a list of codes.';
validate: original => {
if (codes[original.toLowerCase()]) return true;
return `Invalid original, please enter either ${list(Object.keys(codes), 'or')}.`;
},
parse: from => from.toLowerCase()
parse: original => original.toLowerCase()
}
]
});
}
async run(msg, args) {
const { text, to, from } = args;
const { text, target, original } = args;
const { body } = await snekfetch
.get('https://translate.yandex.net/api/v1.5/tr.json/translate')
.query({
key: YANDEX_KEY,
text,
lang: from ? `${from}-${to}` : to
lang: original ? `${original}-${target}` : target
});
const lang = body.lang.split('-');
const embed = new MessageEmbed()
+1 -3
View File
@@ -10,9 +10,7 @@ module.exports = class WebhookCommand extends Command {
group: 'text-edit',
memberName: 'webhook',
description: 'Posts a message to the webhook defined in your `process.env`.',
guildOnly: true,
ownerOnly: true,
clientPermissions: ['MANAGE_MESSAGES'],
args: [
{
key: 'content',
@@ -25,7 +23,7 @@ module.exports = class WebhookCommand extends Command {
async run(msg, args) {
const { content } = args;
msg.delete();
if (msg.guild && msg.channel.permissionsFor(this.client.user).has('MANAGE_MESSAGES')) await msg.delete();
await snekfetch
.post(WEBHOOK_URL)
.send({ content });
+1 -1
View File
@@ -17,7 +17,7 @@ module.exports = class YodaCommand extends Command {
type: 'string',
validate: sentence => {
if (sentence.length < 500) return true;
return 'Text must be under 500 characters.';
return 'Please keep text under 500 characters.';
}
}
]
+2 -2
View File
@@ -7,7 +7,7 @@ module.exports = class ZalgoCommand extends Command {
name: 'zalgo',
group: 'text-edit',
memberName: 'zalgo',
description: 'Converts text to Zalgo.',
description: 'Converts text to zalgo.',
args: [
{
key: 'text',
@@ -15,7 +15,7 @@ module.exports = class ZalgoCommand extends Command {
type: 'string',
validate: text => {
if (text.length < 500) return true;
return 'Text must be under 500 characters.';
return 'Please keep text under 500 characters.';
}
}
]
+9 -4
View File
@@ -1,7 +1,12 @@
const Command = require('../../structures/Command');
const { MessageEmbed } = require('discord.js');
const moment = require('moment');
const statuses = require('../../assets/json/user-info');
const statuses = {
online: '<:online:313956277808005120> Online',
idle: '<:away:313956277220802560> Idle',
dnd: '<:dnd:313956276893646850> Do Not Disturb',
offline: '<:offline:313956277237710868> Offline'
};
module.exports = class UserInfoCommand extends Command {
constructor(client) {
@@ -16,7 +21,7 @@ module.exports = class UserInfoCommand extends Command {
args: [
{
key: 'member',
prompt: 'Which user would you like to get info on?',
prompt: 'Which user would you like to get information on?',
type: 'member',
default: ''
}
@@ -38,9 +43,9 @@ module.exports = class UserInfoCommand extends Command {
.addField(' Server Join Date',
moment(member.joinedTimestamp).format('MMMM Do YYYY'), true)
.addField(' Status',
statuses[member.user.presence.status], true)
statuses[member.presence.status], true)
.addField(' Playing',
member.user.presence.game ? member.user.presence.game.name : 'N/A', true)
member.presence.game ? member.presence.game.name : 'N/A', true)
.addField(' Highest Role',
member.highestRole.name !== '@everyone' ? member.highestRole.name : 'None', true)
.addField(' Hoist Role',
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiaobot",
"version": "31.1.4",
"version": "31.5.0",
"description": "Your personal server companion.",
"main": "Shard.js",
"scripts": {
+2 -2
View File
@@ -22,14 +22,14 @@ class XiaoCommand extends Command {
if (this.clientPermissions) {
for (const permission of this.clientPermissions) {
if (!msg.channel.permissionsFor(this.client.user).has(permission)) {
return `The \`${this.name}\` command requires me to have the \`${perms[permission]}\` Permission.`;
return `The \`${this.name}\` command requires me to have the \`${perms[permission]}\` permission.`;
}
}
}
if (this.userPermissions) {
for (const permission of this.userPermissions) {
if (!msg.channel.permissionsFor(msg.author).has(permission)) {
return `The \`${this.name}\` command requires you to have the \`${perms[permission]}\` Permission.`;
return `The \`${this.name}\` command requires you to have the \`${perms[permission]}\` permission.`;
}
}
}