The Power of const

This commit is contained in:
Daniel Odendahl Jr
2017-04-03 22:31:19 +00:00
parent 4f0f1b4ad2
commit 76907549df
87 changed files with 525 additions and 558 deletions
+2 -2
View File
@@ -25,14 +25,14 @@ module.exports = class YearsCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let user = args.user; const user = args.user;
let userAvatar = user.displayAvatarURL; let userAvatar = user.displayAvatarURL;
userAvatar = userAvatar.replace(".jpg", ".png"); userAvatar = userAvatar.replace(".jpg", ".png");
userAvatar = userAvatar.replace(".gif", ".png"); userAvatar = userAvatar.replace(".gif", ".png");
let images = []; let images = [];
images.push(Jimp.read(userAvatar)); images.push(Jimp.read(userAvatar));
images.push(Jimp.read("./images/3000years.png")); images.push(Jimp.read("./images/3000years.png"));
let [avatar, years] = await Promise.all(images); const [avatar, years] = await Promise.all(images);
avatar.resize(200, 200); avatar.resize(200, 200);
years.blit(avatar, 461, 127); years.blit(avatar, 461, 127);
years.getBuffer(Jimp.MIME_PNG, (err, buff) => { years.getBuffer(Jimp.MIME_PNG, (err, buff) => {
+2 -2
View File
@@ -25,14 +25,14 @@ module.exports = class BeautifulCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let user = args.user; const user = args.user;
let userAvatar = user.displayAvatarURL; let userAvatar = user.displayAvatarURL;
userAvatar = userAvatar.replace(".jpg", ".png"); userAvatar = userAvatar.replace(".jpg", ".png");
userAvatar = userAvatar.replace(".gif", ".png"); userAvatar = userAvatar.replace(".gif", ".png");
let images = []; let images = [];
images.push(Jimp.read(userAvatar)); images.push(Jimp.read(userAvatar));
images.push(Jimp.read("./images/beautiful.jpg")); images.push(Jimp.read("./images/beautiful.jpg"));
let [avatar, beautiful] = await Promise.all(images); const [avatar, beautiful] = await Promise.all(images);
avatar.resize(200, 200); avatar.resize(200, 200);
beautiful.blit(avatar, 432, 42); beautiful.blit(avatar, 432, 42);
avatar.resize(190, 190); avatar.resize(190, 190);
+2 -2
View File
@@ -26,7 +26,7 @@ module.exports = class BobRossCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let user = args.user; const user = args.user;
let userAvatar = user.displayAvatarURL; let userAvatar = user.displayAvatarURL;
userAvatar = userAvatar.replace(".jpg", ".png"); userAvatar = userAvatar.replace(".jpg", ".png");
userAvatar = userAvatar.replace(".gif", ".png"); userAvatar = userAvatar.replace(".gif", ".png");
@@ -34,7 +34,7 @@ module.exports = class BobRossCommand extends commando.Command {
images.push(Jimp.read(userAvatar)); images.push(Jimp.read(userAvatar));
images.push(Jimp.read("./images/BobRoss.png")); images.push(Jimp.read("./images/BobRoss.png"));
images.push(Jimp.read("./images/BlankWhite.png")); images.push(Jimp.read("./images/BlankWhite.png"));
let [avatar, bob, nothing] = await Promise.all(images); const [avatar, bob, nothing] = await Promise.all(images);
avatar.rotate(2); avatar.rotate(2);
avatar.resize(300, 300); avatar.resize(300, 300);
nothing.composite(avatar, 44, 85); nothing.composite(avatar, 44, 85);
+2 -2
View File
@@ -26,14 +26,14 @@ module.exports = class RIPCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let user = args.user; const user = args.user;
let userAvatar = user.displayAvatarURL; let userAvatar = user.displayAvatarURL;
userAvatar = userAvatar.replace(".jpg", ".png"); userAvatar = userAvatar.replace(".jpg", ".png");
userAvatar = userAvatar.replace(".gif", ".png"); userAvatar = userAvatar.replace(".gif", ".png");
let images = []; let images = [];
images.push(Jimp.read(userAvatar)); images.push(Jimp.read(userAvatar));
images.push(Jimp.read("./images/gravestone.jpg")); images.push(Jimp.read("./images/gravestone.jpg"));
let [avatar, gravestone] = await Promise.all(images); const [avatar, gravestone] = await Promise.all(images);
avatar.resize(200, 200); avatar.resize(200, 200);
gravestone.blit(avatar, 60, 65); gravestone.blit(avatar, 60, 65);
gravestone.getBuffer(Jimp.MIME_PNG, (err, buff) => { gravestone.getBuffer(Jimp.MIME_PNG, (err, buff) => {
+4 -4
View File
@@ -26,8 +26,8 @@ module.exports = class SteamCardCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let user = args.user; const user = args.user;
let userDisplayName = message.guild.member(args.user).displayName; const userDisplayName = message.guild.member(args.user).displayName;
let userAvatar = user.displayAvatarURL; let userAvatar = user.displayAvatarURL;
userAvatar = userAvatar.replace(".jpg", ".png"); userAvatar = userAvatar.replace(".jpg", ".png");
userAvatar = userAvatar.replace(".gif", ".png"); userAvatar = userAvatar.replace(".gif", ".png");
@@ -35,8 +35,8 @@ module.exports = class SteamCardCommand extends commando.Command {
images.push(Jimp.read(userAvatar)); images.push(Jimp.read(userAvatar));
images.push(Jimp.read("./images/SteamCard.png")); images.push(Jimp.read("./images/SteamCard.png"));
images.push(Jimp.read("./images/SteamCardBlank.png")); images.push(Jimp.read("./images/SteamCardBlank.png"));
let [avatar, steamcard, nothing] = await Promise.all(images); const [avatar, steamcard, nothing] = await Promise.all(images);
let font = await Jimp.loadFont(Jimp.FONT_SANS_32_WHITE); const font = await Jimp.loadFont(Jimp.FONT_SANS_32_WHITE);
avatar.resize(450, 450); avatar.resize(450, 450);
nothing.composite(avatar, 25, 25); nothing.composite(avatar, 25, 25);
nothing.composite(steamcard, 0, 0); nothing.composite(steamcard, 0, 0);
+3 -3
View File
@@ -27,9 +27,9 @@ module.exports = class ContactCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let messageToReport = args.report; const messageToReport = args.report;
let reportedMsg = await this.client.users.get(config.owner).send(`**${message.author.username}#${message.author.discriminator} (${message.author.id}):**\n${messageToReport}`); const reportedMsg = await this.client.users.get(config.owner).send(`**${message.author.username}#${message.author.discriminator} (${message.author.id}):**\n${messageToReport}`);
let successMsg = await message.say('Message Sent! Thanks for your support!'); const successMsg = await message.say('Message Sent! Thanks for your support!');
return [reportedMsg, successMsg]; return [reportedMsg, successMsg];
} }
}; };
+4 -6
View File
@@ -24,8 +24,8 @@ module.exports = class InfoCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let guilds = await this.client.shard.fetchClientValues('guilds.size'); const guilds = await this.client.shard.fetchClientValues('guilds.size');
let vCConnections = await this.client.shard.fetchClientValues('voiceConnections.size'); const vCConnections = await this.client.shard.fetchClientValues('voiceConnections.size');
const embed = new Discord.RichEmbed() const embed = new Discord.RichEmbed()
.setTitle('Welcome to XiaoBot!') .setTitle('Welcome to XiaoBot!')
.setAuthor(this.client.user.username, this.client.user.avatarURL) .setAuthor(this.client.user.username, this.client.user.avatarURL)
@@ -57,11 +57,9 @@ module.exports = class InfoCommand extends commando.Command {
.addField('Library', .addField('Library',
"[discord.js](https://discord.js.org/#/) / [commando](https://github.com/Gawdl3y/discord.js-commando)", true) "[discord.js](https://discord.js.org/#/) / [commando](https://github.com/Gawdl3y/discord.js-commando)", true)
.addField('Modules', .addField('Modules',
"[pirate-speak](https://github.com/mikewesthad/pirate-speak), [google-translate-api](https://github.com/matheuss/google-translate-api), [zalgoize](https://github.com/clux/zalgolize), [hepburn](https://github.com/lovell/hepburn), [string-to-binary](https://www.npmjs.com/package/string-to-binary), [roman-numeral-converter-mmxvi](https://github.com/Cein-Markey/roman-numeral-conversion-library), [cowsay](https://github.com/piuccio/cowsay), [morse](https://github.com/ecto/morse)") "[pirate-speak](https://github.com/mikewesthad/pirate-speak), [google-translate-api](https://github.com/matheuss/google-translate-api), [zalgoize](https://github.com/clux/zalgolize), [hepburn](https://github.com/lovell/hepburn), [string-to-binary](https://www.npmjs.com/package/string-to-binary), [roman-numeral-converter-mmxvi](https://github.com/Cein-Markey/roman-numeral-conversion-library), [cowsay](https://github.com/piuccio/cowsay), [morse](https://github.com/ecto/morse), [superagent](https://github.com/visionmedia/superagent), [mathjs](http://mathjs.org/), [moment](http://momentjs.com), [moment-duration-format](https://github.com/jsmreese/moment-duration-format), [opusscript](https://github.com/abalabahaha/opusscript), [jimp](https://github.com/oliver-moran/jimp), [cheerio](https://cheerio.js.org/), [sherlockjs](https://github.com/maytis/sherlockjs)")
.addField('Utility Modules',
"[superagent](https://github.com/visionmedia/superagent), [mathjs](http://mathjs.org/), [moment](http://momentjs.com), [moment-duration-format](https://github.com/jsmreese/moment-duration-format), [opusscript](https://github.com/abalabahaha/opusscript), [jimp](https://github.com/oliver-moran/jimp), [cheerio](https://cheerio.js.org/), [sherlockjs](https://github.com/maytis/sherlockjs)")
.addField('APIs', .addField('APIs',
"[Wattpad API](https://developer.wattpad.com/docs/api), [Wordnik API](http://developer.wordnik.com/docs.html), [osu! API](https://osu.ppy.sh/p/api), [memegen.link](https://memegen.link/), [Yugioh Prices API](http://docs.yugiohprices.apiary.io/#), [YouTube Data API](https://developers.google.com/youtube/v3/), [Yoda Speak API](https://market.mashape.com/ismaelc/yoda-speak), [Discord Bots API](https://bots.discord.pw/api), [Today in History API](http://history.muffinlabs.com/#api), [jService API](http://jservice.io/), [Strawpoll API](https://github.com/strawpoll/strawpoll/wiki/API), [Urban Dictionary API](https://github.com/zdict/zdict/wiki/Urban-dictionary-API-documentation), [OMDB API](http://www.omdbapi.com/), [Yahoo Weather API](https://developer.yahoo.com/weather/)") "[Wattpad API](https://developer.wattpad.com/docs/api), [Wordnik API](http://developer.wordnik.com/docs.html), [osu! API](https://osu.ppy.sh/p/api), [memegen.link](https://memegen.link/), [Yugioh Prices API](http://docs.yugiohprices.apiary.io/#), [YouTube Data API](https://developers.google.com/youtube/v3/), [Yoda Speak API](https://market.mashape.com/ismaelc/yoda-speak), [Discord Bots API](https://bots.discord.pw/api), [Today in History API](http://history.muffinlabs.com/#api), [jService API](http://jservice.io/), [Strawpoll API](https://github.com/strawpoll/strawpoll/wiki/API), [Urban Dictionary API](https://github.com/zdict/zdict/wiki/Urban-dictionary-API-documentation), [OMDB API](http://www.omdbapi.com/), [Yahoo Weather API](https://developer.yahoo.com/weather/), [iTunes Store Search API](https://affiliate.itunes.apple.com/resources/documentation/itunes-store-web-service-search-api/)")
.addField('Other Credit', .addField('Other Credit',
"[Heroku](https://www.heroku.com/), [Cloud9](https://c9.io/), [heroku-buildpack-ffmpeg-latest](https://elements.heroku.com/buildpacks/jonathanong/heroku-buildpack-ffmpeg-latest)") "[Heroku](https://www.heroku.com/), [Cloud9](https://c9.io/), [heroku-buildpack-ffmpeg-latest](https://elements.heroku.com/buildpacks/jonathanong/heroku-buildpack-ffmpeg-latest)")
.addField('My Server', .addField('My Server',
+1 -1
View File
@@ -16,7 +16,7 @@ module.exports = class LotteryCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let lotteryNumber = ['Winner'][Math.floor(Math.random() * 100)]; const lotteryNumber = ['Winner'][Math.floor(Math.random() * 100)];
if (lotteryNumber !== "Winner") return message.say(`Nope, sorry ${message.author.username}, you lost.`); if (lotteryNumber !== "Winner") return message.say(`Nope, sorry ${message.author.username}, you lost.`);
return message.say(`Wow ${message.author.username}! You actually won! Great job!`); return message.say(`Wow ${message.author.username}! You actually won! Great job!`);
} }
+10 -10
View File
@@ -29,7 +29,7 @@ module.exports = class MathGameCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let level = args.difficulty.toLowerCase(); const level = args.difficulty.toLowerCase();
let randomType = ['+', '-', '*']; let randomType = ['+', '-', '*'];
randomType = randomType[Math.floor(Math.random() * randomType.length)]; randomType = randomType[Math.floor(Math.random() * randomType.length)];
let randomValue; let randomValue;
@@ -47,29 +47,29 @@ module.exports = class MathGameCommand extends commando.Command {
randomValue = 1000; randomValue = 1000;
break; break;
} }
let randomValue1 = Math.floor(Math.random() * randomValue) + 1; const randomValue1 = Math.floor(Math.random() * randomValue) + 1;
let randomValue2 = Math.floor(Math.random() * randomValue) + 1; const randomValue2 = Math.floor(Math.random() * randomValue) + 1;
let randomExpression = randomValue1 + randomType + randomValue2; const randomExpression = randomValue1 + randomType + randomValue2;
let solved = math.eval(randomExpression); const solved = math.eval(randomExpression);
const embed = new Discord.RichEmbed() const embed = new Discord.RichEmbed()
.setTitle('You have **ten** seconds to answer:') .setTitle('You have **ten** seconds to answer:')
.setDescription(randomExpression); .setDescription(randomExpression);
let embedMsg = await message.embed(embed); const embedMsg = await message.embed(embed);
try { try {
let collected = await message.channel.awaitMessages(response => response.author.id === message.author.id, { const collected = await message.channel.awaitMessages(response => response.author.id === message.author.id, {
max: 1, max: 1,
time: 10000, time: 10000,
errors: ['time'] errors: ['time']
}); });
if (collected.first().content !== solved.toString()) { if (collected.first().content !== solved.toString()) {
let loseMsg = await message.say(`Aw... Too bad, try again next time!\nThe correct answer is: ${solved}`); const loseMsg = await message.say(`Aw... Too bad, try again next time!\nThe correct answer is: ${solved}`);
return [embedMsg, loseMsg]; return [embedMsg, loseMsg];
} }
let victoryMsg = await message.say(`Good Job! You won! ${solved} is the correct answer!`); const victoryMsg = await message.say(`Good Job! You won! ${solved} is the correct answer!`);
return [embedMsg, victoryMsg]; return [embedMsg, victoryMsg];
} }
catch (err) { catch (err) {
let loseMsg = await message.say(`Aw... Too bad, try again next time!\nThe correct answer is: ${solved}`); const loseMsg = await message.say(`Aw... Too bad, try again next time!\nThe correct answer is: ${solved}`);
return [embedMsg, loseMsg]; return [embedMsg, loseMsg];
} }
} }
+8 -8
View File
@@ -22,32 +22,32 @@ module.exports = class QuizCommand extends commando.Command {
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
try { try {
let response = await request const response = await request
.get('http://jservice.io/api/random') .get('http://jservice.io/api/random')
.query({ .query({
count: 1 count: 1
}); });
let data = response.body[0]; const data = response.body[0];
let answer = data.answer.toLowerCase().split("<i>").join("").split("</i>").join(""); const answer = data.answer.toLowerCase().split("<i>").join("").split("</i>").join("");
const embed = new Discord.RichEmbed() const embed = new Discord.RichEmbed()
.setTitle('You have **fifteen** seconds to answer this question:') .setTitle('You have **fifteen** seconds to answer this question:')
.setDescription(`**Category: ${data.category.title}**\n${data.question}`); .setDescription(`**Category: ${data.category.title}**\n${data.question}`);
let embedMsg = await message.embed(embed); const embedMsg = await message.embed(embed);
try { try {
let collected = await message.channel.awaitMessages(res => res.author.id === message.author.id, { const collected = await message.channel.awaitMessages(res => res.author.id === message.author.id, {
max: 1, max: 1,
time: 15000, time: 15000,
errors: ['time'] errors: ['time']
}); });
if (collected.first().content.toLowerCase() !== answer) { if (collected.first().content.toLowerCase() !== answer) {
let loseMsg = await message.say(`The correct answer is: ${answer}`); const loseMsg = await message.say(`The correct answer is: ${answer}`);
return [embedMsg, loseMsg]; return [embedMsg, loseMsg];
} }
let victoryMsg = await message.say(`The correct answer is: ${answer}`); const victoryMsg = await message.say(`The correct answer is: ${answer}`);
return [embedMsg, victoryMsg]; return [embedMsg, victoryMsg];
} }
catch (err) { catch (err) {
let loseMsg = await message.say(`Aw... Too bad, try again next time!\nThe Correct Answer was: ${answer}`); const loseMsg = await message.say(`Aw... Too bad, try again next time!\nThe Correct Answer was: ${answer}`);
return [embedMsg, loseMsg]; return [embedMsg, loseMsg];
} }
} }
+1 -1
View File
@@ -30,7 +30,7 @@ module.exports = class RockPaperScissors extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let rps = args.choice.toLowerCase(); const rps = args.choice.toLowerCase();
let response = ['Paper', 'Rock', 'Scissors']; let response = ['Paper', 'Rock', 'Scissors'];
response = response[Math.floor(Math.random() * response.length)]; response = response[Math.floor(Math.random() * response.length)];
if (rps === "rock") { if (rps === "rock") {
+5 -5
View File
@@ -16,11 +16,11 @@ module.exports = class SlotsCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let slotThing = [':grapes:', ':tangerine:', ':pear:', ':cherries:']; const slotThing = [':grapes:', ':tangerine:', ':pear:', ':cherries:'];
let slotOne = slotThing[Math.floor(Math.random() * slotThing.length)]; const slotOne = slotThing[Math.floor(Math.random() * slotThing.length)];
let slotTwo = slotThing[Math.floor(Math.random() * slotThing.length)]; const slotTwo = slotThing[Math.floor(Math.random() * slotThing.length)];
let slotThree = slotThing[Math.floor(Math.random() * slotThing.length)]; const slotThree = slotThing[Math.floor(Math.random() * slotThing.length)];
let slotFour = slotThing[Math.floor(Math.random() * slotThing.length)]; const slotFour = slotThing[Math.floor(Math.random() * slotThing.length)];
if (slotOne === slotTwo && slotOne === slotThree && slotOne === slotFour) { if (slotOne === slotTwo && slotOne === slotThree && slotOne === slotFour) {
return message.say(`${slotOne}|${slotTwo}|${slotThree}|${slotFour}\nWow! You won! Great job... er... luck!`); return message.say(`${slotOne}|${slotTwo}|${slotThree}|${slotFour}\nWow! You won! Great job... er... luck!`);
} }
+6 -6
View File
@@ -28,7 +28,7 @@ module.exports = class TypingGameCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let level = args.difficulty.toLowerCase(); const level = args.difficulty.toLowerCase();
let randomSentence = ['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.']; let randomSentence = ['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.'];
randomSentence = randomSentence[Math.floor(Math.random() * randomSentence.length)]; randomSentence = randomSentence[Math.floor(Math.random() * randomSentence.length)];
let time; let time;
@@ -54,22 +54,22 @@ module.exports = class TypingGameCommand extends commando.Command {
const embed = new Discord.RichEmbed() const embed = new Discord.RichEmbed()
.setTitle(`You have **${levelWord}** seconds to type:`) .setTitle(`You have **${levelWord}** seconds to type:`)
.setDescription(randomSentence); .setDescription(randomSentence);
let embedMsg = await message.embed(embed); const embedMsg = await message.embed(embed);
try { try {
let collected = await message.channel.awaitMessages(response => response.author.id === message.author.id, { const collected = await message.channel.awaitMessages(response => response.author.id === message.author.id, {
max: 1, max: 1,
time: time, time: time,
errors: ['time'] errors: ['time']
}); });
if (collected.first().content !== randomSentence) { if (collected.first().content !== randomSentence) {
let loseMsg = await message.say('Nope, your sentence does not match the original. Try again next time!'); const loseMsg = await message.say('Nope, your sentence does not match the original. Try again next time!');
return [embedMsg, loseMsg]; return [embedMsg, loseMsg];
} }
let victoryMsg = await message.say(`Good Job! You won!`); const victoryMsg = await message.say(`Good Job! You won!`);
return [embedMsg, victoryMsg]; return [embedMsg, victoryMsg];
} }
catch (err) { catch (err) {
let loseMsg = await message.say('Aw... Too bad, try again next time!'); const loseMsg = await message.say('Aw... Too bad, try again next time!');
return [embedMsg, loseMsg]; return [embedMsg, loseMsg];
} }
} }
+6 -6
View File
@@ -42,12 +42,12 @@ module.exports = class MemeCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let type = args.type.toLowerCase(); const type = args.type.toLowerCase();
let content = args.content; const content = args.content;
let memeQuery = content.split(" ").join("-").split("-|-"); const memeQuery = content.split(" ").join("-").split("-|-");
let toprow = memeQuery[0].split("?").join("~q"); const toprow = memeQuery[0].split("?").join("~q");
let bottomrow = memeQuery[1].split("?").join("~q"); const bottomrow = memeQuery[1].split("?").join("~q");
let link = `https://memegen.link/${type}/${toprow}/${bottomrow}.jpg`; const link = `https://memegen.link/${type}/${toprow}/${bottomrow}.jpg`;
if (bottomrow.length > 100) return message.say(":x: Error! Bottom text is over 100 characters!"); if (bottomrow.length > 100) return message.say(":x: Error! Bottom text is over 100 characters!");
if (toprow.length > 100) return message.say(":x: Error! Top text is over 100 characters!"); if (toprow.length > 100) return message.say(":x: Error! Top text is over 100 characters!");
return message.channel.sendFile(link).catch(err => message.say(':x: Error! Something went wrong!')); return message.channel.sendFile(link).catch(err => message.say(':x: Error! Something went wrong!'));
+5 -5
View File
@@ -40,19 +40,19 @@ module.exports = class BanCommand extends commando.Command {
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
if (!message.guild.channels.exists("name", "mod_logs")) return message.say(":x: Error! Could not find the mod_logs channel! Please create it!"); 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 = args.member; const member = args.member;
let reason = args.reason; const reason = args.reason;
if (!message.guild.member(member).bannable) return message.say(":x: Error! This member cannot be banned! Perhaps they have a higher role than me?"); if (!message.guild.member(member).bannable) return message.say(":x: Error! This member cannot be banned! Perhaps they have a higher role than me?");
try { try {
let banUser = await message.guild.member(member).ban(); const banUser = await message.guild.member(member).ban();
let okHandMsg = await message.say(":ok_hand:"); const okHandMsg = await message.say(":ok_hand:");
const embed = new Discord.RichEmbed() const embed = new Discord.RichEmbed()
.setAuthor(`${message.author.username}#${message.author.discriminator}`, message.author.avatarURL) .setAuthor(`${message.author.username}#${message.author.discriminator}`, message.author.avatarURL)
.setColor(0xFF0000) .setColor(0xFF0000)
.setFooter('XiaoBot Moderation', this.client.user.avatarURL) .setFooter('XiaoBot Moderation', this.client.user.avatarURL)
.setTimestamp() .setTimestamp()
.setDescription(`**Member:** ${banUser.user.username}#${banUser.user.discriminator} (${member.id})\n**Action:** Ban\n**Reason:** ${reason}`); .setDescription(`**Member:** ${banUser.user.username}#${banUser.user.discriminator} (${member.id})\n**Action:** Ban\n**Reason:** ${reason}`);
let modLogMsg = await message.guild.channels.find('name', 'mod_logs').sendEmbed(embed); const modLogMsg = await message.guild.channels.find('name', 'mod_logs').sendEmbed(embed);
return [banUser, okHandMsg, modLogMsg]; return [banUser, okHandMsg, modLogMsg];
} }
catch (err) { catch (err) {
+5 -5
View File
@@ -37,19 +37,19 @@ module.exports = class KickCommand extends commando.Command {
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
if (!message.guild.channels.exists("name", "mod_logs")) return message.say(":x: Error! Could not find the mod_logs channel! Please create it!"); 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 = args.member; const member = args.member;
let reason = args.reason; const reason = args.reason;
if (!message.guild.member(member).bannable) return message.say(":x: Error! This member cannot be kicked! Perhaps they have a higher role than me?"); if (!message.guild.member(member).bannable) return message.say(":x: Error! This member cannot be kicked! Perhaps they have a higher role than me?");
try { try {
let kickUser = await message.guild.member(member).kick(); const kickUser = await message.guild.member(member).kick();
let okHandMsg = await message.say(":ok_hand:"); const okHandMsg = await message.say(":ok_hand:");
const embed = new Discord.RichEmbed() const embed = new Discord.RichEmbed()
.setAuthor(`${message.author.username}#${message.author.discriminator}`, message.author.avatarURL) .setAuthor(`${message.author.username}#${message.author.discriminator}`, message.author.avatarURL)
.setColor(0xFFA500) .setColor(0xFFA500)
.setFooter('XiaoBot Moderation', this.client.user.avatarURL) .setFooter('XiaoBot Moderation', this.client.user.avatarURL)
.setTimestamp() .setTimestamp()
.setDescription(`**Member:** ${kickUser.user.username}#${kickUser.user.discriminator} (${member.id})\n**Action:** Kick\n**Reason:** ${reason}`); .setDescription(`**Member:** ${kickUser.user.username}#${kickUser.user.discriminator} (${member.id})\n**Action:** Kick\n**Reason:** ${reason}`);
let modLogMsg = await message.guild.channels.find('name', 'mod_logs').sendEmbed(embed); const modLogMsg = await message.guild.channels.find('name', 'mod_logs').sendEmbed(embed);
return [kickUser, okHandMsg, modLogMsg]; return [kickUser, okHandMsg, modLogMsg];
} }
catch (err) { catch (err) {
+1 -1
View File
@@ -32,7 +32,7 @@ module.exports = class LockdownCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission('MANAGE_CHANNELS')) return message.say(":x: Error! I don't have permission to Manage Channels!"); if (!message.channel.permissionsFor(this.client.user).hasPermission('MANAGE_CHANNELS')) return message.say(":x: Error! I don't have permission to Manage Channels!");
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let type = args.type; const type = args.type;
if (type.toLowerCase() === 'start') { if (type.toLowerCase() === 'start') {
try { try {
await message.channel.overwritePermissions(message.guild.defaultRole, { await message.channel.overwritePermissions(message.guild.defaultRole, {
+3 -2
View File
@@ -43,12 +43,13 @@ module.exports = class PruneCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['READ_MESSAGES', 'MANAGE_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['READ_MESSAGES', 'MANAGE_MESSAGES'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let count = args.count + 1; const count = args.count + 1;
try { try {
let messages = await message.channel.fetchMessages({ const messages = await message.channel.fetchMessages({
limit: count limit: count
}); });
await message.channel.bulkDelete(messages, true); await message.channel.bulkDelete(messages, true);
return null;
} }
catch (err) { catch (err) {
return message.say(':x: Error! Something went wrong! Perhaps there are not enough messages in the channel from earlier than two weeks?'); return message.say(':x: Error! Something went wrong! Perhaps there are not enough messages in the channel from earlier than two weeks?');
+7 -7
View File
@@ -46,21 +46,21 @@ module.exports = class UnbanCommand extends commando.Command {
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
if (!message.guild.channels.exists("name", "mod_logs")) return message.say(":x: Error! Could not find the mod_logs channel! Please create it!"); if (!message.guild.channels.exists("name", "mod_logs")) return message.say(":x: Error! Could not find the mod_logs channel! Please create it!");
let memberID = args.memberID; const memberID = args.memberID;
let reason = args.reason; const reason = args.reason;
let bans = await message.guild.fetchBans(); const bans = await message.guild.fetchBans();
if (!bans.has(memberID)) return message.say(':x: Error! Could not find this user in the bans.'); if (!bans.has(memberID)) return message.say(':x: Error! Could not find this user in the bans.');
let unbanUserObj = await bans.get(memberID); const unbanUserObj = await bans.get(memberID);
try { try {
let unbanUser = await message.guild.unban(unbanUserObj); const unbanUser = await message.guild.unban(unbanUserObj);
let okHandMsg = await message.say(":ok_hand:"); const okHandMsg = await message.say(":ok_hand:");
const embed = new Discord.RichEmbed() const embed = new Discord.RichEmbed()
.setAuthor(`${message.author.username}#${message.author.discriminator}`, message.author.avatarURL) .setAuthor(`${message.author.username}#${message.author.discriminator}`, message.author.avatarURL)
.setColor(0x00AE86) .setColor(0x00AE86)
.setFooter('XiaoBot Moderation', this.client.user.avatarURL) .setFooter('XiaoBot Moderation', this.client.user.avatarURL)
.setTimestamp() .setTimestamp()
.setDescription(`**Member:** ${unbanUser.username}#${unbanUser.discriminator} (${unbanUser.id})\n**Action:** Unban\n**Reason:** ${reason}`); .setDescription(`**Member:** ${unbanUser.username}#${unbanUser.discriminator} (${unbanUser.id})\n**Action:** Unban\n**Reason:** ${reason}`);
let modLogMsg = await message.guild.channels.find('name', 'mod_logs').sendEmbed(embed); const modLogMsg = await message.guild.channels.find('name', 'mod_logs').sendEmbed(embed);
return [unbanUser, okHandMsg, modLogMsg]; return [unbanUser, okHandMsg, modLogMsg];
} }
catch (err) { catch (err) {
+4 -4
View File
@@ -36,18 +36,18 @@ module.exports = class WarnCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let userToWarn = args.member; const userToWarn = args.member;
let reason = args.reason; const reason = args.reason;
if (!message.guild.channels.exists("name", "mod_logs")) return message.say(":x: Error! Could not find the mod_logs channel! Please create it!"); if (!message.guild.channels.exists("name", "mod_logs")) return message.say(":x: Error! Could not find the mod_logs channel! Please create it!");
try { try {
let okHandMsg = await message.say(":ok_hand:"); const okHandMsg = await message.say(":ok_hand:");
const embed = new Discord.RichEmbed() const embed = new Discord.RichEmbed()
.setAuthor(`${message.author.username}#${message.author.discriminator}`, message.author.avatarURL) .setAuthor(`${message.author.username}#${message.author.discriminator}`, message.author.avatarURL)
.setColor(0xFFFF00) .setColor(0xFFFF00)
.setFooter('XiaoBot Moderation', this.client.user.avatarURL) .setFooter('XiaoBot Moderation', this.client.user.avatarURL)
.setTimestamp() .setTimestamp()
.setDescription(`**Member:** ${userToWarn.user.username}#${userToWarn.user.discriminator} (${userToWarn.id})\n**Action:** Warn\n**Reason:** ${reason}`); .setDescription(`**Member:** ${userToWarn.user.username}#${userToWarn.user.discriminator} (${userToWarn.id})\n**Action:** Warn\n**Reason:** ${reason}`);
let modLogMsg = await message.guild.channels.find('name', 'mod_logs').sendEmbed(embed); const modLogMsg = await message.guild.channels.find('name', 'mod_logs').sendEmbed(embed);
return [okHandMsg, modLogMsg]; return [okHandMsg, modLogMsg];
} }
catch (err) { catch (err) {
+2 -2
View File
@@ -28,9 +28,9 @@ module.exports = class MathCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let expression = args.expression; const expression = args.expression;
try { try {
let solved = math.eval(expression); const solved = math.eval(expression);
return message.say(solved).catch(err => message.say(":x: Error! Invalid statement!")); return message.say(solved).catch(err => message.say(":x: Error! Invalid statement!"));
} }
catch (err) { catch (err) {
+2 -2
View File
@@ -28,8 +28,8 @@ module.exports = class RomanCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let numberToRoman = args.number; const numberToRoman = args.number;
let romanInterger = numberToRoman; const romanInterger = numberToRoman;
return message.say(romanNumeralConverter.getRomanFromInteger(romanInterger)); return message.say(romanNumeralConverter.getRomanFromInteger(romanInterger));
} }
}; };
+4 -4
View File
@@ -26,11 +26,11 @@ module.exports = class RemindCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let remindMe = args.remind; const remindMe = args.remind;
try { try {
let remindTime = sherlock.parse(remindMe); const remindTime = sherlock.parse(remindMe);
let time = remindTime.startDate.getTime() - Date.now(); const time = remindTime.startDate.getTime() - Date.now();
let preRemind = await message.say(`I will remind you '${remindTime.eventTitle}' ${moment().add(time, 'ms').fromNow()}.`); const preRemind = await message.say(`I will remind you '${remindTime.eventTitle}' ${moment().add(time, 'ms').fromNow()}.`);
const remindMessage = await new Promise(resolve => { const remindMessage = await new Promise(resolve => {
setTimeout(() => resolve(message.say(`${message.author} you wanted me to remind you of: '${remindTime.eventTitle}'`)), time); setTimeout(() => resolve(message.say(`${message.author} you wanted me to remind you of: '${remindTime.eventTitle}'`)), time);
}); });
+28 -8
View File
@@ -1,5 +1,25 @@
const commando = require('discord.js-commando'); const commando = require('discord.js-commando');
const sounds = require('./sounds.json'); const sounds = ['cat', 'pikachu', 'vader', 'doh', "it's a trap", 'mario death', 'pokemon center', 'dun dun dun', 'spongebob', 'ugly barnacle', 'woo hoo', 'space', 'glados bird', 'airhorn', 'zelda chest', 'eat my shorts', 'no this is patrick', 'wumbo'];
const paths = {
"cat": "./sounds/cat.mp3",
"pikachu": "./sounds/pikachu.mp3",
"vader": "./sounds/vader.mp3",
"doh": "./sounds/doh.mp3",
"it's a trap": "./sounds/its-a-trap.mp3",
"mario death": "./sounds/mario-death.mp3",
"pokemon center": "./sounds/pokemon-center.mp3",
"dun dun dun": "./sounds/dun-dun-dun.mp3",
"spongebob": "./sounds/spongebob.mp3",
"ugly barnacle": "./sounds/ugly-barnacle.mp3",
"woo hoo": "./sounds/woohoo.mp3",
"space": "./sounds/space.mp3",
"glados bird": "./sounds/glados-bird.mp3",
"airhorn": "./sounds/airhorn.mp3",
"zelda chest": "./sounds/zelda-chest.mp3",
"eat my shorts": "./sounds/eat-my-shorts.mp3",
"no this is patrick": "./sounds/no-this-is-patrick.mp3",
"wumbo": "./sounds/wumbo.mp3"
};
module.exports = class SoundBoardCommand extends commando.Command { module.exports = class SoundBoardCommand extends commando.Command {
constructor(Client) { constructor(Client) {
@@ -20,7 +40,7 @@ module.exports = class SoundBoardCommand extends commando.Command {
prompt: 'What sound do you want me to play?', prompt: 'What sound do you want me to play?',
type: 'string', type: 'string',
validate: sound => { validate: sound => {
if (sounds.avaliable[sound.toLowerCase()]) { if (sounds.some(soundArray => sound.toLowerCase() === soundArray)) {
return true; return true;
} }
return 'Sound not found. Use `;help soundboard` to view a list of sounds.'; return 'Sound not found. Use `;help soundboard` to view a list of sounds.';
@@ -34,17 +54,17 @@ module.exports = class SoundBoardCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'CONNECT', 'SPEAK', 'ADD_REACTIONS'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'CONNECT', 'SPEAK', 'ADD_REACTIONS'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let voiceChannel = message.member.voiceChannel; const voiceChannel = message.member.voiceChannel;
if (!voiceChannel) return message.say(`:x: Error! Please be in a voice channel first!`); if (!voiceChannel) return message.say(`:x: Error! Please be in a voice channel first!`);
let soundToPlay = args.sound.toLowerCase(); const soundToPlay = args.sound.toLowerCase();
let alreadyConnected = await this.client.voiceConnections.get(voiceChannel.guild.id); const alreadyConnected = await this.client.voiceConnections.get(voiceChannel.guild.id);
if (alreadyConnected) { if (alreadyConnected) {
if (alreadyConnected.channel.id === voiceChannel.id) return message.say(':x: Error! I am already playing a sound!'); if (alreadyConnected.channel.id === voiceChannel.id) return message.say(':x: Error! I am already playing a sound!');
return message.say(':x: Error! I am already playing a sound!'); return message.say(':x: Error! I am already playing a sound!');
} }
let connection = await voiceChannel.join(); const connection = await voiceChannel.join();
let stream = sounds.paths[soundToPlay]; const stream = paths[soundToPlay];
let dispatcher = connection.playStream(stream); const dispatcher = connection.playStream(stream);
message.react('🔊'); message.react('🔊');
dispatcher.on('end', () => { dispatcher.on('end', () => {
message.react('✅'); message.react('✅');
-42
View File
@@ -1,42 +0,0 @@
{
"avaliable": {
"cat": "cat",
"pikachu": "pikachu",
"vader": "vader",
"doh": "doh",
"it's a trap": "it's a trap",
"mario death": "mario death",
"pokemon center": "pokemon center",
"dun dun dun": "dun dun dun",
"spongebob": "spongebob",
"ugly barnacle": "ugly barnacle",
"woo hoo": "woo hoo",
"space": "space",
"glados bird": "glados bird",
"airhorn": "airhorn",
"zelda chest": "zelda chest",
"eat my shorts": "eat my shorts",
"no this is patrick": "no this is patrick",
"wumbo": "wumbo"
},
"paths": {
"cat": "./sounds/cat.mp3",
"pikachu": "./sounds/pikachu.mp3",
"vader": "./sounds/vader.mp3",
"doh": "./sounds/doh.mp3",
"it's a trap": "./sounds/its-a-trap.mp3",
"mario death": "./sounds/mario-death.mp3",
"pokemon center": "./sounds/pokemon-center.mp3",
"dun dun dun": "./sounds/dun-dun-dun.mp3",
"spongebob": "./sounds/spongebob.mp3",
"ugly barnacle": "./sounds/ugly-barnacle.mp3",
"woo hoo": "./sounds/woohoo.mp3",
"space": "./sounds/space.mp3",
"glados bird": "./sounds/glados-bird.mp3",
"airhorn": "./sounds/airhorn.mp3",
"zelda chest": "./sounds/zelda-chest.mp3",
"eat my shorts": "./sounds/eat-my-shorts.mp3",
"no this is patrick": "./sounds/no-this-is-patrick.mp3",
"wumbo": "./sounds/wumbo.mp3"
}
}
+4 -4
View File
@@ -45,18 +45,18 @@ module.exports = class StrawpollCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let title = args.title; const title = args.title;
let choices = args.choices.split(" | "); const choices = args.choices.split(" | ");
if (choices.length < 2) return message.say(':x: Error! You provided less than two choices!'); 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!'); if (choices.length > 31) return message.say(':x: Error! You provided more than thirty choices!');
try { try {
let response = await request const response = await request
.post('https://strawpoll.me/api/v2/polls') .post('https://strawpoll.me/api/v2/polls')
.send({ .send({
title: title, title: title,
options: choices options: choices
}); });
let data = response.body; const data = response.body;
return message.say(`${data.title}\nhttp://strawpoll.me/${data.id}`); return message.say(`${data.title}\nhttp://strawpoll.me/${data.id}`);
} }
catch (err) { catch (err) {
+4 -4
View File
@@ -22,15 +22,15 @@ module.exports = class TodayCommand extends commando.Command {
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
try { try {
let response = await request const response = await request
.get('http://history.muffinlabs.com/date') .get('http://history.muffinlabs.com/date')
.set({ .set({
'Accept': 'application/json' 'Accept': 'application/json'
}) })
.buffer(true); .buffer(true);
let parsedResponse = JSON.parse(response.text); const parsedResponse = JSON.parse(response.text);
let events = parsedResponse.data.Events; const events = parsedResponse.data.Events;
let randomNumber = Math.floor(Math.random() * events.length); const randomNumber = Math.floor(Math.random() * events.length);
const embed = new Discord.RichEmbed() const embed = new Discord.RichEmbed()
.setColor(0x9797FF) .setColor(0x9797FF)
.setURL(parsedResponse.url) .setURL(parsedResponse.url)
+1 -1
View File
@@ -21,7 +21,7 @@ module.exports = class MagicBall extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let question = args.question; const question = args.question;
let answers = ['It seems the answer is yes, yes?', 'It seems the answer is no.', 'It is a little doubtful, yes?', 'It seems it is very likely to be true.']; let answers = ['It seems the answer is yes, yes?', 'It seems the answer is no.', 'It is a little doubtful, yes?', 'It seems it is very likely to be true.'];
answers = answers[Math.floor(Math.random() * answers.length)]; answers = answers[Math.floor(Math.random() * answers.length)];
return message.say(`Question: ${question}\n:8ball: ${answers} :8ball:`); return message.say(`Question: ${question}\n:8ball: ${answers} :8ball:`);
-1
View File
@@ -31,7 +31,6 @@ module.exports = class ChooseCommand extends commando.Command {
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let choices = args.choices; let choices = args.choices;
if (!choices.includes(' | ')) return message.say(':x: Error! Split your messages with a " | "!');
choices = choices.split(" | "); choices = choices.split(" | ");
choices = choices[Math.floor(Math.random() * choices.length)]; choices = choices[Math.floor(Math.random() * choices.length)];
return message.say(`I choose ${choices}!`); return message.say(`I choose ${choices}!`);
+1 -1
View File
@@ -22,7 +22,7 @@ module.exports = class ComplimentCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let thingToCompliment = args.thing || message.author; const thingToCompliment = args.thing || message.author;
let compliments = ["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."]; let compliments = ["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."];
compliments = compliments[Math.floor(Math.random() * compliments.length)]; compliments = compliments[Math.floor(Math.random() * compliments.length)];
return message.say(`${thingToCompliment}, ${compliments}`); return message.say(`${thingToCompliment}, ${compliments}`);
+1 -1
View File
@@ -26,7 +26,7 @@ module.exports = class MotivateCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let userToMotivate = args.thing || message.author; const userToMotivate = args.thing || message.author;
return message.say(`${userToMotivate}, https://www.youtube.com/watch?v=ZXsQAXx_ao0`); return message.say(`${userToMotivate}, https://www.youtube.com/watch?v=ZXsQAXx_ao0`);
} }
}; };
+1 -1
View File
@@ -37,7 +37,7 @@ module.exports = class RandomNameGen extends commando.Command {
randomFirstFemale = randomFirstFemale[Math.floor(Math.random() * randomFirstFemale.length)]; randomFirstFemale = randomFirstFemale[Math.floor(Math.random() * randomFirstFemale.length)];
let randomLast = ["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"]; let randomLast = ["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"];
randomLast = randomLast[Math.floor(Math.random() * randomLast.length)]; randomLast = randomLast[Math.floor(Math.random() * randomLast.length)];
let gender = args.gender.toLowerCase(); const gender = args.gender.toLowerCase();
if (gender === "male") { if (gender === "male") {
return message.say(`${randomFirstMale} ${randomLast}`); return message.say(`${randomFirstMale} ${randomLast}`);
} }
+2 -2
View File
@@ -24,8 +24,8 @@ module.exports = class RateWaifuCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let waifuToRate = args.waifu; const waifuToRate = args.waifu;
let rating = Math.floor(Math.random() * 10) + 1; const rating = Math.floor(Math.random() * 10) + 1;
return message.say(`I'd give ${waifuToRate} a ${rating}/10!`); return message.say(`I'd give ${waifuToRate} a ${rating}/10!`);
} }
}; };
+1 -1
View File
@@ -25,7 +25,7 @@ module.exports = class RoastMeCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let userToRoast = args.thing || message.author; const userToRoast = args.thing || message.author;
let roasts = ["*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 nickel for every brain you don't have, I'd have one dollar.", "I'd help you succeed but you're incapable."]; let roasts = ["*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 nickel for every brain you don't have, I'd have one dollar.", "I'd help you succeed but you're incapable."];
roasts = roasts[Math.floor(Math.random() * roasts.length)]; roasts = roasts[Math.floor(Math.random() * roasts.length)];
if (!userToRoast) { if (!userToRoast) {
+2 -2
View File
@@ -26,8 +26,8 @@ module.exports = class RollChooseCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let value = args.number; const value = args.number;
let roll = Math.floor(Math.random() * value) + 1; const roll = Math.floor(Math.random() * value) + 1;
return message.say(`You rolled a ${roll}.`); return message.say(`You rolled a ${roll}.`);
} }
}; };
+2 -2
View File
@@ -24,8 +24,8 @@ module.exports = class ShipCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let thingToShip = args.things; const thingToShip = args.things;
let percentage = Math.floor(Math.random() * 100) + 1; const percentage = Math.floor(Math.random() * 100) + 1;
return message.say(`I'd give ${thingToShip} a ${percentage}%!`); return message.say(`I'd give ${thingToShip} a ${percentage}%!`);
} }
}; };
+1 -1
View File
@@ -21,7 +21,7 @@ module.exports = class CuddleCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let thingToRoleplay = args.thing; const thingToRoleplay = args.thing;
return message.say(`${message.author} *cuddles* ${thingToRoleplay}`); return message.say(`${message.author} *cuddles* ${thingToRoleplay}`);
} }
}; };
+1 -1
View File
@@ -21,7 +21,7 @@ module.exports = class DivorceCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let thingToRoleplay = args.thing; const thingToRoleplay = args.thing;
return message.say(`${message.author} *divorces* ${thingToRoleplay}`); return message.say(`${message.author} *divorces* ${thingToRoleplay}`);
} }
}; };
+1 -1
View File
@@ -21,7 +21,7 @@ module.exports = class EatCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let thingToRoleplay = args.thing; const thingToRoleplay = args.thing;
return message.say(`${message.author} *eats* ${thingToRoleplay}`); return message.say(`${message.author} *eats* ${thingToRoleplay}`);
} }
}; };
+1 -1
View File
@@ -21,7 +21,7 @@ module.exports = class FalconPunchCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let thingToRoleplay = args.thing; const thingToRoleplay = args.thing;
return message.say(`${message.author} *falcon punches* ${thingToRoleplay}`); return message.say(`${message.author} *falcon punches* ${thingToRoleplay}`);
} }
}; };
+1 -1
View File
@@ -21,7 +21,7 @@ module.exports = class FistBumpCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let thingToRoleplay = args.thing; const thingToRoleplay = args.thing;
return message.say(`${message.author} *fist-bumps* ${thingToRoleplay} *badalalala*`); return message.say(`${message.author} *fist-bumps* ${thingToRoleplay} *badalalala*`);
} }
}; };
+1 -1
View File
@@ -21,7 +21,7 @@ module.exports = class HighFivesCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let thingToRoleplay = args.thing; const thingToRoleplay = args.thing;
return message.say(`${message.author} *high-fives* ${thingToRoleplay}`); return message.say(`${message.author} *high-fives* ${thingToRoleplay}`);
} }
}; };
+1 -1
View File
@@ -21,7 +21,7 @@ module.exports = class HitwithShovelCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let thingToRoleplay = args.thing; const thingToRoleplay = args.thing;
return message.say(`${message.author} *hits* ${thingToRoleplay} *with a shovel*`); return message.say(`${message.author} *hits* ${thingToRoleplay} *with a shovel*`);
} }
}; };
+1 -1
View File
@@ -21,7 +21,7 @@ module.exports = class HugCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let thingToRoleplay = args.thing; const thingToRoleplay = args.thing;
return message.say(`${message.author} *hugs* ${thingToRoleplay}`); return message.say(`${message.author} *hugs* ${thingToRoleplay}`);
} }
}; };
+1 -1
View File
@@ -21,7 +21,7 @@ module.exports = class InhaleCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let thingToRoleplay = args.thing; const thingToRoleplay = args.thing;
return message.say(`${message.author} *inhales* ${thingToRoleplay} *but gained no ability...*`); return message.say(`${message.author} *inhales* ${thingToRoleplay} *but gained no ability...*`);
} }
}; };
+1 -1
View File
@@ -21,7 +21,7 @@ module.exports = class KillCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let thingToRoleplay = args.thing; const thingToRoleplay = args.thing;
return message.say(`${message.author} *kills* ${thingToRoleplay}`); return message.say(`${message.author} *kills* ${thingToRoleplay}`);
} }
}; };
+1 -1
View File
@@ -21,7 +21,7 @@ module.exports = class KissCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let thingToRoleplay = args.thing; const thingToRoleplay = args.thing;
return message.say(`${message.author} *kisses* ${thingToRoleplay}`); return message.say(`${message.author} *kisses* ${thingToRoleplay}`);
} }
}; };
+1 -1
View File
@@ -21,7 +21,7 @@ module.exports = class MarryCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let thingToRoleplay = args.thing; const thingToRoleplay = args.thing;
return message.say(`${message.author} *marries* ${thingToRoleplay}`); return message.say(`${message.author} *marries* ${thingToRoleplay}`);
} }
}; };
+1 -1
View File
@@ -21,7 +21,7 @@ module.exports = class PatCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let thingToRoleplay = args.thing; const thingToRoleplay = args.thing;
return message.say(`${message.author} *pats* ${thingToRoleplay}`); return message.say(`${message.author} *pats* ${thingToRoleplay}`);
} }
}; };
+1 -1
View File
@@ -21,7 +21,7 @@ module.exports = class PokeCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let thingToRoleplay = args.thing; const thingToRoleplay = args.thing;
return message.say(`${message.author} *pokes* ${thingToRoleplay}`); return message.say(`${message.author} *pokes* ${thingToRoleplay}`);
} }
}; };
+1 -1
View File
@@ -21,7 +21,7 @@ module.exports = class PunchCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let thingToRoleplay = args.thing; const thingToRoleplay = args.thing;
return message.say(`${message.author} *punches* ${thingToRoleplay}`); return message.say(`${message.author} *punches* ${thingToRoleplay}`);
} }
}; };
+1 -1
View File
@@ -21,7 +21,7 @@ module.exports = class SlapCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let thingToRoleplay = args.thing; const thingToRoleplay = args.thing;
return message.say(`${message.author} *slaps* ${thingToRoleplay}`); return message.say(`${message.author} *slaps* ${thingToRoleplay}`);
} }
}; };
+4 -4
View File
@@ -27,9 +27,9 @@ module.exports = class AppStoreCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let query = args.query; const query = args.query;
try { try {
let response = await request const response = await request
.get('https://itunes.apple.com/search') .get('https://itunes.apple.com/search')
.query({ .query({
term: query, term: query,
@@ -37,8 +37,8 @@ module.exports = class AppStoreCommand extends commando.Command {
entity: 'software', entity: 'software',
limit: 1 limit: 1
}); });
let parsedResponse = JSON.parse(response.text); const parsedResponse = JSON.parse(response.text);
let data = parsedResponse.results[0]; const data = parsedResponse.results[0];
const embed = new Discord.RichEmbed() const embed = new Discord.RichEmbed()
.setColor(0x1BA3F7) .setColor(0x1BA3F7)
.setAuthor('App Store', 'https://upload.wikimedia.org/wikipedia/en/1/1f/App_Store_Logo.png') .setAuthor('App Store', 'https://upload.wikimedia.org/wikipedia/en/1/1f/App_Store_Logo.png')
+3 -3
View File
@@ -28,14 +28,14 @@ module.exports = class BotSearchCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let botToFind = args.bot.id; const botToFind = args.bot.id;
try { try {
let response = await request const response = await request
.get(`https://bots.discord.pw/api/bots/${botToFind}`) .get(`https://bots.discord.pw/api/bots/${botToFind}`)
.set({ .set({
'Authorization': config.botskey 'Authorization': config.botskey
}); });
let data = response.body; const data = response.body;
const embed = new Discord.RichEmbed() const embed = new Discord.RichEmbed()
.setColor(0x9797FF) .setColor(0x9797FF)
.setAuthor('Discord Bots', 'https://cdn.discordapp.com/icons/110373943822540800/47336ad0631ac7aac0a48a2ba6246c65.jpg') .setAuthor('Discord Bots', 'https://cdn.discordapp.com/icons/110373943822540800/47336ad0631ac7aac0a48a2ba6246c65.jpg')
+3 -3
View File
@@ -30,9 +30,9 @@ module.exports = class DefineCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let defineThis = encodeURI(args.word); const defineThis = encodeURI(args.word);
try { try {
let response = await request const response = await request
.get(`http://api.wordnik.com:80/v4/word.json/${defineThis}/definitions`) .get(`http://api.wordnik.com:80/v4/word.json/${defineThis}/definitions`)
.query({ .query({
limit: 1, limit: 1,
@@ -41,7 +41,7 @@ module.exports = class DefineCommand extends commando.Command {
includeTags: false, includeTags: false,
api_key: config.wordnikkey api_key: config.wordnikkey
}); });
let data = response.body[0]; const data = response.body[0];
const embed = new Discord.RichEmbed() const embed = new Discord.RichEmbed()
.setColor(0x9797FF) .setColor(0x9797FF)
.setTitle(data.word) .setTitle(data.word)
+2 -2
View File
@@ -32,8 +32,8 @@ module.exports = class DiscrimCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let userToSearch = args.discrim; const userToSearch = args.discrim;
let users = await this.client.users.filter(u => u.discriminator === userToSearch).map(u => u.username).sort(); const users = await this.client.users.filter(u => u.discriminator === userToSearch).map(u => u.username).sort();
const embed = new Discord.RichEmbed() const embed = new Discord.RichEmbed()
.setTitle(`${users.length} Users with the discriminator: ${userToSearch}`) .setTitle(`${users.length} Users with the discriminator: ${userToSearch}`)
.setDescription(users.join(', ')); .setDescription(users.join(', '));
+4 -4
View File
@@ -26,16 +26,16 @@ module.exports = class ForecastCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let locationToSearch = args.locationQ; const locationToSearch = args.locationQ;
try { try {
let response = await request const response = await request
.get('https://query.yahooapis.com/v1/public/yql') .get('https://query.yahooapis.com/v1/public/yql')
.query({ .query({
q: `select * from weather.forecast where u='f' AND woeid in (select woeid from geo.places(1) where text="${locationToSearch}")`, q: `select * from weather.forecast where u='f' AND woeid in (select woeid from geo.places(1) where text="${locationToSearch}")`,
format: 'json' format: 'json'
}); });
let info = response.body.query.results.channel; const info = response.body.query.results.channel;
let data = info.item.forecast; const data = info.item.forecast;
const embed = new Discord.RichEmbed() const embed = new Discord.RichEmbed()
.setColor(0x0000FF) .setColor(0x0000FF)
.setAuthor(info.title, 'http://media.idownloadblog.com/wp-content/uploads/2013/12/yahoo-weather-213x220.png') .setAuthor(info.title, 'http://media.idownloadblog.com/wp-content/uploads/2013/12/yahoo-weather-213x220.png')
+3 -3
View File
@@ -27,10 +27,10 @@ module.exports = class GoogleCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let thingToSearch = args.query; const thingToSearch = args.query;
let searchMsg = await message.say('Searching...'); const searchMsg = await message.say('Searching...');
try { try {
let response = await request const response = await request
.get(`https://www.google.com/search`) .get(`https://www.google.com/search`)
.query({ .query({
q: thingToSearch q: thingToSearch
+3 -3
View File
@@ -28,15 +28,15 @@ module.exports = class IMDBCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let queryMovie = args.movie; const queryMovie = args.movie;
try { try {
let response = await request const response = await request
.get(`http://www.omdbapi.com/`) .get(`http://www.omdbapi.com/`)
.query({ .query({
t: queryMovie, t: queryMovie,
plot: 'full' plot: 'full'
}); });
let data = response.body; const data = response.body;
const embed = new Discord.RichEmbed() const embed = new Discord.RichEmbed()
.setColor(0xDBA628) .setColor(0xDBA628)
.setAuthor('IMDB', 'http://static.wixstatic.com/media/c65cbf_31901b544fe24f1890134553bf40c8be.png') .setAuthor('IMDB', 'http://static.wixstatic.com/media/c65cbf_31901b544fe24f1890134553bf40c8be.png')
+1 -1
View File
@@ -21,7 +21,7 @@ module.exports = class NeopetCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let petID = args.pet; const petID = args.pet;
return message.say(`http://pets.neopets.com/cp/${petID}/1/5.png`); return message.say(`http://pets.neopets.com/cp/${petID}/1/5.png`);
} }
}; };
+3 -3
View File
@@ -29,16 +29,16 @@ module.exports = class OsuCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let usernameToSearch = args.username; const usernameToSearch = args.username;
try { try {
let response = await request const response = await request
.get('https://osu.ppy.sh/api/get_user') .get('https://osu.ppy.sh/api/get_user')
.query({ .query({
k: config.osukey, k: config.osukey,
u: usernameToSearch, u: usernameToSearch,
type: 'string' type: 'string'
}); });
let data = response.body[0]; const data = response.body[0];
const embed = new Discord.RichEmbed() const embed = new Discord.RichEmbed()
.setColor(0xFF66AA) .setColor(0xFF66AA)
.setAuthor('osu!', 'http://vignette3.wikia.nocookie.net/osugame/images/c/c9/Logo.png/revision/latest?cb=20151219073209') .setAuthor('osu!', 'http://vignette3.wikia.nocookie.net/osugame/images/c/c9/Logo.png/revision/latest?cb=20151219073209')
+1 -1
View File
@@ -32,7 +32,7 @@ module.exports = class PokedexCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let pokemon = args.pokemon.toLowerCase(); const pokemon = args.pokemon.toLowerCase();
const embed = new Discord.RichEmbed() const embed = new Discord.RichEmbed()
.setTitle('Information') .setTitle('Information')
.setAuthor(`#${pokedex.index[pokemon]} ${pokedex.name[pokemon]}`, `http://www.serebii.net/pokedex-sm/icon/${pokedex.index[pokemon]}.png`) .setAuthor(`#${pokedex.index[pokemon]} ${pokedex.name[pokemon]}`, `http://www.serebii.net/pokedex-sm/icon/${pokedex.index[pokemon]}.png`)
+3 -3
View File
@@ -28,14 +28,14 @@ module.exports = class UrbanDictionary extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let wordToDefine = args.word; const wordToDefine = args.word;
try { try {
let response = await request const response = await request
.get('http://api.urbandictionary.com/v0/define') .get('http://api.urbandictionary.com/v0/define')
.query({ .query({
term: wordToDefine term: wordToDefine
}); });
let data = response.body.list[0]; const data = response.body.list[0];
const embed = new Discord.RichEmbed() const embed = new Discord.RichEmbed()
.setColor(0x32a8f0) .setColor(0x32a8f0)
.setAuthor('Urban Dictionary', 'http://a1.mzstatic.com/eu/r30/Purple71/v4/66/54/68/6654683f-cacd-4a55-1784-f14257f77874/icon175x175.png') .setAuthor('Urban Dictionary', 'http://a1.mzstatic.com/eu/r30/Purple71/v4/66/54/68/6654683f-cacd-4a55-1784-f14257f77874/icon175x175.png')
+3 -3
View File
@@ -24,9 +24,9 @@ module.exports = class WattpadCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let queryBook = args.book; const queryBook = args.book;
try { try {
let response = await request const response = await request
.get('https://api.wattpad.com:443/v4/stories') .get('https://api.wattpad.com:443/v4/stories')
.set({ .set({
'Authorization': `Basic ${config.wattpadkey}` 'Authorization': `Basic ${config.wattpadkey}`
@@ -35,7 +35,7 @@ module.exports = class WattpadCommand extends commando.Command {
query: queryBook, query: queryBook,
limit: 1 limit: 1
}); });
let data = response.body.stories[0]; const data = response.body.stories[0];
const embed = new Discord.RichEmbed() const embed = new Discord.RichEmbed()
.setColor(0xF89C34) .setColor(0xF89C34)
.setAuthor('Wattpad', 'http://www.selfpubtoolbox.com/wp-content/uploads/2015/05/a6044fd3a88acd5043860484db972ca6.png') .setAuthor('Wattpad', 'http://www.selfpubtoolbox.com/wp-content/uploads/2015/05/a6044fd3a88acd5043860484db972ca6.png')
+3 -3
View File
@@ -23,15 +23,15 @@ module.exports = class WeatherCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let locationToSearch = args.locationQ; const locationToSearch = args.locationQ;
try { try {
let response = await request const response = await request
.get('https://query.yahooapis.com/v1/public/yql') .get('https://query.yahooapis.com/v1/public/yql')
.query({ .query({
q: `select * from weather.forecast where u='f' AND woeid in (select woeid from geo.places(1) where text="${locationToSearch}")`, q: `select * from weather.forecast where u='f' AND woeid in (select woeid from geo.places(1) where text="${locationToSearch}")`,
format: 'json' format: 'json'
}); });
let data = response.body.query.results.channel; const data = response.body.query.results.channel;
const embed = new Discord.RichEmbed() const embed = new Discord.RichEmbed()
.setColor(0x0000FF) .setColor(0x0000FF)
.setAuthor(data.title, 'http://media.idownloadblog.com/wp-content/uploads/2013/12/yahoo-weather-213x220.png') .setAuthor(data.title, 'http://media.idownloadblog.com/wp-content/uploads/2013/12/yahoo-weather-213x220.png')
+5 -6
View File
@@ -23,11 +23,10 @@ module.exports = class WikipediaCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let thingToSearch = args.query; const thingToSearch = args.query.split(")").join("%29");
thingToSearch = thingToSearch.split(")").join("%29"); const title = encodeURI(thingToSearch);
let title = encodeURI(thingToSearch);
try { try {
let response = await request const response = await request
.get(`https://en.wikipedia.org/w/api.php`) .get(`https://en.wikipedia.org/w/api.php`)
.query({ .query({
action: 'query', action: 'query',
@@ -39,8 +38,8 @@ module.exports = class WikipediaCommand extends commando.Command {
redirects: '', redirects: '',
formatversion: 2 formatversion: 2
}); });
let data = response.body.query.pages[0]; const data = response.body.query.pages[0];
let description = data.extract.substr(0, 1900).split('\n').join('\n\n'); const description = data.extract.substr(0, 1900).split('\n').join('\n\n');
const embed = new Discord.RichEmbed() const embed = new Discord.RichEmbed()
.setColor(0xE7E7E7) .setColor(0xE7E7E7)
.setTitle(data.title) .setTitle(data.title)
+3 -3
View File
@@ -27,9 +27,9 @@ module.exports = class YouTubeCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let videoToSearch = args.video; const videoToSearch = args.video;
try { try {
let response = await request const response = await request
.get('https://www.googleapis.com/youtube/v3/search') .get('https://www.googleapis.com/youtube/v3/search')
.query({ .query({
part: 'snippet', part: 'snippet',
@@ -38,7 +38,7 @@ module.exports = class YouTubeCommand extends commando.Command {
q: videoToSearch, q: videoToSearch,
key: config.youtubekey key: config.youtubekey
}); });
let data = response.body.items[0]; const data = response.body.items[0];
const embed = new Discord.RichEmbed() const embed = new Discord.RichEmbed()
.setColor(0xDD2825) .setColor(0xDD2825)
.setTitle(data.snippet.title) .setTitle(data.snippet.title)
+3 -3
View File
@@ -23,11 +23,11 @@ module.exports = class YuGiOhCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let cardName = encodeURI(args.card); const cardName = encodeURI(args.card);
try { try {
let response = await request const response = await request
.get(`http://yugiohprices.com/api/card_data/${cardName}`); .get(`http://yugiohprices.com/api/card_data/${cardName}`);
let data = response.body.data; const data = response.body.data;
if (data.card_type === 'monster') { if (data.card_type === 'monster') {
const embed = new Discord.RichEmbed() const embed = new Discord.RichEmbed()
.setColor(0xBE5F1F) .setColor(0xBE5F1F)
+2 -2
View File
@@ -28,8 +28,8 @@ module.exports = class BinaryCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let turnToBinary = args.text; const turnToBinary = args.text;
let binaryText = stringToBinary(turnToBinary); const binaryText = stringToBinary(turnToBinary);
return message.say(binaryText); return message.say(binaryText);
} }
}; };
+1 -1
View File
@@ -22,7 +22,7 @@ module.exports = class CowsayCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let turnToCowsay = args.text; const turnToCowsay = args.text;
return message.code(null, cowsay.say({ return message.code(null, cowsay.say({
text: turnToCowsay, text: turnToCowsay,
e: "oO", e: "oO",
+3 -4
View File
@@ -23,14 +23,13 @@ module.exports = class EmbedCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let embedMessage = message.content.split(" ").slice(1).join(" "); const embedMessage = message.content.split(" ").slice(1).join(" ");
const embed = new Discord.RichEmbed() const embed = new Discord.RichEmbed()
.setAuthor(message.author.username, message.author.avatarURL) .setAuthor(message.author.username, message.author.avatarURL)
.setColor(0x00AE86) .setColor(0x00AE86)
.setTimestamp() .setTimestamp()
.setDescription(embedMessage); .setDescription(embedMessage);
let deleteMsg = await message.delete(); await message.delete();
let embedSend = await message.embed(embed); return message.embed(embed);
return [deleteMsg, embedSend];
} }
}; };
+3 -3
View File
@@ -20,7 +20,7 @@ module.exports = class MorseCommand extends commando.Command {
if (method.toLowerCase() === 'encode' || method.toLowerCase() === 'decode') { if (method.toLowerCase() === 'encode' || method.toLowerCase() === 'decode') {
return true; return true;
} }
return 'Please enter either `encode` or `decode`.' return 'Please enter either `encode` or `decode`.';
} }
}, { }, {
key: 'text', key: 'text',
@@ -35,8 +35,8 @@ module.exports = class MorseCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let methodToUse = args.method.toLowerCase(); const methodToUse = args.method.toLowerCase();
let toMorse = args.text; const toMorse = args.text;
if (methodToUse === 'encode') { if (methodToUse === 'encode') {
return message.say(morse.encode(toMorse)).catch(error => message.say(':x: Error! Something went wrong! Perhaps you entered incorrect text?')); return message.say(morse.encode(toMorse)).catch(error => message.say(':x: Error! Something went wrong! Perhaps you entered incorrect text?'));
} }
+2 -2
View File
@@ -32,8 +32,8 @@ module.exports = class PirateCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let turnToPirate = args.text; const turnToPirate = args.text;
let pirate = pirateSpeak.translate(turnToPirate); const pirate = pirateSpeak.translate(turnToPirate);
if (pirate.length > 1950) return message.say(":x: Error! Your message is too long!"); if (pirate.length > 1950) return message.say(":x: Error! Your message is too long!");
return message.say(pirate); return message.say(pirate);
} }
+2 -2
View File
@@ -21,8 +21,8 @@ module.exports = class ReverseCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let stringToReverse = args.text; const stringToReverse = args.text;
let reversed = stringToReverse.split("").reverse().join(""); const reversed = stringToReverse.split("").reverse().join("");
return message.say(reversed); return message.say(reversed);
} }
}; };
+2 -2
View File
@@ -34,8 +34,8 @@ module.exports = class RomajiCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let romajify = args.kana; const romajify = args.kana;
let romajified = hepburn.fromKana(romajify); const romajified = hepburn.fromKana(romajify);
return message.say(romajified); return message.say(romajified);
} }
}; };
+3 -4
View File
@@ -28,9 +28,8 @@ module.exports = class SayCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'MANAGE_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'MANAGE_MESSAGES'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let copycat = args.text; const copycat = args.text;
let deleteMsg = await message.delete(); await message.delete();
let copyMsg = await message.say(copycat); return message.say(copycat);
return [deleteMsg, copyMsg];
} }
}; };
+1 -1
View File
@@ -33,7 +33,7 @@ module.exports = class ShuffleCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let thingToShuffle = args.text; const thingToShuffle = args.text;
return message.say(thingToShuffle.shuffle()); return message.say(thingToShuffle.shuffle());
} }
}; };
+3 -288
View File
@@ -1,290 +1,5 @@
const commando = require('discord.js-commando'); const commando = require('discord.js-commando');
const temmize = require('./temmize.js');
const dictionary = {
"i": "tem",
"hi": "hoi",
"that": "dat",
"that's": "dat",
"hello": "hoi",
"me": "temmie",
"goodbye": "boi",
"bye": "boi",
"later": "boi",
"college": "colleg",
"money": "muns",
"food": "tem flakes",
"snack": "tem flakes",
"snacks": "tem flakes",
"meal": "tem flakes",
"meals": "tem flakes",
"human": "hooman",
"humans": "hoomans",
"chocolate": "choco",
"cute": "coot",
"allergic": "allergics",
"allergy": "allergics",
"do": "dos",
"does": "dos",
"what": "ppppppppp...",
"who": "ppppppppp...",
"when": "ppppppppp...",
"why": "ppppppppp...",
"where": "ppppppppp...",
"how": "ppppppppp...",
"xd": "xd",
"but": "b-but",
"store": "tem shop",
"restaurant": "tem shop",
"shop": "tem shop",
"temmie": "temmiy",
"sick": "holves",
"illness": "holves",
"ill": "holves",
"disease": "holves",
"cat": "tem",
"dog": 'tem',
"hugs": "pets",
"pats": "pets",
"waves": "pets",
"high-fives": "pets",
"fistbumps": "pets",
"hug": "pet",
"pat": "pet",
"wave": "pet",
"high-five": "pet",
"fistbump": "pet",
"hungry": "hungr",
"muscles": "not coot",
"aw": "awwawa",
"yikes": "omg!",
"ah": "omg!",
"oh": "omg!",
"yipe": "omg!",
"wait": "omg!",
"yes": "yee!",
"no": "no!",
"person": "bark",
"monster": "munster",
"monsters": "munsters",
"great": "tem outta tem",
"awesome": "tem outta tem",
"cool": "tem outta tem",
"nice": "tem outta tem",
"good": "tem outta tem",
"walks": "vibrates",
"moves": "vibrates",
"sits": "vibrates",
"goes": "vibrates",
"runs": "vibrates intensely",
"climbs": "vibrates intensely",
"escapes": "vibrates intensely",
"normal": "bob",
"hmm": "p...",
"okay": "ok",
"lol": "lel",
"enemy": "special enemy",
"villain": "special enemy",
"bad guy": "special enemy",
"badguy": "special enemy",
"school": "skool",
"um": "p...",
"elizabeth": "ebears",
"yeah": "yaya",
"yea": "yaya",
"uh-huh": "yaya",
"vampire": "wampire",
"tired": "*dies*",
"exhausted": "*dies*",
"bored": "*dies*",
"annoyed": "*dies*",
"irritated": "*dies*",
"mad": "*dies*",
"sleepy": "*dies*",
"confused": "*dies*",
"house": "tem villag",
"home": "tem villag",
"apartment": "tem villag",
"world": "undergroun",
"hotel": "mtt resort",
"motel": "mtt resort",
"inn": "mtt resort",
"cash": "g",
"gold": "g",
"jewels": "g",
"aaron": "not coot",
"boy": "tim",
"girl": "tem",
"we": "tems",
"you": "u",
"your": "ur",
"yours": "urs",
"there": "dere",
"proud": "prouds",
"random": "rando",
"see": "c",
"this": "dis",
"egg": "eg",
"very": "very!",
"excited": "excite",
"doesn't": "don't",
"sleep": "slep",
"noodles": "alphys foob",
"scream": "screems",
"gonna": "gunna",
"pasta": "papy foob",
"spaghetti": "papy foob",
"scary": "scaredy",
"frightening": "scaredy",
"worry": "worrys",
"worries": "worrys",
"sushi": "undyne foob",
"banana": "bernerner",
"bananas": "bernerners",
"apple": "oppl",
"apples": "oppls",
"grape": "grep",
"grapes": "greps",
"wonder": "wunders",
"wonders": "wunders",
"wondering": "wunders",
"wonderful": "wunderfull",
"think": "finks",
"thinks": "finks",
"thought": "finked",
"beat": "dunks",
"defeat": "dunks",
"defeated": "dunkd",
"they're": "their",
"their": "there",
"you're": "ur",
"because": "cuz",
"bc": "cuz",
"will": "wil",
"things": "thins",
"thing": "thin",
"science": "scienc",
"ice cream": "noice creem",
"spear": "speer",
"baby": "temini",
"babies": "teminis",
"child": "temini",
"children": "teminis",
"kid": "temini",
"kids": "teminis",
"bot": "xiao",
"robot": "mettatun",
"ghost": "bluuk",
"nap": "slep",
"boop": "blep",
"beep": "blep",
"bleep": "blep",
"bop": "blep",
"spider": "spoider",
"spiders": "sploiders",
"music": "moosics",
"again": "agin",
"the": "teh",
"family": "fam",
"smart": "smarts",
"smartness": "smartiness",
"intelligence": "smartiness",
"typo": "tpyo",
"typo'd": "tyop'd",
"typos": "typoys",
"yay": "yee",
"potato": "tato",
"potatoes": "tatos",
"fry": "fri",
"fries": "fri",
"burger": "glamburg",
"steak": "stek",
"heart": "hart",
"love": "lub",
"hate": "h8",
"like": "liek",
"library": "librarby",
"fire": "flemz",
"flame": "flemz",
"fires": "flemz",
"flames": "flemz",
"witchcraft": "magics",
"witchcrafts": "magics",
"magic": "magics",
"sorcery": "magics",
"superpower": "magics",
"superpowers": "magics",
"sorceries": "magics",
"and": "n",
"my": "tem's",
"mine": "tem's",
"everyone": "everytem",
"anyone": "anytem",
"someone": "sometem",
"everbody": "everytemmie",
"anybody": "anytemmie",
"somebody": "sometemmie",
"beautiful": "booftifull",
"pretty": "prety",
"so": "soooo",
"help": "halp",
"uh-uh": "nuh",
"nope": "nuh",
"nuh-uh": "nuh",
"please": "pls"
};
function translateWord(word) {
let wordTranslate = dictionary[word.toLowerCase()];
if (wordTranslate === undefined) return word;
else return applyCase(word, wordTranslate);
}
function applyCase(wordA, wordB) {
if (wordA.length === 1 && wordB.length !== 1) return wordB;
if (wordA === wordA.toUpperCase()) return wordB.toUpperCase();
if (wordA === wordA.toLowerCase()) return wordB.toLowerCase();
let firstChar = wordA.slice(0, 1);
let otherChars = wordA.slice(1);
if (firstChar === firstChar.toUpperCase() && otherChars === otherChars.toLowerCase()) {
return wordB.slice(0, 1).toUpperCase() + wordB.slice(1).toLowerCase();
}
return wordB;
}
function isLetter(character) {
if (character.search(/[a-zA-Z'-]/) === -1) return false;
return true;
}
function translator(text) {
let translatedText = "";
let word = "";
for (let i = 0; i < text.length; i += 1) {
let character = text[i];
if (isLetter(character)) {
word += character;
}
else {
if (word != "") {
let wordTranslate = translateWord(word);
translatedText += wordTranslate;
word = "";
}
translatedText += character;
}
}
if (word !== "") translatedText += translateWord(word);
return translatedText;
}
const temmize = function(text) {
let currentTranslation = translator(text);
let temmify = currentTranslation.split("ing").join("in").split("!").join("!!!!111!11!1!!!1!!!1111!").split("'").join("");
return temmify;
};
module.exports = class TemmieCommand extends commando.Command { module.exports = class TemmieCommand extends commando.Command {
constructor(Client) { constructor(Client) {
@@ -313,8 +28,8 @@ module.exports = class TemmieCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let thingToTranslate = args.text; const thingToTranslate = args.text;
let temmized = temmize(thingToTranslate); const temmized = temmize(thingToTranslate);
return message.say(temmized); return message.say(temmized);
} }
}; };
+285
View File
@@ -0,0 +1,285 @@
const dictionary = {
"i": "tem",
"hi": "hoi",
"that": "dat",
"that's": "dat",
"hello": "hoi",
"me": "temmie",
"goodbye": "boi",
"bye": "boi",
"later": "boi",
"college": "colleg",
"money": "muns",
"food": "tem flakes",
"snack": "tem flakes",
"snacks": "tem flakes",
"meal": "tem flakes",
"meals": "tem flakes",
"human": "hooman",
"humans": "hoomans",
"chocolate": "choco",
"cute": "coot",
"allergic": "allergics",
"allergy": "allergics",
"do": "dos",
"does": "dos",
"what": "ppppppppp...",
"who": "ppppppppp...",
"when": "ppppppppp...",
"why": "ppppppppp...",
"where": "ppppppppp...",
"how": "ppppppppp...",
"xd": "xd",
"but": "b-but",
"store": "tem shop",
"restaurant": "tem shop",
"shop": "tem shop",
"temmie": "temmiy",
"sick": "holves",
"illness": "holves",
"ill": "holves",
"disease": "holves",
"cat": "tem",
"dog": 'tem',
"hugs": "pets",
"pats": "pets",
"waves": "pets",
"high-fives": "pets",
"fistbumps": "pets",
"hug": "pet",
"pat": "pet",
"wave": "pet",
"high-five": "pet",
"fistbump": "pet",
"hungry": "hungr",
"muscles": "not coot",
"aw": "awwawa",
"yikes": "omg!",
"ah": "omg!",
"oh": "omg!",
"yipe": "omg!",
"wait": "omg!",
"yes": "yee!",
"no": "no!",
"person": "bark",
"monster": "munster",
"monsters": "munsters",
"great": "tem outta tem",
"awesome": "tem outta tem",
"cool": "tem outta tem",
"nice": "tem outta tem",
"good": "tem outta tem",
"walks": "vibrates",
"moves": "vibrates",
"sits": "vibrates",
"goes": "vibrates",
"runs": "vibrates intensely",
"climbs": "vibrates intensely",
"escapes": "vibrates intensely",
"normal": "bob",
"hmm": "p...",
"okay": "ok",
"lol": "lel",
"enemy": "special enemy",
"villain": "special enemy",
"bad guy": "special enemy",
"badguy": "special enemy",
"school": "skool",
"um": "p...",
"elizabeth": "ebears",
"yeah": "yaya",
"yea": "yaya",
"uh-huh": "yaya",
"vampire": "wampire",
"tired": "*dies*",
"exhausted": "*dies*",
"bored": "*dies*",
"annoyed": "*dies*",
"irritated": "*dies*",
"mad": "*dies*",
"sleepy": "*dies*",
"confused": "*dies*",
"house": "tem villag",
"home": "tem villag",
"apartment": "tem villag",
"world": "undergroun",
"hotel": "mtt resort",
"motel": "mtt resort",
"inn": "mtt resort",
"cash": "g",
"gold": "g",
"jewels": "g",
"aaron": "not coot",
"boy": "tim",
"girl": "tem",
"we": "tems",
"you": "u",
"your": "ur",
"yours": "urs",
"there": "dere",
"proud": "prouds",
"random": "rando",
"see": "c",
"this": "dis",
"egg": "eg",
"very": "very!",
"excited": "excite",
"doesn't": "don't",
"sleep": "slep",
"noodles": "alphys foob",
"scream": "screems",
"gonna": "gunna",
"pasta": "papy foob",
"spaghetti": "papy foob",
"scary": "scaredy",
"frightening": "scaredy",
"worry": "worrys",
"worries": "worrys",
"sushi": "undyne foob",
"banana": "bernerner",
"bananas": "bernerners",
"apple": "oppl",
"apples": "oppls",
"grape": "grep",
"grapes": "greps",
"wonder": "wunders",
"wonders": "wunders",
"wondering": "wunders",
"wonderful": "wunderfull",
"think": "finks",
"thinks": "finks",
"thought": "finked",
"beat": "dunks",
"defeat": "dunks",
"defeated": "dunkd",
"they're": "their",
"their": "there",
"you're": "ur",
"because": "cuz",
"bc": "cuz",
"will": "wil",
"things": "thins",
"thing": "thin",
"science": "scienc",
"ice cream": "noice creem",
"spear": "speer",
"baby": "temini",
"babies": "teminis",
"child": "temini",
"children": "teminis",
"kid": "temini",
"kids": "teminis",
"bot": "xiao",
"robot": "mettatun",
"ghost": "bluuk",
"nap": "slep",
"boop": "blep",
"beep": "blep",
"bleep": "blep",
"bop": "blep",
"spider": "spoider",
"spiders": "sploiders",
"music": "moosics",
"again": "agin",
"the": "teh",
"family": "fam",
"smart": "smarts",
"smartness": "smartiness",
"intelligence": "smartiness",
"typo": "tpyo",
"typo'd": "tyop'd",
"typos": "typoys",
"yay": "yee",
"potato": "tato",
"potatoes": "tatos",
"fry": "fri",
"fries": "fri",
"burger": "glamburg",
"steak": "stek",
"heart": "hart",
"love": "lub",
"hate": "h8",
"like": "liek",
"library": "librarby",
"fire": "flemz",
"flame": "flemz",
"fires": "flemz",
"flames": "flemz",
"witchcraft": "magics",
"witchcrafts": "magics",
"magic": "magics",
"sorcery": "magics",
"superpower": "magics",
"superpowers": "magics",
"sorceries": "magics",
"and": "n",
"my": "tem's",
"mine": "tem's",
"everyone": "everytem",
"anyone": "anytem",
"someone": "sometem",
"everbody": "everytemmie",
"anybody": "anytemmie",
"somebody": "sometemmie",
"beautiful": "booftifull",
"pretty": "prety",
"so": "soooo",
"help": "halp",
"uh-uh": "nuh",
"nope": "nuh",
"nuh-uh": "nuh",
"please": "pls"
};
function translateWord(word) {
let wordTranslate = dictionary[word.toLowerCase()];
if (wordTranslate === undefined) return word;
else return applyCase(word, wordTranslate);
}
function applyCase(wordA, wordB) {
if (wordA.length === 1 && wordB.length !== 1) return wordB;
if (wordA === wordA.toUpperCase()) return wordB.toUpperCase();
if (wordA === wordA.toLowerCase()) return wordB.toLowerCase();
let firstChar = wordA.slice(0, 1);
let otherChars = wordA.slice(1);
if (firstChar === firstChar.toUpperCase() && otherChars === otherChars.toLowerCase()) {
return wordB.slice(0, 1).toUpperCase() + wordB.slice(1).toLowerCase();
}
return wordB;
}
function isLetter(character) {
if (character.search(/[a-zA-Z'-]/) === -1) return false;
return true;
}
function translator(text) {
let translatedText = "";
let word = "";
for (let i = 0; i < text.length; i += 1) {
let character = text[i];
if (isLetter(character)) {
word += character;
}
else {
if (word != "") {
let wordTranslate = translateWord(word);
translatedText += wordTranslate;
word = "";
}
translatedText += character;
}
}
if (word !== "") translatedText += translateWord(word);
return translatedText;
}
module.exports = function(text) {
let currentTranslation = translator(text);
let temmify = currentTranslation.split("ing").join("in").split("!").join("!!!!111!11!1!!!1!!!1111!").split("'").join("");
return temmify;
};
+4 -4
View File
@@ -146,13 +146,13 @@ module.exports = class TranslateCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let languageto = args.to.toLowerCase(); const languageto = args.to.toLowerCase();
let thingToTranslate = args.text; const thingToTranslate = args.text;
try { try {
let res = await translate(thingToTranslate, { const res = await translate(thingToTranslate, {
to: languageto to: languageto
}); });
let languagefrom = res.from.language.iso.toLowerCase(); const languagefrom = res.from.language.iso.toLowerCase();
const embed = new Discord.RichEmbed() const embed = new Discord.RichEmbed()
.setColor(0x00AE86) .setColor(0x00AE86)
.addField(`Input (From: ${languages[languagefrom]}):`, .addField(`Input (From: ${languages[languagefrom]}):`,
+4 -4
View File
@@ -31,15 +31,15 @@ module.exports = class WebhookCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'MANAGE_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'MANAGE_MESSAGES'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let content = args.text; const content = args.text;
try { try {
let post = await request await message.delete();
const post = await request
.post(config.webhook) .post(config.webhook)
.send({ .send({
content: content content: content
}); });
let deleteMsg = await message.delete(); return post;
return [post, deleteMsg];
} }
catch (err) { catch (err) {
return message.say(':x: Error! Message failed to send!'); return message.say(':x: Error! Message failed to send!');
+2 -2
View File
@@ -23,9 +23,9 @@ module.exports = class YodaCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let turnToYoda = args.text; const turnToYoda = args.text;
try { try {
let response = await request const response = await request
.get('https://yoda.p.mashape.com/yoda') .get('https://yoda.p.mashape.com/yoda')
.set({ .set({
'X-Mashape-Key': config.mashapekey, 'X-Mashape-Key': config.mashapekey,
+1 -1
View File
@@ -28,7 +28,7 @@ module.exports = class ZalgoCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let zalgoified = zalgo(args.text); const zalgoified = zalgo(args.text);
return message.say(zalgoified); return message.say(zalgoified);
} }
}; };
+1 -1
View File
@@ -21,7 +21,7 @@ module.exports = class AvatarCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let user = args.user; const user = args.user;
return message.say(user.displayAvatarURL); return message.say(user.displayAvatarURL);
} }
}; };
+3 -9
View File
@@ -30,7 +30,7 @@ module.exports = class UserInfoCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let user = args.user; const user = args.user;
let stat; let stat;
let color; let color;
switch (user.presence.status) { switch (user.presence.status) {
@@ -51,13 +51,7 @@ module.exports = class UserInfoCommand extends commando.Command {
color = 0x808080; color = 0x808080;
break; break;
} }
let userGame; const userGame = user.presence.game;
if (!user.presence.game) {
userGame = "None";
}
else {
userGame = user.presence.game.name;
}
const embed = new Discord.RichEmbed() const embed = new Discord.RichEmbed()
.setColor(color) .setColor(color)
.setThumbnail(user.displayAvatarURL) .setThumbnail(user.displayAvatarURL)
@@ -72,7 +66,7 @@ module.exports = class UserInfoCommand extends commando.Command {
.addField('**Status:**', .addField('**Status:**',
stat, true) stat, true)
.addField('**Playing:**', .addField('**Playing:**',
userGame, true); userGame.name || 'None', true);
return message.embed(embed); return message.embed(embed);
} }
}; };
+2 -2
View File
@@ -22,8 +22,8 @@ module.exports = class ServersCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
} }
console.log(`[Command] ${message.content}`); console.log(`[Command] ${message.content}`);
let guildCount = this.client.guilds.size; const guildCount = this.client.guilds.size;
let guildNames = this.client.guilds.map(g => `${g.name} (${g.id})`).join(", "); const guildNames = this.client.guilds.map(g => `${g.name} (${g.id})`).join(", ");
console.log(`${guildCount} Servers: ${guildNames}`); console.log(`${guildCount} Servers: ${guildNames}`);
return message.say("Sent the information to the console!"); return message.say("Sent the information to the console!");
} }
+2 -2
View File
@@ -35,7 +35,7 @@ client.registry
client.on('guildCreate', async(guild) => { client.on('guildCreate', async(guild) => {
console.log(`[Guild] I have joined the guild: ${guild.name}, Owned by: ${guild.owner.user.username} (${guild.id})!`); console.log(`[Guild] I have joined the guild: ${guild.name}, Owned by: ${guild.owner.user.username} (${guild.id})!`);
client.guilds.get(config.server).channels.get(config.announcementChannel).send(`I have joined the server: ${guild.name}, Owned by: ${guild.owner.user.username} (${guild.id})!`); client.guilds.get(config.server).channels.get(config.announcementChannel).send(`I have joined the server: ${guild.name}, Owned by: ${guild.owner.user.username} (${guild.id})!`);
let results = await client.shard.fetchClientValues('guilds.size'); const results = await client.shard.fetchClientValues('guilds.size');
console.log(`[Guild Count] ${results.reduce((prev, val) => prev + val, 0)}`); console.log(`[Guild Count] ${results.reduce((prev, val) => prev + val, 0)}`);
try { try {
let response = await request let response = await request
@@ -68,7 +68,7 @@ client.on('guildCreate', async(guild) => {
client.on('guildDelete', async(guild) => { client.on('guildDelete', async(guild) => {
console.log(`[Guild] I have left the guild: ${guild.name}, Owned by: ${guild.owner.user.username} (${guild.id})...`); console.log(`[Guild] I have left the guild: ${guild.name}, Owned by: ${guild.owner.user.username} (${guild.id})...`);
client.guilds.get(config.server).channels.get(config.announcementChannel).send(`I have left the server: ${guild.name}, Owned by: ${guild.owner.user.username} (${guild.id})...`); client.guilds.get(config.server).channels.get(config.announcementChannel).send(`I have left the server: ${guild.name}, Owned by: ${guild.owner.user.username} (${guild.id})...`);
let results = await client.shard.fetchClientValues('guilds.size'); const results = await client.shard.fetchClientValues('guilds.size');
console.log(`[Guild Count] ${results.reduce((prev, val) => prev + val, 0)}`); console.log(`[Guild Count] ${results.reduce((prev, val) => prev + val, 0)}`);
try { try {
let response = await request let response = await request