args and more

This commit is contained in:
Daniel Odendahl Jr
2017-03-25 04:16:27 +00:00
parent 8dd6ec1f9b
commit e2a4a92990
82 changed files with 1089 additions and 1021 deletions
+5 -7
View File
@@ -12,13 +12,11 @@ module.exports = class YearsCommand extends commando.Command {
memberName: '3000years',
description: "It's been 3000 years... (;3000years @User)",
examples: [';3000years @user'],
args: [
{
key: 'user',
prompt: 'Which user would you like to edit the avatar of?\n',
type: 'user'
}
]
args: [{
key: 'user',
prompt: 'Which user would you like to edit the avatar of?',
type: 'user'
}]
});
}
+10 -10
View File
@@ -11,22 +11,22 @@ module.exports = class BeautifulCommand extends commando.Command {
group: 'avataredit',
memberName: 'beautiful',
description: 'Oh, this? This is beautiful. (;beautiful @User)',
examples: [';beautiful @User']
examples: [';beautiful @User'],
args: [{
key: 'user',
prompt: 'Which user would you like to edit the avatar of?',
type: 'user'
}]
});
}
async run(message) {
async run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return;
}
console.log(`[Command] ${message.content}`);
if (message.mentions.users.size !== 1) {
return message.channel.send(':x: Error! Please mention one user!');
}
else if (!message.mentions.users.first().avatarURL) {
return message.channel.send(":x: Error! This user has no avatar!");
}
let userAvatar = message.mentions.users.first().avatarURL;
let user = args.user;
let userAvatar = user.displayAvatarURL;
userAvatar = userAvatar.replace(".jpg", ".png");
userAvatar = userAvatar.replace(".gif", ".png");
let images = [];
@@ -38,7 +38,7 @@ module.exports = class BeautifulCommand extends commando.Command {
avatar.resize(190, 190);
beautiful.blit(avatar, 451, 434);
beautiful.getBuffer(Jimp.MIME_PNG, (err, buff) => {
if (err) return;
if (err) return message.channel.send(':x: Error! Something went wrong!');
return message.channel.sendFile(buff);
});
}
+10 -10
View File
@@ -12,22 +12,22 @@ module.exports = class BobRossCommand extends commando.Command {
group: 'avataredit',
memberName: 'bobross',
description: "Make Bob Ross draw your avatar. (;bobross @User)",
examples: [';bobross @User']
examples: [';bobross @User'],
args: [{
key: 'user',
prompt: 'Which user would you like to edit the avatar of?',
type: 'user'
}]
});
}
async run(message) {
async run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return;
}
console.log(`[Command] ${message.content}`);
if (message.mentions.users.size !== 1) {
return message.channel.send(':x: Error! Please mention one user!');
}
else if (!message.mentions.users.first().avatarURL) {
return message.channel.send(":x: Error! This user has no avatar!");
}
let userAvatar = message.mentions.users.first().avatarURL;
let user = args.user;
let userAvatar = user.displayAvatarURL;
userAvatar = userAvatar.replace(".jpg", ".png");
userAvatar = userAvatar.replace(".gif", ".png");
let images = [];
@@ -40,7 +40,7 @@ module.exports = class BobRossCommand extends commando.Command {
nothing.composite(avatar, 44, 85);
nothing.composite(bob, 0, 0);
nothing.getBuffer(Jimp.MIME_PNG, (err, buff) => {
if (err) return;
if (err) return message.channel.send(':x: Error! Something went wrong!');
return message.channel.sendFile(buff);
});
}
+10 -10
View File
@@ -12,22 +12,22 @@ module.exports = class RIPCommand extends commando.Command {
group: 'avataredit',
memberName: 'rip',
description: 'Puts a profile picture over a gravestone. (;rip @User)',
examples: [';rip @User']
examples: [';rip @User'],
args: [{
key: 'user',
prompt: 'Which user would you like to edit the avatar of?',
type: 'user'
}]
});
}
async run(message) {
async run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return;
}
console.log(`[Command] ${message.content}`);
if (message.mentions.users.size !== 1) {
return message.channel.send(':x: Error! Please mention one user!');
}
else if (!message.mentions.users.first().avatarURL) {
return message.channel.send(":x: Error! This user has no avatar!");
}
let userAvatar = message.mentions.users.first().avatarURL;
let user = args.user;
let userAvatar = user.displayAvatarURL;
userAvatar = userAvatar.replace(".jpg", ".png");
userAvatar = userAvatar.replace(".gif", ".png");
let images = [];
@@ -37,7 +37,7 @@ module.exports = class RIPCommand extends commando.Command {
avatar.resize(200, 200);
gravestone.blit(avatar, 60, 65);
gravestone.getBuffer(Jimp.MIME_PNG, (err, buff) => {
if (err) return;
if (err) return message.channel.send(':x: Error! Something went wrong!');
return message.channel.sendFile(buff);
});
}
+12 -14
View File
@@ -11,26 +11,24 @@ module.exports = class SteamCardCommand extends commando.Command {
group: 'avataredit',
memberName: 'steamcard',
description: "Put an avatar on a Steam Card. (;steamcard @User)",
examples: [';steamcard @user']
examples: [';steamcard @user'],
guildOnly: true,
args: [{
key: 'user',
prompt: 'Which user would you like to edit the avatar of?',
type: 'user'
}]
});
}
async run(message) {
async run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return;
}
console.log(`[Command] ${message.content}`);
if (message.channel.type === 'dm') {
return message.channel.send(':x: Error! This command does not work in DM!');
}
else if (message.mentions.users.size !== 1) {
return message.channel.send(':x: Error! Please mention one user!');
}
else if (!message.mentions.users.first().avatarURL) {
return message.channel.send(":x: Error! This user has no avatar!");
}
let userDisplayName = message.guild.member(message.mentions.users.first()).displayName;
let userAvatar = message.mentions.users.first().avatarURL;
let user = args.user;
let userDisplayName = message.guild.member(args.user).displayName;
let userAvatar = user.displayAvatarURL;
userAvatar = userAvatar.replace(".jpg", ".png");
userAvatar = userAvatar.replace(".gif", ".png");
let images = [];
@@ -44,7 +42,7 @@ module.exports = class SteamCardCommand extends commando.Command {
nothing.composite(steamcard, 0, 0);
nothing.print(font, 38, 20, userDisplayName);
nothing.getBuffer(Jimp.MIME_PNG, (err, buff) => {
if (err) return;
if (err) return message.channel.send(':x: Error! Something went wrong!');
return message.channel.sendFile(buff);
});
}
+14 -12
View File
@@ -14,24 +14,26 @@ module.exports = class ContactCommand extends commando.Command {
group: 'botinfo',
memberName: 'contact',
description: 'Report bugs or request new features. (;contact Fix this command!)',
examples: [';contact Fix this command!']
examples: [';contact Fix this command!'],
args: [{
key: 'report',
prompt: 'What would you like to report?',
type: 'string'
}]
});
}
hasPermission(msg) {
return !banlist.banned[msg.author.id];
}
run(message) {
async run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
console.log(`[Command] ${message.content}`);
let banID = message.author.id;
let messageToReport = message.content.split(" ").slice(1).join(" ");
if (message.author.id === banlist.banned[banID]) {
return message.channel.send("Sorry, you've been banned from using this command.");
}
else if (!messageToReport) {
return message.channel.send(':x: Error! Please do not report nothing!');
}
this.client.users.get(config.owner).send(`**${message.author.username}#${message.author.discriminator} (${message.author.id}):**\n${messageToReport}`);
return message.channel.send('Message Sent! Thanks for your support!');
let messageToReport = args.report;
let reportedMsg = await this.client.users.get(config.owner).send(`**${message.author.username}#${message.author.discriminator} (${message.author.id}):**\n${messageToReport}`);
let successMsg = await message.channel.send('Message Sent! Thanks for your support!');
return [reportedMsg, successMsg];
}
};
@@ -4,7 +4,7 @@ module.exports = class LotteryCommand extends commando.Command {
constructor(Client) {
super(Client, {
name: 'lottery',
group: 'random',
group: 'games',
memberName: 'lottery',
description: '1 in 100 Chance of Winning. Winners get... The feeling of winning? (;lottery)',
examples: [';lottery']
@@ -17,11 +17,7 @@ module.exports = class LotteryCommand extends commando.Command {
}
console.log(`[Command] ${message.content}`);
let lotteryNumber = ['Winner'][Math.floor(Math.random() * 100)];
if (lotteryNumber === "Winner") {
return message.channel.send(`Wow ${message.author.username}! You actually won! Great job!`);
}
else {
return message.channel.send(`Nope, sorry ${message.author.username}, you lost.`);
}
if (lotteryNumber !== "Winner") return message.channel.send(`Nope, sorry ${message.author.username}, you lost.`);
return message.channel.send(`Wow ${message.author.username}! You actually won! Great job!`);
}
};
@@ -5,20 +5,28 @@ const math = require('mathjs');
module.exports = class MathGameCommand extends commando.Command {
constructor(Client) {
super(Client, {
name: 'mathgame',
name: 'games',
group: 'random',
memberName: 'mathgame',
description: 'See how fast you can answer a math problem in a given time limit. (;mathgame easy)',
examples: [';mathgame easy', ';mathgame medium', ';mathgame hard', ';mathgame extreme']
examples: [';mathgame easy', ';mathgame medium', ';mathgame hard', ';mathgame extreme'],
args: [{
key: 'difficulty',
prompt: 'What difficulty should the math game be? Easy, Medium, Hard, or Extreme?',
type: 'string',
validate: (str) => {
str.toLowerCase() === 'easy' || str.toLowerCase() === 'medium' || str.toLowerCase() === 'hard' || str.toLowerCase() === 'extreme';
}
}]
});
}
async run(message) {
async run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
}
console.log(`[Command] ${message.content}`);
let [level] = message.content.toLowerCase().split(" ").slice(1);
let level = args.difficulty;
let randomType = ['+', '-', '*'];
randomType = randomType[Math.floor(Math.random() * randomType.length)];
let randomValue;
@@ -40,25 +48,22 @@ module.exports = class MathGameCommand extends commando.Command {
let randomValue2 = Math.floor(Math.random() * randomValue) + 1;
let randomExpression = randomValue1 + randomType + randomValue2;
let solved = math.eval(randomExpression);
if (!randomValue) {
return message.channel.send(':x: Error! No difficulty set! (Choose Easy, Medium, Hard, or Extreme)');
const embed = new Discord.RichEmbed()
.setTitle('You have **ten** seconds to answer:')
.setDescription(randomExpression);
let embedMsg = await message.channel.sendEmbed(embed);
try {
let collected = await message.channel.awaitMessages(response => response.content === solved.toString() && response.author.id === message.author.id, {
max: 1,
time: 10000,
errors: ['time'],
});
let victoryMsg = await message.channel.send(`Good Job! You won! ${solved} is the correct answer!`);
return [embedMsg, collected, victoryMsg];
}
else {
const embed = new Discord.RichEmbed()
.setTitle('You have **ten** seconds to answer:')
.setDescription(randomExpression);
let embedMsg = await message.channel.sendEmbed(embed);
try {
let collected = await message.channel.awaitMessages(response => response.content === solved.toString() && response.author.id === message.author.id, {
max: 1,
time: 10000,
errors: ['time'],
});
return message.channel.send(`Good Job! You won! ${solved} is the correct answer!`);
}
catch (err) {
return message.channel.send(`Aw... Too bad, try again next time!\nThe correct answer is: ${solved}`);
}
catch (err) {
let loseMsg = await message.channel.send(`Aw... Too bad, try again next time!\nThe correct answer is: ${solved}`);
return [embedMsg, loseMsg];
}
}
};
@@ -9,7 +9,7 @@ module.exports = class QuizCommand extends commando.Command {
aliases: [
'jeopardy'
],
group: 'random',
group: 'games',
memberName: 'quiz',
description: 'Answer a quiz question. (;quiz)',
examples: [';quiz']
@@ -38,10 +38,12 @@ module.exports = class QuizCommand extends commando.Command {
time: 15000,
errors: ['time']
});
return message.channel.send(`Good Job! You won! ${answer} is the correct answer!`);
let victoryMsg = await message.channel.send(`Good Job! You won! ${answer} is the correct answer!`);
return [embedMsg, collected, victoryMsg];
}
catch (err) {
return message.channel.send(`Aw... Too bad, try again next time!\nThe Correct Answer was: ${answer}`);
let loseMsg = await message.channel.send(`Aw... Too bad, try again next time!\nThe Correct Answer was: ${answer}`);
return [embedMsg, loseMsg];
}
}
catch (err) {
@@ -7,25 +7,30 @@ module.exports = class RockPaperScissors extends commando.Command {
aliases: [
'rockpaperscissors'
],
group: 'response',
group: 'games',
memberName: 'rps',
description: 'Play Rock Paper Scissors (;rps Rock)',
examples: [';rps Rock']
examples: [';rps Rock'],
args: [{
key: 'choice',
prompt: 'Rock, Paper, or Scissors?',
type: 'string',
validate: (str) => {
str.toLowerCase() === 'rock' || str.toLowerCase() === 'paper' || str.toLowerCase() === 'scissors';
}
}]
});
}
run(message) {
run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
console.log(`[Command] ${message.content}`);
let [rps] = message.content.toLowerCase().split(" ").slice(1);
let rps = args.choice;
let response = ['Paper', 'Rock', 'Scissors'];
response = response[Math.floor(Math.random() * response.length)];
if (!rps) {
return message.channel.send(":x: Error! Your message contains nothing!");
}
else if (rps.includes("rock")) {
if (rps.includes("rock")) {
if (response === "Rock") {
return message.channel.send("Rock! Aw, it's a tie!");
}
@@ -58,8 +63,5 @@ module.exports = class RockPaperScissors extends commando.Command {
return message.channel.send("Scissors! Aw, it's a tie!");
}
}
else {
return message.channel.send(":x: Error! Your choice is not Rock, Paper, or Scissors!");
}
}
};
@@ -4,7 +4,7 @@ module.exports = class SlotsCommand extends commando.Command {
constructor(Client) {
super(Client, {
name: 'slots',
group: 'response',
group: 'games',
memberName: 'slots',
description: 'Play slots. (;slots)',
examples: [';slots']
@@ -5,19 +5,27 @@ module.exports = class TypingGameCommand extends commando.Command {
constructor(Client) {
super(Client, {
name: 'typinggame',
group: 'random',
group: 'games',
memberName: 'typinggame',
description: 'See how fast you can type a sentence in a given time limit. (;typinggame easy)',
examples: [';typinggame easy', ';typinggame medium', ';typinggame hard', ';typinggame extreme']
examples: [';typinggame easy', ';typinggame medium', ';typinggame hard', ';typinggame extreme'],
args: [{
key: 'difficulty',
prompt: 'What difficulty should the typing game be? Easy, Medium, Hard, or Extreme?',
type: 'string',
validate: (str) => {
str.toLowerCase() === 'easy' || str.toLowerCase() === 'medium' || str.toLowerCase() === 'hard' || str.toLowerCase() === 'extreme';
}
}]
});
}
async run(message) {
async run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
}
console.log(`[Command] ${message.content}`);
let [level] = message.content.toLowerCase().split(" ").slice(1);
let level = args.difficulty;
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)];
let time;
@@ -50,25 +58,22 @@ module.exports = class TypingGameCommand extends commando.Command {
levelWord = "ten";
break;
}
if (!time) {
return message.channel.send(':x: Error! No difficulty set! (Choose Easy, Medium, Hard, or Extreme)');
const embed = new Discord.RichEmbed()
.setTitle(`You have **${levelWord}** seconds to type:`)
.setDescription(randomSentence);
let embedMsg = await message.channel.sendEmbed(embed);
try {
let collected = await message.channel.awaitMessages(response => response.content === randomSentence && response.author.id === message.author.id, {
max: 1,
time: time,
errors: ['time']
});
let victoryMsg = await message.channel.send(`Good Job! You won!`);
return [embedMsg, collected, victoryMsg];
}
else {
const embed = new Discord.RichEmbed()
.setTitle(`You have **${levelWord}** seconds to type:`)
.setDescription(randomSentence);
let embedMsg = await message.channel.sendEmbed(embed);
try {
let collected = await message.channel.awaitMessages(response => response.content === randomSentence && response.author.id === message.author.id, {
max: 1,
time: time,
errors: ['time']
});
return message.channel.send(`Good Job! You won!`);
}
catch (err) {
return message.channel.send('Aw... Too bad, try again next time!');
}
catch (err) {
let loseMsg = await message.channel.send('Aw... Too bad, try again next time!');
return [embedMsg, loseMsg];
}
}
};
+2 -4
View File
@@ -12,7 +12,8 @@ module.exports = class EmojiCommand extends commando.Command {
group: 'guildinfo',
memberName: 'emoji',
description: "Gives a list of the current server's emoji. (;emoji)",
examples: [';emoji']
examples: [';emoji'],
guildOnly: true
});
}
@@ -21,9 +22,6 @@ module.exports = class EmojiCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
console.log(`[Command] ${message.content}`);
if (message.channel.type === 'dm') {
return message.channel.send(":x: Error! This command does not work in DM!");
}
return message.channel.send(message.guild.emojis.map(e => e).join(" "));
}
};
+2 -4
View File
@@ -15,7 +15,8 @@ module.exports = class GuildInfoCommand extends commando.Command {
group: 'guildinfo',
memberName: 'server',
description: 'Gives some info on the current server. (;server)',
examples: [';server']
examples: [';server'],
guildOnly: true
});
}
@@ -24,9 +25,6 @@ module.exports = class GuildInfoCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
}
console.log(`[Command] ${message.content}`);
if (message.channel.type === 'dm') {
return message.channel.send(":x: Error! This command does not work in DM!");
}
const embed = new Discord.RichEmbed()
.setColor(0x00AE86)
.setThumbnail(message.guild.iconURL)
+27 -37
View File
@@ -108,49 +108,39 @@ module.exports = class MemeCommand extends commando.Command {
group: 'imageedit',
memberName: 'meme',
description: "Sends a Meme with text of your choice, and a background of your choice. Split first and second lines with a | (;meme facepalm I can't even | comprehend this)",
examples: [";meme facepalm I can't even | comprehend this", ";meme list"]
examples: [";meme facepalm I can't even | comprehend this", ";meme list"],
args: [{
key: 'type',
prompt: 'What meme type do you want to use?',
type: 'string',
validate: (str) => {
memecodes[str] || str === 'list';
}
}, {
key: 'content',
prompt: 'What should the meme content be?',
type: 'string',
validate: (str) => {
str.includes(" | ") && str.match(/^[a-zA-Z0-9|.,!?'-\s]+$/);
}
}]
});
}
run(message) {
run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return;
}
console.log(`[Command] ${message.content}`);
let [type] = message.content.toLowerCase().split(" ").slice(1);
if (type === "list") {
return message.channel.send("**Type Codes:** tenguy, afraid, older, aag, tried, biw, blb, kermit, bd, ch, cbg, wonka, cb, keanu, dsm, live, ants, doge, alwaysonbeat, ermg, facepalm, fwp, fa, fbf, fry, hipster, icanhas, crazypills, mw, noidea, regret, boat, hagrid, sohappy, captain, inigo, iw, ackbar, happening, joker, ive, ll, morpheus, mb, badchoice, mmm, jetpack, red, mordor, oprah, oag, remembers, philosoraptor, jw, patrick, rollsafe, sad-obama, sad-clinton, sadfrog, sad-bush, sad-biden, sad-boehner, saltbae, sarcasticbear, dwight, sb, ss, sf, dodgson, money, sohot, nice, awesome-awkward, awesome, awkward-awesome, awkward, fetch, success, scc, ski, officespace, interesting, toohigh, bs, center, both, winter, xy, buzz, yodawg, uno, yallgot, bad, elf, chosen");
}
else if (message.content.includes(" | ")) {
if (message.content.split(" ").slice(1).join(" ").match(/^[a-zA-Z0-9|.,!?'-\s]+$/)) {
let memeQuery = message.content.split(" ").slice(2).join("-").split('-|-');
let toprow = memeQuery[0].split("?").join("~q");
let bottomrow = memeQuery[1].split("?").join("~q");
let link = `https://memegen.link/${type}/${toprow}/${bottomrow}.jpg`;
if (bottomrow.length > 100) {
return message.channel.send(":x: Error! Bottom text is over 100 characters!");
}
else if (toprow.length > 100) {
return message.channel.send(":x: Error! Top text is over 100 characters!");
}
else {
if (memecodes[type]) {
return message.channel.sendFile(link).catch(err => {
console.log(err);
message.channel.send(":x: An Error Occurred! Please try again later!");
});
}
else {
return message.channel.send(":x: Error! Meme type not found! Use `;meme list` to view of list of meme codes!");
}
}
}
else {
return message.channel.send(":x: Error! Only letters, numbers, periods, commas, apostrophes, exclamation points, and question marks are allowed!");
}
}
else {
return message.channel.send(":x: Split your two choices with a ' | '!");
}
let type = args.type;
let content = args.content;
if (type === "list") return message.channel.send("**Type Codes:** tenguy, afraid, older, aag, tried, biw, blb, kermit, bd, ch, cbg, wonka, cb, keanu, dsm, live, ants, doge, alwaysonbeat, ermg, facepalm, fwp, fa, fbf, fry, hipster, icanhas, crazypills, mw, noidea, regret, boat, hagrid, sohappy, captain, inigo, iw, ackbar, happening, joker, ive, ll, morpheus, mb, badchoice, mmm, jetpack, red, mordor, oprah, oag, remembers, philosoraptor, jw, patrick, rollsafe, sad-obama, sad-clinton, sadfrog, sad-bush, sad-biden, sad-boehner, saltbae, sarcasticbear, dwight, sb, ss, sf, dodgson, money, sohot, nice, awesome-awkward, awesome, awkward-awesome, awkward, fetch, success, scc, ski, officespace, interesting, toohigh, bs, center, both, winter, xy, buzz, yodawg, uno, yallgot, bad, elf, chosen");
let memeQuery = content.split(" ").join("-").split("-|-");
let toprow = memeQuery[0].split("?").join("~q");
let bottomrow = memeQuery[1].split("?").join("~q");
let link = `https://memegen.link/${type}/${toprow}/${bottomrow}.jpg`;
if (bottomrow.length > 100) return message.channel.send(":x: Error! Bottom text is over 100 characters!");
if (toprow.length > 100) return message.channel.send(":x: Error! Top text is over 100 characters!");
return message.channel.sendFile(link).catch(err => message.channel.send(':x: Error! Something went wrong!'));
}
};
+26 -34
View File
@@ -11,49 +11,41 @@ module.exports = class BanCommand extends commando.Command {
group: 'moderation',
memberName: 'ban',
description: 'Bans a user. (;ban @User being a jerk.)',
examples: [";ban @User being a jerk."]
examples: [";ban @User being a jerk."],
guildOnly: true,
args: [{
key: 'member',
prompt: 'What member do you want to ban?',
type: 'member'
}, {
key: 'reason',
prompt: 'What do you want to set the reason as?',
type: 'string'
}]
});
}
hasPermission(msg) {
if (msg.channel.type === 'dm') return;
return msg.member.hasPermission('BAN_MEMBERS');
}
run(message) {
async run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS', 'BAN_MEMBERS'])) return;
}
console.log(`[Command] ${message.content}`);
if (message.channel.type !== 'dm') {
let userToBan = message.mentions.users.first();
let reason = message.content.split(" ").slice(2).join(" ");
if (message.mentions.users.size !== 1) {
return message.channel.send(":x: Error! Please mention one user!");
}
else {
if (message.guild.member(userToBan).bannable) {
message.channel.send(":ok_hand:");
message.guild.member(userToBan).ban();
if (message.guild.channels.exists("name", "mod_logs")) {
const embed = new Discord.RichEmbed()
.setAuthor(`${message.author.username}#${message.author.discriminator}`, message.author.avatarURL)
.setColor(0xFF0000)
.setFooter('XiaoBot Moderation', this.client.user.avatarURL)
.setTimestamp()
.setDescription(`**Member:** ${userToBan.username}#${userToBan.discriminator} (${userToBan.id})\n**Action:** Ban\n**Reason:** ${reason}`);
return message.guild.channels.find('name', 'mod_logs').sendEmbed(embed);
}
else {
return message.channel.send(":notepad_spiral: **Note: No log will be sent, as there is not a channel named 'mod_logs'. Please create it to use the logging feature.**");
}
}
else {
return message.channel.send(":x: Error! This member cannot be banned! Perhaps they have a higher role than me?");
}
}
}
else {
return message.channel.send(":x: Error! This command does not work in DM!");
}
if (!message.guild.channels.exists("name", "mod_logs")) return message.channel.send(":x: Error! Could not find the mod_logs channel! Please create it!");
let member = args.member;
let reason = args.reason;
if (!message.guild.member(member).bannable) return message.channel.send(":x: Error! This member cannot be banned! Perhaps they have a higher role than me?");
let banUser = await message.guild.member(member).ban();
let okHandMsg = await message.channel.send(":ok_hand:");
const embed = new Discord.RichEmbed()
.setAuthor(`${message.author.username}#${message.author.discriminator}`, message.author.avatarURL)
.setColor(0xFF0000)
.setFooter('XiaoBot Moderation', this.client.user.avatarURL)
.setTimestamp()
.setDescription(`**Member:** ${member.username}#${member.discriminator} (${member.id})\n**Action:** Ban\n**Reason:** ${reason}`);
let modLogMsg = await message.guild.channels.find('name', 'mod_logs').sendEmbed(embed);
return [banUser, okHandMsg, modLogMsg];
}
};
+26 -34
View File
@@ -8,49 +8,41 @@ module.exports = class KickCommand extends commando.Command {
group: 'moderation',
memberName: 'kick',
description: 'Kicks a user. (;kick @User being a jerk.)',
examples: [";kick @User being a jerk."]
examples: [";kick @User being a jerk."],
guildOnly: true,
args: [{
key: 'member',
prompt: 'What member do you want to kick?',
type: 'member'
}, {
key: 'reason',
prompt: 'What do you want to set the reason as?',
type: 'string'
}]
});
}
hasPermission(msg) {
if (msg.channel.type === 'dm') return;
return msg.member.hasPermission('KICK_MEMBERS');
}
run(message) {
async run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS', 'KICK_MEMBERS'])) return;
}
console.log(`[Command] ${message.content}`);
if (message.channel.type !== 'dm') {
let userToKick = message.mentions.users.first();
let reason = message.content.split(" ").slice(2).join(" ");
if (message.mentions.users.size !== 1) {
return message.channel.send(":x: Error! Please mention one user!");
}
else {
if (message.guild.member(userToKick).kickable) {
message.channel.send(":ok_hand:");
message.guild.member(userToKick).kick();
if (message.guild.channels.exists("name", "mod_logs")) {
const embed = new Discord.RichEmbed()
.setAuthor(`${message.author.username}#${message.author.discriminator}`, message.author.avatarURL)
.setColor(0xFFA500)
.setFooter('XiaoBot Moderation', this.client.user.avatarURL)
.setTimestamp()
.setDescription(`**Member:** ${userToKick.username}#${userToKick.discriminator} (${userToKick.id})\n**Action:** Kick\n**Reason:** ${reason}`);
return message.guild.channels.find('name', 'mod_logs').sendEmbed(embed);
}
else {
return message.channel.send(":notepad_spiral: **Note: No log will be sent, as there is not a channel named 'mod_logs'. Please create it to use the logging feature.**");
}
}
else {
return message.channel.send(":x: Error! This member cannot be kicked! Perhaps they have a higher role than me?");
}
}
}
else {
return message.channel.send(":x: Error! This command does not work in DM!");
}
if (!message.guild.channels.exists("name", "mod_logs")) return message.channel.send(":x: Error! Could not find the mod_logs channel! Please create it!");
let member = args.member;
let reason = args.reason;
if (!message.guild.member(member).bannable) return message.channel.send(":x: Error! This member cannot be kicked! Perhaps they have a higher role than me?");
let kickUser = await message.guild.member(member).kick();
let okHandMsg = await message.channel.send(":ok_hand:");
const embed = new Discord.RichEmbed()
.setAuthor(`${message.author.username}#${message.author.discriminator}`, message.author.avatarURL)
.setColor(0xFFA500)
.setFooter('XiaoBot Moderation', this.client.user.avatarURL)
.setTimestamp()
.setDescription(`**Member:** ${member.username}#${member.discriminator} (${member.id})\n**Action:** Kick\n**Reason:** ${reason}`);
let modLogMsg = await message.guild.channels.find('name', 'mod_logs').sendEmbed(embed);
return [kickUser, okHandMsg, modLogMsg];
}
};
+24 -28
View File
@@ -8,43 +8,39 @@ module.exports = class WarnCommand extends commando.Command {
group: 'moderation',
memberName: 'warn',
description: 'Warns a user. (;warn @User being a jerk)',
examples: [";warn @User being a jerk."]
examples: [";warn @User being a jerk."],
guildOnly: true,
args: [{
key: 'member',
prompt: 'What member do you want to warn?',
type: 'member'
}, {
key: 'reason',
prompt: 'What do you want to set the reason as?',
type: 'string'
}]
});
}
hasPermission(msg) {
if (msg.channel.type === 'dm') return;
return msg.member.hasPermission('MANAGE_MESSAGES');
}
run(message) {
async run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
}
console.log(`[Command] ${message.content}`);
if (message.channel.type !== 'dm') {
let userToWarn = message.mentions.users.first();
let reason = message.content.split(" ").slice(2).join(" ");
if (message.mentions.users.size !== 1) {
return message.channel.send(":x: Error! Please mention one user!");
}
else {
message.channel.send(":ok_hand:");
if (message.guild.channels.exists("name", "mod_logs")) {
const embed = new Discord.RichEmbed()
.setAuthor(`${message.author.username}#${message.author.discriminator}`, message.author.avatarURL)
.setColor(0xFFFF00)
.setFooter('XiaoBot Moderation', this.client.user.avatarURL)
.setTimestamp()
.setDescription(`**Member:** ${userToWarn.username}#${userToWarn.discriminator} (${userToWarn.id})\n**Action:** Warn\n**Reason:** ${reason}`);
return message.guild.channels.find('name', 'mod_logs').sendEmbed(embed);
}
else {
return message.channel.send("**Note: No log will be sent, as there is not a channel named 'mod_logs'. Please create it to use the logging feature.**");
}
}
}
else {
return message.channel.send(":x: Error! This command does not work in DM!");
}
let userToWarn = args.member;
let reason = args.reason;
if (!message.guild.channels.exists("name", "mod_logs")) return message.channel.send(":x: Error! Could not find the mod_logs channel! Please create it!");
let okHandMsg = await message.channel.send(":ok_hand:");
const embed = new Discord.RichEmbed()
.setAuthor(`${message.author.username}#${message.author.discriminator}`, message.author.avatarURL)
.setColor(0xFFFF00)
.setFooter('XiaoBot Moderation', this.client.user.avatarURL)
.setTimestamp()
.setDescription(`**Member:** ${userToWarn.username}#${userToWarn.discriminator} (${userToWarn.id})\n**Action:** Warn\n**Reason:** ${reason}`);
let modLogMsg = await message.guild.channels.find('name', 'mod_logs').sendEmbed(embed);
return [okHandMsg, modLogMsg];
}
};
+9 -7
View File
@@ -14,22 +14,24 @@ module.exports = class MathCommand extends commando.Command {
group: 'numedit',
memberName: 'math',
description: 'Does Math (;math 2 + 2)',
examples: [';math 2 + 2']
examples: [';math 2 + 2'],
args: [{
key: 'expression',
prompt: 'What do you want to answer?',
type: 'string'
}]
});
}
run(message) {
run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
console.log(`[Command] ${message.content}`);
let expression = message.content.split(" ").slice(1).join(" ");
let expression = args.expression;
try {
let solved = math.eval(expression);
return message.channel.send(solved).catch(err => {
console.log(err);
message.channel.send(":x: Error! Invalid statement!");
});
return message.channel.send(solved).catch(err => message.channel.send(":x: Error! Invalid statement!"));
}
catch (err) {
return message.channel.send(":x: Error! Invalid statement!");
+11 -10
View File
@@ -8,22 +8,23 @@ module.exports = class RomanCommand extends commando.Command {
group: 'numedit',
memberName: 'roman',
description: 'Converts numbers to Roman Numerals. (;roman 2)',
examples: [';roman 2']
examples: [';roman 2'],
args: [{
key: 'number',
prompt: 'What do you want to convert to Roman?',
type: 'integer'
}]
});
}
run(message) {
run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
console.log(`[Command] ${message.content}`);
let numberToRoman = message.content.split(" ").slice(1).join(" ");
let romanInterger = Number(numberToRoman);
if (romanInterger > 1000000) {
return message.channel.send(':x: Error! Number is too high!');
}
else {
return message.channel.send(romanNumeralConverter.getRomanFromInteger(romanInterger)).catch(error => message.channel.send(':x: Error! Translation is too long, or nothing was entered!'));
}
let numberToRoman = args.number;
let romanInterger = numberToRoman;
if (romanInterger > 1000000) return message.channel.send(':x: Error! Number is too high!');
return message.channel.send(romanNumeralConverter.getRomanFromInteger(romanInterger));
}
};
+8 -3
View File
@@ -12,16 +12,21 @@ module.exports = class RemindCommand extends commando.Command {
group: 'random',
memberName: 'remind',
description: 'Reminds you of something at a certain time. (;remind Eat Food tomorrow)',
examples: [';remind Eat Food tomorrow']
examples: [';remind Eat Food tomorrow'],
args: [{
key: 'remind',
prompt: 'What should I remind you of?',
type: 'string'
}]
});
}
async run(message) {
async run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
console.log(`[Command] ${message.content}`);
let remindMe = message.content.split(" ").slice(1).join(" ");
let remindMe = args.remind;
try {
let remindTime = sherlock.parse(remindMe);
let time = remindTime.startDate.getTime() - Date.now();
+26 -49
View File
@@ -12,61 +12,38 @@ module.exports = class SoundBoardCommand extends commando.Command {
group: 'random',
memberName: 'soundboard',
description: 'Plays a sound in your voice channel. (;soundboard cat)',
examples: [';soundboard cat']
examples: [';soundboard cat'],
guildOnly: true,
args: [{
key: 'sound',
prompt: 'What sound do you want me to play?',
type: 'string'
}]
});
}
async run(message) {
async run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'CONNECT', 'SPEAK', 'ADD_REACTIONS'])) return;
}
console.log(`[Command] ${message.content}`);
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['CONNECT', 'SPEAK', 'ADD_REACTIONS'])) {
return message.channel.send(':x: Error! In order to do this command, you must give me the permissions to "Connect" and "Speak", as well as the permission to Add Reactions!');
}
else {
let voiceChannel = message.member.voiceChannel;
if (!voiceChannel) {
return message.channel.send(`:x: Error! Please be in a voice channel first!`);
}
else {
let soundToPlay = message.content.toLowerCase().split(" ").slice(1).join(" ");
if (!soundToPlay) {
return message.channel.send(':x: Error! No sound set. Please use ;soundboard list to see a list of sounds you can play.');
}
else if (soundToPlay === 'list') {
return message.channel.send("**Available 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");
}
else if (soundToPlay === sounds.avaliable[soundToPlay]) {
let alreadyConnected = await this.client.voiceConnections.get(voiceChannel.guild.id);
if (alreadyConnected) {
if (alreadyConnected.channel.id === voiceChannel.id) {
return message.channel.send(':x: Error! I am already playing a sound!');
}
else {
return message.channel.send(':x: Error! I am already playing a sound!');
}
}
else {
let connection = await voiceChannel.join();
let stream = sounds.paths[soundToPlay];
let dispatcher = connection.playStream(stream);
message.react('🔊');
dispatcher.on('end', () => {
message.react('✅');
return voiceChannel.leave();
});
}
}
else {
return message.channel.send(':x: Error! Sound not found! Use `;soundboard list` to see a list of sounds you can play.');
}
}
}
}
else {
return message.channel.send(':x: This is a DM!');
let voiceChannel = message.member.voiceChannel;
if (!voiceChannel) return message.channel.send(`:x: Error! Please be in a voice channel first!`);
let soundToPlay = args.sound;
if (soundToPlay === 'list') return message.channel.send("**Available 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");
if (soundToPlay !== sounds.avaliable[soundToPlay]) return message.channel.send(':x: Error! Sound not found! Use `;soundboard list` to see a list of sounds you can play.');
let alreadyConnected = await this.client.voiceConnections.get(voiceChannel.guild.id);
if (alreadyConnected) {
if (alreadyConnected.channel.id === voiceChannel.id) return message.channel.send(':x: Error! I am already playing a sound!');
return message.channel.send(':x: Error! I am already playing a sound!');
}
let connection = await voiceChannel.join();
let stream = sounds.paths[soundToPlay];
let dispatcher = connection.playStream(stream);
message.react('🔊');
dispatcher.on('end', () => {
message.react('✅');
return voiceChannel.leave();
});
}
};
+8 -6
View File
@@ -7,21 +7,23 @@ module.exports = class MagicBall extends commando.Command {
group: 'response',
memberName: '8ball',
description: 'Predicts your future. (;8ball Am I stupid?)',
examples: [';8ball <INSERT QUESTION HERE>']
examples: [';8ball <INSERT QUESTION HERE>'],
args: [{
key: 'question',
prompt: 'What do you want to ask the 8 ball?',
type: 'string'
}]
});
}
run(message) {
run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
console.log(`[Command] ${message.content}`);
let question = message.content.split(" ").slice(1).join(" ");
let 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.'];
answers = answers[Math.floor(Math.random() * answers.length)];
if (!question) {
question = "Not Specified.";
}
return message.channel.send(`Question: ${question}\n:8ball: ${answers} :8ball:`);
}
};
+13 -10
View File
@@ -10,22 +10,25 @@ module.exports = class ChooseCommand extends commando.Command {
group: 'response',
memberName: 'choose',
description: 'Chooses between things. (;choose Cow | Sheep)',
examples: [';choose Cow | Sheep', ';choose Bark | Woof | Meow | Moo']
examples: [';choose Cow | Sheep', ';choose Bark | Woof | Meow | Moo'],
args: [{
key: 'choices',
prompt: 'What choices do you want me pick from? Split them with " | "!',
type: 'string',
validate: (str) => {
str.includes(" | ");
}
}]
});
}
run(message) {
run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
console.log(`[Command] ${message.content}`);
if (message.content.includes(" | ")) {
let choices = message.content.split(" ").slice(1).join(" ").split(' | ');
choices = choices[Math.floor(Math.random() * choices.length)];
return message.channel.send(`I choose ${choices}!`);
}
else {
return message.channel.send(":x: Split your two choices with a ' | '!");
}
let choices = args.choices.split(' | ');
choices = choices[Math.floor(Math.random() * choices.length)];
return message.channel.send(`I choose ${choices}!`);
}
};
+10 -9
View File
@@ -7,23 +7,24 @@ module.exports = class ComplimentCommand extends commando.Command {
group: 'response',
memberName: 'compliment',
description: 'Compliments the user of your choice. (;compliment @User)',
examples: [';compliment @User']
examples: [';compliment @User'],
args: [{
key: 'thing',
prompt: 'What do you want to compliment?',
type: 'string',
default: ''
}]
});
}
run(message) {
run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
console.log(`[Command] ${message.content}`);
let thingToCompliment = message.content.split(" ").slice(1).join(" ");
let 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."];
compliments = compliments[Math.floor(Math.random() * compliments.length)];
if (!thingToCompliment) {
return message.reply(compliments);
}
else {
return message.channel.send(`${thingToCompliment}, ${compliments}`);
}
return message.channel.send(`${thingToCompliment}, ${compliments}`);
}
};
+9 -9
View File
@@ -11,21 +11,21 @@ module.exports = class MotivateCommand extends commando.Command {
group: 'response',
memberName: 'motivate',
description: 'Motivates someone. (;motivate @User)',
examples: [';motivate @User']
examples: [';motivate @User'],
args: [{
key: 'thing',
prompt: 'What do you want to motivate?',
type: 'string'
}]
});
}
run(message) {
run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
console.log(`[Command] ${message.content}`);
let userToMotivate = message.content.split(" ").slice(1).join(" ");
if (!userToMotivate) {
return message.reply('https://www.youtube.com/watch?v=ZXsQAXx_ao0');
}
else {
return message.channel.send(`${userToMotivate}, https://www.youtube.com/watch?v=ZXsQAXx_ao0`);
}
let userToMotivate = args.thing || message.author;
return message.channel.send(`${userToMotivate}, https://www.youtube.com/watch?v=ZXsQAXx_ao0`);
}
};
+13 -9
View File
@@ -11,11 +11,19 @@ module.exports = class RandomNameGen extends commando.Command {
group: 'response',
memberName: 'name',
description: 'Generates a random name (;name Male)',
examples: [';name', ';name male', ';name female']
examples: [';name', ';name male', ';name female'],
args: [{
key: 'gender',
prompt: 'Which gender do you want to generate a name for?',
type: 'string',
validate: (str) => {
str.toLowerCase() === 'male' || str.toLowerCase() === 'female';
}
}]
});
}
run(message) {
run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
@@ -26,16 +34,12 @@ module.exports = class RandomNameGen extends commando.Command {
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"];
randomLast = randomLast[Math.floor(Math.random() * randomLast.length)];
let randomFirstBoth = [randomFirstMale, randomFirstFemale];
randomFirstBoth = randomFirstBoth[Math.floor(Math.random() * randomFirstBoth.length)];
if (message.content.toLowerCase().split(" ").slice(1).includes("male")) {
let gender = args.gender;
if (gender === "male") {
return message.channel.send(`${randomFirstMale} ${randomLast}`);
}
else if (message.content.toLowerCase().split(" ").slice(1).includes("female")) {
else if (gender === "female") {
return message.channel.send(`${randomFirstFemale} ${randomLast}`);
}
else {
return message.channel.send(`${randomFirstBoth} ${randomLast}`);
}
}
};
+3
View File
@@ -4,6 +4,9 @@ module.exports = class PotatoCommand extends commando.Command {
constructor(Client) {
super(Client, {
name: 'potato',
aliases: [
'tater'
],
group: 'response',
memberName: 'potato',
description: 'Sends a random Potato picture. (;potato)',
+8 -3
View File
@@ -10,16 +10,21 @@ module.exports = class RateWaifuCommand extends commando.Command {
group: 'response',
memberName: 'ratewaifu',
description: 'Rates your Waifu. (;ratewaifu Xiao Pai)',
examples: [';ratewaifu Xiao Pai']
examples: [';ratewaifu Xiao Pai'],
args: [{
key: 'waifu',
prompt: 'Who do you want to rate?',
type: 'string'
}]
});
}
run(message) {
run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
console.log(`[Command] ${message.content}`);
let waifuToRate = message.content.split(" ").slice(1).join(" ");
let waifuToRate = args.waifu;
let rating = Math.floor(Math.random() * 10) + 1;
return message.channel.send(`I'd give ${waifuToRate} a ${rating}/10!`);
}
+9 -3
View File
@@ -10,16 +10,22 @@ module.exports = class RoastMeCommand extends commando.Command {
group: 'response',
memberName: 'roast',
description: 'Roasts the user of your choice. (;roast @User)',
examples: [';roast @username']
examples: [';roast @username'],
args: [{
key: 'thing',
prompt: 'What do you want to roast?',
type: 'string',
default: ''
}]
});
}
run(message) {
run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
console.log(`[Command] ${message.content}`);
let userToRoast = message.content.split(" ").slice(1).join(" ");
let 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."];
roasts = roasts[Math.floor(Math.random() * roasts.length)];
if (!userToRoast) {
+11 -14
View File
@@ -11,26 +11,23 @@ module.exports = class RollChooseCommand extends commando.Command {
group: 'response',
memberName: 'roll',
description: 'Rolls a Dice of your choice. (;roll 6)',
examples: [';roll 6']
examples: [';roll 6'],
args: [{
key: 'number',
prompt: 'Which number do you want to roll?',
type: 'integer',
default: 6
}]
});
}
run(message) {
run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
console.log(`[Command] ${message.content}`);
let [value] = message.content.split(" ").slice(1);
if (!value) {
let roll = Math.floor(Math.random() * 6) + 1;
return message.channel.send(`You rolled a ${roll}.`);
}
else if (value.match(/^[0-9]+$/)) {
let roll = Math.floor(Math.random() * value) + 1;
return message.channel.send(`You rolled a ${roll}.`);
}
else {
return message.channel.send(":x: Error! Your message either contains a number but the number is invalid, or the number is in the wrong place.\n:notepad_spiral: (Note: When using numbers such as 1,000, do not use a comma)");
}
let value = args.number;
let roll = Math.floor(Math.random() * value) + 1;
return message.channel.send(`You rolled a ${roll}.`);
}
};
+3 -7
View File
@@ -13,7 +13,8 @@ module.exports = class RouletteCommand extends commando.Command {
group: 'response',
memberName: 'roulette',
description: 'Chooses a random member. (;roulette Who is the best?)',
examples: [";roulette Who is the best?"]
examples: [";roulette Who is the best?"],
guildOnly: true
});
}
@@ -22,11 +23,6 @@ module.exports = class RouletteCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
console.log(`[Command] ${message.content}`);
if (message.channel.type !== 'dm') {
return message.channel.send(`I choose ${message.guild.members.random().displayName}!`);
}
else {
return message.channel.send(':x: Error! This command does not work in DM!');
}
return message.channel.send(`I choose ${message.guild.members.random().displayName}!`);
}
};
+8 -3
View File
@@ -10,16 +10,21 @@ module.exports = class ShipCommand extends commando.Command {
group: 'response',
memberName: 'ship',
description: 'Ships two people. (;ship @Rem and @Nate)',
examples: [';ship @Rem and @Nate']
examples: [';ship @Rem and @Nate'],
args: [{
key: 'things',
prompt: 'What do you want to ship together?',
type: 'string'
}]
});
}
run(message) {
run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
console.log(`[Command] ${message.content}`);
let thingToShip = message.content.split(" ").slice(1).join(" ");
let thingToShip = args.things;
let percentage = Math.floor(Math.random() * 100) + 1;
return message.channel.send(`I'd give ${thingToShip} a ${percentage}%!`);
}
+8 -3
View File
@@ -7,16 +7,21 @@ module.exports = class CuddleCommand extends commando.Command {
group: 'roleplay',
memberName: 'cuddle',
description: 'Cuddles someone. (;cuddle @User)',
examples: [';cuddle @User']
examples: [';cuddle @User'],
args: [{
key: 'thing',
prompt: 'What do you want to roleplay with?',
type: 'string'
}]
});
}
run(message) {
run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
console.log(`[Command] ${message.content}`);
let thingToRoleplay = message.content.split(" ").slice(1).join(" ");
let thingToRoleplay = args.thing;
return message.channel.send(`${message.author} *cuddles* ${thingToRoleplay}`);
}
};
+8 -3
View File
@@ -7,16 +7,21 @@ module.exports = class DivorceCommand extends commando.Command {
group: 'roleplay',
memberName: 'divorce',
description: 'Divorces someone. (;divorce @User)',
examples: [';divorce @User']
examples: [';divorce @User'],
args: [{
key: 'thing',
prompt: 'What do you want to roleplay with?',
type: 'string'
}]
});
}
run(message) {
run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
console.log(`[Command] ${message.content}`);
let thingToRoleplay = message.content.split(" ").slice(1).join(" ");
let thingToRoleplay = args.thing;
return message.channel.send(`${message.author} *divorces* ${thingToRoleplay}`);
}
};
+8 -3
View File
@@ -7,16 +7,21 @@ module.exports = class EatCommand extends commando.Command {
group: 'roleplay',
memberName: 'eat',
description: 'Eats something/someone. (;eat @User)',
examples: [';eat @User']
examples: [';eat @User'],
args: [{
key: 'thing',
prompt: 'What do you want to roleplay with?',
type: 'string'
}]
});
}
run(message) {
run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
console.log(`[Command] ${message.content}`);
let thingToRoleplay = message.content.split(" ").slice(1).join(" ");
let thingToRoleplay = args.thing;
return message.channel.send(`${message.author} *eats* ${thingToRoleplay}`);
}
};
+8 -3
View File
@@ -7,16 +7,21 @@ module.exports = class FalconPunchCommand extends commando.Command {
group: 'roleplay',
memberName: 'falconpunch',
description: 'Falcon Punches someone. (;falconpunch @User)',
examples: [';falconpunch @User']
examples: [';falconpunch @User'],
args: [{
key: 'thing',
prompt: 'What do you want to roleplay with?',
type: 'string'
}]
});
}
run(message) {
run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
console.log(`[Command] ${message.content}`);
let thingToRoleplay = message.content.split(" ").slice(1).join(" ");
let thingToRoleplay = args.thing;
return message.channel.send(`${message.author} *falcon punches* ${thingToRoleplay}`);
}
};
+8 -3
View File
@@ -7,16 +7,21 @@ module.exports = class FistBumpCommand extends commando.Command {
group: 'roleplay',
memberName: 'fistbump',
description: 'Fistbumps someone. (;fistbump @User)',
examples: [';fistbump @User']
examples: [';fistbump @User'],
args: [{
key: 'thing',
prompt: 'What do you want to roleplay with?',
type: 'string'
}]
});
}
run(message) {
run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
console.log(`[Command] ${message.content}`);
let thingToRoleplay = message.content.split(" ").slice(1).join(" ");
let thingToRoleplay = args.thing;
return message.channel.send(`${message.author} *fist-bumps* ${thingToRoleplay} *badalalala*`);
}
};
+8 -3
View File
@@ -7,16 +7,21 @@ module.exports = class HighFivesCommand extends commando.Command {
group: 'roleplay',
memberName: 'highfive',
description: 'High Fives someone. (;highfive @User)',
examples: [';highfive @User']
examples: [';highfive @User'],
args: [{
key: 'thing',
prompt: 'What do you want to roleplay with?',
type: 'string'
}]
});
}
run(message) {
run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
console.log(`[Command] ${message.content}`);
let thingToRoleplay = message.content.split(" ").slice(1).join(" ");
let thingToRoleplay = args.thing;
return message.channel.send(`${message.author} *high-fives* ${thingToRoleplay}`);
}
};
+8 -3
View File
@@ -7,16 +7,21 @@ module.exports = class HitwithShovelCommand extends commando.Command {
group: 'roleplay',
memberName: 'hitwithsovel',
description: 'Hits someone with a shovel. (;hitwithshovel @User)',
examples: [';hitwithshovel @User']
examples: [';hitwithshovel @User'],
args: [{
key: 'thing',
prompt: 'What do you want to roleplay with?',
type: 'string'
}]
});
}
run(message) {
run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
console.log(`[Command] ${message.content}`);
let thingToRoleplay = message.content.split(" ").slice(1).join(" ");
let thingToRoleplay = args.thing;
return message.channel.send(`${message.author} *hits* ${thingToRoleplay} *with a shovel*`);
}
};
+8 -3
View File
@@ -7,16 +7,21 @@ module.exports = class HugCommand extends commando.Command {
group: 'roleplay',
memberName: 'hug',
description: 'Hugs someone. (;hug @User)',
examples: [';hug @User']
examples: [';hug @User'],
args: [{
key: 'thing',
prompt: 'What do you want to roleplay with?',
type: 'string'
}]
});
}
run(message) {
run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
console.log(`[Command] ${message.content}`);
let thingToRoleplay = message.content.split(" ").slice(1).join(" ");
let thingToRoleplay = args.thing;
return message.channel.send(`${message.author} *hugs* ${thingToRoleplay}`);
}
};
+8 -3
View File
@@ -7,16 +7,21 @@ module.exports = class InhaleCommand extends commando.Command {
group: 'roleplay',
memberName: 'inhale',
description: 'Inhales someone. (;inhale @User)',
examples: [';inhale @User']
examples: [';inhale @User'],
args: [{
key: 'thing',
prompt: 'What do you want to roleplay with?',
type: 'string'
}]
});
}
run(message) {
run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
console.log(`[Command] ${message.content}`);
let thingToRoleplay = message.content.split(" ").slice(1).join(" ");
let thingToRoleplay = args.thing;
return message.channel.send(`${message.author} *inhales* ${thingToRoleplay} *but gained no ability...*`);
}
};
+8 -3
View File
@@ -7,16 +7,21 @@ module.exports = class KillCommand extends commando.Command {
group: 'roleplay',
memberName: 'kill',
description: 'Kills someone. (;kill @User)',
examples: [';kill @User']
examples: [';kill @User'],
args: [{
key: 'thing',
prompt: 'What do you want to roleplay with?',
type: 'string'
}]
});
}
run(message) {
run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
console.log(`[Command] ${message.content}`);
let thingToRoleplay = message.content.split(" ").slice(1).join(" ");
let thingToRoleplay = args.thing;
return message.channel.send(`${message.author} *kills* ${thingToRoleplay}`);
}
};
+8 -3
View File
@@ -7,16 +7,21 @@ module.exports = class KissCommand extends commando.Command {
group: 'roleplay',
memberName: 'kiss',
description: 'Kisses someone. (;kiss @User)',
examples: [';kiss @User']
examples: [';kiss @User'],
args: [{
key: 'thing',
prompt: 'What do you want to roleplay with?',
type: 'string'
}]
});
}
run(message) {
run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
console.log(`[Command] ${message.content}`);
let thingToRoleplay = message.content.split(" ").slice(1).join(" ");
let thingToRoleplay = args.thing;
return message.channel.send(`${message.author} *kisses* ${thingToRoleplay}`);
}
};
+8 -3
View File
@@ -7,16 +7,21 @@ module.exports = class MarryCommand extends commando.Command {
group: 'roleplay',
memberName: 'marry',
description: 'Marries someone. (;marry @User)',
examples: [';marry @User']
examples: [';marry @User'],
args: [{
key: 'thing',
prompt: 'What do you want to roleplay with?',
type: 'string'
}]
});
}
run(message) {
run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
console.log(`[Command] ${message.content}`);
let thingToRoleplay = message.content.split(" ").slice(1).join(" ");
let thingToRoleplay = args.thing;
return message.channel.send(`${message.author} *marries* ${thingToRoleplay}`);
}
};
+8 -3
View File
@@ -7,16 +7,21 @@ module.exports = class PatCommand extends commando.Command {
group: 'roleplay',
memberName: 'pat',
description: 'Pats someone. (;pat @User)',
examples: [';pat @User']
examples: [';pat @User'],
args: [{
key: 'thing',
prompt: 'What do you want to roleplay with?',
type: 'string'
}]
});
}
run(message) {
run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
console.log(`[Command] ${message.content}`);
let thingToRoleplay = message.content.split(" ").slice(1).join(" ");
let thingToRoleplay = args.thing;
return message.channel.send(`${message.author} *pats* ${thingToRoleplay}`);
}
};
+8 -3
View File
@@ -7,16 +7,21 @@ module.exports = class PokeCommand extends commando.Command {
group: 'roleplay',
memberName: 'poke',
description: 'Pokes someone. (;poke @User)',
examples: [';poke @User']
examples: [';poke @User'],
args: [{
key: 'thing',
prompt: 'What do you want to roleplay with?',
type: 'string'
}]
});
}
run(message) {
run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
console.log(`[Command] ${message.content}`);
let thingToRoleplay = message.content.split(" ").slice(1).join(" ");
let thingToRoleplay = args.thing;
return message.channel.send(`${message.author} *pokes* ${thingToRoleplay}`);
}
};
+8 -3
View File
@@ -7,16 +7,21 @@ module.exports = class PunchCommand extends commando.Command {
group: 'roleplay',
memberName: 'punch',
description: 'Punches someone. (;punch @User)',
examples: [';punch @User']
examples: [';punch @User'],
args: [{
key: 'thing',
prompt: 'What do you want to roleplay with?',
type: 'string'
}]
});
}
run(message) {
run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
console.log(`[Command] ${message.content}`);
let thingToRoleplay = message.content.split(" ").slice(1).join(" ");
let thingToRoleplay = args.thing;
return message.channel.send(`${message.author} *punches* ${thingToRoleplay}`);
}
};
+8 -3
View File
@@ -7,16 +7,21 @@ module.exports = class SlapCommand extends commando.Command {
group: 'roleplay',
memberName: 'slap',
description: 'Slaps someone. (;slap @User)',
examples: [';slap @User']
examples: [';slap @User'],
args: [{
key: 'thing',
prompt: 'What do you want to roleplay with?',
type: 'string'
}]
});
}
run(message) {
run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
console.log(`[Command] ${message.content}`);
let thingToRoleplay = message.content.split(" ").slice(1).join(" ");
let thingToRoleplay = args.thing;
return message.channel.send(`${message.author} *slaps* ${thingToRoleplay}`);
}
};
+29 -29
View File
@@ -14,43 +14,43 @@ module.exports = class BotSearchCommand extends commando.Command {
group: 'search',
memberName: 'botinfo',
description: 'Searches Discord Bots for info on a bot. (;botinfo @Bot)',
examples: [';botinfo @Bot']
examples: [';botinfo @Bot'],
args: [{
key: 'bot',
prompt: 'Which bot do you want to get information for?',
type: 'user'
}]
});
}
async run(message) {
async run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
}
console.log(`[Command] ${message.content}`);
if (message.mentions.users.size === 1) {
let botToFind = message.mentions.users.first().id;
try {
let response = await request
.get(`https://bots.discord.pw/api/bots/${botToFind}`)
.set({
'Authorization': config.botskey
});
const embed = new Discord.RichEmbed()
.setColor(0x9797FF)
.setAuthor('Discord Bots', 'https://cdn.discordapp.com/icons/110373943822540800/47336ad0631ac7aac0a48a2ba6246c65.jpg')
.setTitle(response.body.name)
.setURL('https://bots.discord.pw/')
.setDescription(response.body.description)
.addField('**Library:**',
response.body.library, true)
.addField('**Prefix:**',
response.body.prefix, true)
.addField('**Invite:**',
`[Here](${response.body.invite_url})`, true);
return message.channel.sendEmbed(embed);
}
catch (err) {
return message.channel.send(":x: Error! Bot not Found!");
}
let botToFind = args.bot.id;
try {
let response = await request
.get(`https://bots.discord.pw/api/bots/${botToFind}`)
.set({
'Authorization': config.botskey
});
const embed = new Discord.RichEmbed()
.setColor(0x9797FF)
.setAuthor('Discord Bots', 'https://cdn.discordapp.com/icons/110373943822540800/47336ad0631ac7aac0a48a2ba6246c65.jpg')
.setTitle(response.body.name)
.setURL('https://bots.discord.pw/')
.setDescription(response.body.description)
.addField('**Library:**',
response.body.library, true)
.addField('**Prefix:**',
response.body.prefix, true)
.addField('**Invite:**',
`[Here](${response.body.invite_url})`, true);
return message.channel.sendEmbed(embed);
}
else {
return message.channel.send(':x: Error! Please mention one bot!');
catch (err) {
return message.channel.send(":x: Error! Bot not Found!");
}
}
};
+8 -3
View File
@@ -16,16 +16,21 @@ module.exports = class DefineCommand extends commando.Command {
group: 'search',
memberName: 'define',
description: 'Defines a word. (;define Cat)',
examples: [';define Cat']
examples: [';define Cat'],
args: [{
key: 'word',
prompt: 'What would you like to define?',
type: 'string'
}]
});
}
async run(message) {
async run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
}
console.log(`[Command] ${message.content}`);
let defineThis = encodeURI(message.content.split(" ").slice(1).join(" "));
let defineThis = encodeURI(args.word);
try {
let response = await request
.get(`http://api.wordnik.com:80/v4/word.json/${defineThis}/definitions`)
+16 -13
View File
@@ -12,25 +12,28 @@ module.exports = class DiscrimCommand extends commando.Command {
group: 'search',
memberName: 'discrim',
description: 'Searches the server for a certain discriminator. (;discrim 8081)',
examples: [';discrim 8081']
examples: [';discrim 8081'],
args: [{
key: 'discrim',
prompt: 'Which discriminator would you like to search for?',
type: 'string',
validate: (str) => {
str.match(/^[0-9]+$/) && str.length === 4;
}
}]
});
}
async run(message) {
async run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
}
console.log(`[Command] ${message.content}`);
let userToSearch = message.content.split(" ").slice(1).join(" ");
if (userToSearch.match(/^[0-9]+$/) && userToSearch.split("").length === 4) {
let users = await this.client.users.filter(u => u.discriminator === userToSearch).map(u => u.username).sort();
const embed = new Discord.RichEmbed()
.setTitle(`${users.length} Users with the discriminator: ${userToSearch}`)
.setDescription(users.join(', '));
return message.channel.sendEmbed(embed);
}
else {
return message.channel.send(':x: Error! This discriminator is invalid!');
}
let userToSearch = args.discrim;
let users = await this.client.users.filter(u => u.discriminator === userToSearch).map(u => u.username).sort();
const embed = new Discord.RichEmbed()
.setTitle(`${users.length} Users with the discriminator: ${userToSearch}`)
.setDescription(users.join(', '));
return message.channel.sendEmbed(embed);
}
};
+8 -3
View File
@@ -12,16 +12,21 @@ module.exports = class ForecastCommand extends commando.Command {
group: 'search',
memberName: 'forecast',
description: 'Gets the seven-day forecast for a specified location. (;forecast San Francisco)',
examples: [';forecast San Francisco']
examples: [';forecast San Francisco'],
args: [{
key: 'locationQ',
prompt: 'What location would you like to get the forecast for?',
type: 'string'
}]
});
}
async run(message) {
async run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
}
console.log(`[Command] ${message.content}`);
let locationToSearch = message.content.split(" ").slice(1).join(" ");
let locationToSearch = args.locationQ;
try {
let info = await weather(locationToSearch, 'f');
const embed = new Discord.RichEmbed()
+8 -3
View File
@@ -13,16 +13,21 @@ module.exports = class DefineCommand extends commando.Command {
group: 'search',
memberName: 'google',
description: 'Searches Google. (;google Cat)',
examples: [';google Cat']
examples: [';google Cat'],
args: [{
key: 'query',
prompt: 'What would you like to search for?',
type: 'string'
}]
});
}
async run(message) {
async run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
console.log(`[Command] ${message.content}`);
let thingToSearch = encodeURI(message.content.split(" ").slice(1).join(" "));
let thingToSearch = encodeURI(args.query);
let searchMsg = await message.channel.send('Searching...');
try {
let response = await request
+8 -3
View File
@@ -13,16 +13,21 @@ module.exports = class DefineCommand extends commando.Command {
group: 'search',
memberName: 'image',
description: 'Searches Google for an Image. (;image Cat)',
examples: [';image Cat']
examples: [';image Cat'],
args: [{
key: 'query',
prompt: 'What would you like to search for?',
type: 'string'
}]
});
}
async run(message) {
async run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
console.log(`[Command] ${message.content}`);
let thingToSearch = encodeURI(message.content.split(" ").slice(1).join(" "));
let thingToSearch = encodeURI(args.query);
let searchMsg = await message.channel.send('Searching...');
try {
let response = await request
+30 -30
View File
@@ -14,48 +14,48 @@ module.exports = class IMDBCommand extends commando.Command {
group: 'search',
memberName: 'imdb',
description: 'Searches IMDB for a specified movie. (;imdb How to Train Your Dragon)',
examples: [';imdb How to Train Your Dragon']
examples: [';imdb How to Train Your Dragon'],
args: [{
key: 'movie',
prompt: 'What movie or TV Show would you like to search for?',
type: 'string'
}]
});
}
run(message) {
run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
}
console.log(`[Command] ${message.content}`);
let queryMovie = message.content.split(" ").slice(1).join(" ");
let queryMovie = args.movie;
let movie;
imdb.getReq({
name: queryMovie
}, (err, response) => {
movie = response;
if (!movie) {
console.log(err);
return message.channel.send(":x: Error! Movie not found!");
}
else {
const embed = new Discord.RichEmbed()
.setColor(0xDBA628)
.setAuthor('IMDB', 'http://static.wixstatic.com/media/c65cbf_31901b544fe24f1890134553bf40c8be.png')
.setURL(movie.imdburl)
.setTitle(`${movie.title} (${movie.rating} Score)`)
.setDescription(`${movie.plot.substr(0, 1500)} [Read the Rest Here!](${movie.imdburl})`)
.addField('**Genres:**',
movie.genres)
.addField('**Year:**',
movie.year, true)
.addField('**Rated:**',
movie.rated, true)
.addField('**Runtime:**',
movie.runtime, true)
.addField('**Directors:**',
movie.director)
.addField('**Writers:**',
movie.writer)
.addField('**Actors:**',
movie.actors);
return message.channel.sendEmbed(embed);
}
if (!movie) return message.channel.send(":x: Error! Movie not found!");
const embed = new Discord.RichEmbed()
.setColor(0xDBA628)
.setAuthor('IMDB', 'http://static.wixstatic.com/media/c65cbf_31901b544fe24f1890134553bf40c8be.png')
.setURL(movie.imdburl)
.setTitle(`${movie.title} (${movie.rating} Score)`)
.setDescription(`${movie.plot.substr(0, 1500)} [Read the Rest Here!](${movie.imdburl})`)
.addField('**Genres:**',
movie.genres)
.addField('**Year:**',
movie.year, true)
.addField('**Rated:**',
movie.rated, true)
.addField('**Runtime:**',
movie.runtime, true)
.addField('**Directors:**',
movie.director)
.addField('**Writers:**',
movie.writer)
.addField('**Actors:**',
movie.actors);
return message.channel.sendEmbed(embed);
});
}
};
+18 -13
View File
@@ -7,28 +7,33 @@ module.exports = class NeopetCommand extends commando.Command {
group: 'search',
memberName: 'neopet',
description: "Gives a Neopet's image, searchable by ID. (;neopet rjwlsb8k)",
examples: [';neopet rjwlsb8k', ';neopet getID']
examples: [';neopet rjwlsb8k', ';neopet getID'],
args: [{
key: 'pet',
prompt: 'What pet ID would you like to get the image of? Use `getID` for info.',
type: 'string'
}]
});
}
async run(message) {
async run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return;
}
console.log(`[Command] ${message.content}`);
let petID = encodeURI(message.content.toLowerCase().split(" ").slice(1).join(" "));
if (petID === "getid") {
let petID = encodeURI(args.pet);
if (petID === "getID") {
let petIDMsg = await message.channel.send("To get your pet's ID, simply go to http://www.sunnyneo.com/petimagefinder.php and enter your pet's name. It's image should show up. Then, find the link below the pet's image, and copy it to your message! It's recommended you keep this ID with you so you can easily share your pet's picture without having to repeat these steps.");
return message.channel.sendFile('./images/PetID.png');
let petImg = await message.channel.sendFile('./images/PetID.png');
return [petIDMsg, petImg];
}
else {
try {
let petMsg = await message.channel.send(`Result for: ${petID}`);
return message.channel.sendFile(`http://pets.neopets.com/cp/${petID}/1/5.png`);
}
catch (err) {
return message.channel.send(":x: Error! Pet ID Not Found! Use `;neopet getID` for help on getting your pet ID.");
}
try {
let petMsg = await message.channel.send(`Result for: ${petID}`);
let petImg = await message.channel.sendFile(`http://pets.neopets.com/cp/${petID}/1/5.png`);
return [petMsg, petImg];
}
catch (err) {
return message.channel.send(":x: Error! Pet ID Not Found! Use `;neopet getID` for help on getting your pet ID.");
}
}
};
+37 -37
View File
@@ -15,16 +15,21 @@ module.exports = class OsuCommand extends commando.Command {
group: 'search',
memberName: 'osu',
description: 'Searches Osu user data. (;osu dragonfire535)',
examples: [';osu dragonfire535']
examples: [';osu dragonfire535'],
args: [{
key: 'username',
prompt: 'What osu username would you like to search for?',
type: 'string'
}]
});
}
async run(message) {
async run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
}
console.log(`[Command] ${message.content}`);
let usernameToSearch = message.content.split(" ").slice(1).join(" ");
let usernameToSearch = args.username;
try {
let response = await request
.get('https://osu.ppy.sh/api/get_user')
@@ -33,40 +38,35 @@ module.exports = class OsuCommand extends commando.Command {
u: usernameToSearch,
type: 'string'
});
if (!response.body[0]) {
return message.channel.send(":x: Error! User not found!");
}
else {
const embed = new Discord.RichEmbed()
.setColor(0xFF66AA)
.setAuthor('osu!', 'http://vignette3.wikia.nocookie.net/osugame/images/c/c9/Logo.png/revision/latest?cb=20151219073209')
.setURL('https://osu.ppy.sh/')
.addField('**Username:**',
response.body[0].username, true)
.addField('**ID:**',
response.body[0].user_id, true)
.addField('**Level:**',
response.body[0].level, true)
.addField('**Accuracy**',
response.body[0].accuracy, true)
.addField('**Rank:**',
response.body[0].pp_rank, true)
.addField('**Play Count:**',
response.body[0].playcount, true)
.addField('**Country:**',
response.body[0].country, true)
.addField('**Ranked Score:**',
response.body[0].ranked_score, true)
.addField('**Total Score:**',
response.body[0].total_score, true)
.addField('**SS:**',
response.body[0].count_rank_ss, true)
.addField('**S:**',
response.body[0].count_rank_s, true)
.addField('**A:**',
response.body[0].count_rank_a, true);
return message.channel.sendEmbed(embed);
}
const embed = new Discord.RichEmbed()
.setColor(0xFF66AA)
.setAuthor('osu!', 'http://vignette3.wikia.nocookie.net/osugame/images/c/c9/Logo.png/revision/latest?cb=20151219073209')
.setURL('https://osu.ppy.sh/')
.addField('**Username:**',
response.body[0].username, true)
.addField('**ID:**',
response.body[0].user_id, true)
.addField('**Level:**',
response.body[0].level, true)
.addField('**Accuracy**',
response.body[0].accuracy, true)
.addField('**Rank:**',
response.body[0].pp_rank, true)
.addField('**Play Count:**',
response.body[0].playcount, true)
.addField('**Country:**',
response.body[0].country, true)
.addField('**Ranked Score:**',
response.body[0].ranked_score, true)
.addField('**Total Score:**',
response.body[0].total_score, true)
.addField('**SS:**',
response.body[0].count_rank_ss, true)
.addField('**S:**',
response.body[0].count_rank_s, true)
.addField('**A:**',
response.body[0].count_rank_a, true);
return message.channel.sendEmbed(embed);
}
catch (err) {
return message.channel.send(":x: Error! User not Found!");
+23 -20
View File
@@ -12,32 +12,35 @@ module.exports = class PokedexCommand extends commando.Command {
group: 'search',
memberName: 'pokedex',
description: 'Gives the pokedex entry for a Pokemon. (;pokedex Pikachu)',
examples: [';pokedex Pikachu']
examples: [';pokedex Pikachu'],
args: [{
key: 'pokemon',
prompt: 'What Pokémon would you like to get info on?',
type: 'string',
validate: (str) => {
pokedex.name[str.toLowerCase()];
}
}]
});
}
run(message) {
run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
}
console.log(`[Command] ${message.content}`);
let pokemon = message.content.toLowerCase().split(" ").slice(1).join(" ");
if (pokedex.name[pokemon]) {
const embed = new Discord.RichEmbed()
.setTitle('Information')
.setAuthor(`#${pokedex.index[pokemon]} ${pokedex.name[pokemon]}`, `http://www.serebii.net/pokedex-sm/icon/${pokedex.index[pokemon]}.png`)
.setColor(0xFF0000)
.setDescription(pokedex.species[pokemon])
.setFooter("Pokédex", "http://cdn.bulbagarden.net/upload/thumb/3/36/479Rotom-Pokédex.png/250px-479Rotom-Pokédex.png")
.setThumbnail(`http://www.serebii.net/sunmoon/pokemon/${pokedex.index[pokemon]}.png`)
.addField('Entry',
pokedex.entry[pokemon])
.addField('Type',
pokedex.type[pokemon]);
return message.channel.sendEmbed(embed);
}
else {
return message.channel.send(":x: This Pokémon either doesn't exist, or isn't implemented yet.");
}
let pokemon = args.pokemon;
const embed = new Discord.RichEmbed()
.setTitle('Information')
.setAuthor(`#${pokedex.index[pokemon]} ${pokedex.name[pokemon]}`, `http://www.serebii.net/pokedex-sm/icon/${pokedex.index[pokemon]}.png`)
.setColor(0xFF0000)
.setDescription(pokedex.species[pokemon])
.setFooter("Pokédex", "http://cdn.bulbagarden.net/upload/thumb/3/36/479Rotom-Pokédex.png/250px-479Rotom-Pokédex.png")
.setThumbnail(`http://www.serebii.net/sunmoon/pokemon/${pokedex.index[pokemon]}.png`)
.addField('Entry',
pokedex.entry[pokemon])
.addField('Type',
pokedex.type[pokemon]);
return message.channel.sendEmbed(embed);
}
};
+20 -21
View File
@@ -14,35 +14,25 @@ module.exports = class UrbanDictionary extends commando.Command {
group: 'search',
memberName: 'urban',
description: 'Searches Urban Dictionary. (;urban Cat)',
examples: [';urban Cat']
examples: [';urban Cat'],
args: [{
key: 'word',
prompt: 'What would you like to define?',
type: 'string'
}]
});
}
run(message) {
run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
console.log(`[Command] ${message.content}`);
let wordToDefine = message.content.split(" ").slice(1).join(" ");
let wordToDefine = args.word;
urban(wordToDefine).first(function(response) {
if (!response) {
return message.channel.send(":x: Error! Word not found!");
}
else if (!response.definition) {
return message.channel.send(":x: Error! Word has no definition!");
}
else if (response.example) {
const embed = new Discord.RichEmbed()
.setColor(0x32a8f0)
.setAuthor('Urban Dictionary', 'http://a1.mzstatic.com/eu/r30/Purple71/v4/66/54/68/6654683f-cacd-4a55-1784-f14257f77874/icon175x175.png')
.setURL(response.permalink)
.setTitle(response.word)
.setDescription(`${response.definition.substr(0, 1900)} [Read the Rest Here!](${response.permalink})`)
.addField('**Example:**',
response.example.substr(0, 1900));
return message.channel.sendEmbed(embed);
}
else {
if (!response) return message.channel.send(":x: Error! Word not found!");
if (!response.definition) return message.channel.send(":x: Error! Word has no definition!");
if (!response.example) {
const embed = new Discord.RichEmbed()
.setColor(0x32a8f0)
.setAuthor('Urban Dictionary', 'http://a1.mzstatic.com/eu/r30/Purple71/v4/66/54/68/6654683f-cacd-4a55-1784-f14257f77874/icon175x175.png')
@@ -51,6 +41,15 @@ module.exports = class UrbanDictionary extends commando.Command {
.setDescription(`${response.definition.substr(0, 1900)} [Read the Rest Here!](${response.permalink})`);
return message.channel.sendEmbed(embed);
}
const embed = new Discord.RichEmbed()
.setColor(0x32a8f0)
.setAuthor('Urban Dictionary', 'http://a1.mzstatic.com/eu/r30/Purple71/v4/66/54/68/6654683f-cacd-4a55-1784-f14257f77874/icon175x175.png')
.setURL(response.permalink)
.setTitle(response.word)
.setDescription(`${response.definition.substr(0, 1900)} [Read the Rest Here!](${response.permalink})`)
.addField('**Example:**',
response.example.substr(0, 1900));
return message.channel.sendEmbed(embed);
});
}
};
+8 -3
View File
@@ -10,16 +10,21 @@ module.exports = class WattpadCommand extends commando.Command {
group: 'search',
memberName: 'wattpad',
description: 'Searches Wattpad for a specified book. (;wattpad Heroes of Dreamland)',
examples: [';wattpad Heroes of Dreamland']
examples: [';wattpad Heroes of Dreamland'],
args: [{
key: 'book',
prompt: 'What book would you like to search for?',
type: 'string'
}]
});
}
async run(message) {
async run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
}
console.log(`[Command] ${message.content}`);
let queryBook = message.content.split(" ").slice(1).join(" ");
let queryBook = args.book;
try {
let response = await request
.get('https://api.wattpad.com:443/v4/stories')
+8 -3
View File
@@ -9,16 +9,21 @@ module.exports = class WeatherCommand extends commando.Command {
group: 'search',
memberName: 'weather',
description: 'Searches weather for a specified location. (;weather San Francisco)',
examples: [';weather San Francisco']
examples: [';weather San Francisco'],
args: [{
key: 'locationQ',
prompt: 'What location would you like to get the current weather for?',
type: 'string'
}]
});
}
async run(message) {
async run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
}
console.log(`[Command] ${message.content}`);
let locationToSearch = message.content.split(" ").slice(1).join(" ");
let locationToSearch = args.locationQ;
try {
let info = await weather(locationToSearch, 'f');
const embed = new Discord.RichEmbed()
+18 -17
View File
@@ -9,36 +9,37 @@ module.exports = class WikipediaCommand extends commando.Command {
group: 'search',
memberName: 'wikipedia',
description: 'Searches Wikipedia for something. (;wikipedia Cat)',
examples: [';wikipedia Cat']
examples: [';wikipedia Cat'],
args: [{
key: 'query',
prompt: 'What would you like to search for?',
type: 'string'
}]
});
}
async run(message) {
async run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
}
console.log(`[Command] ${message.content}`);
let thingToSearch = encodeURI(message.content.split(" ").slice(1).join(" "));
let thingToSearch = encodeURI(args.query);
thingToSearch = thingToSearch.split(")").join("%29");
try {
let response = await request
.get(`https://en.wikipedia.org/w/api.php?action=query&prop=extracts&format=json&titles=${thingToSearch}&exintro=&explaintext=&redirects=&formatversion=2`);
let description = response.body.query.pages[0].extract;
let name = response.body.query.pages[0].title;
if (!description) {
return message.channel.send(":x: Error! Entry Not Found!");
}
else {
description = description.substr(0, 1900);
description = description.split('\n').join("\n\n");
const embed = new Discord.RichEmbed()
.setColor(0xE7E7E7)
.setTitle(name)
.setURL(`https://en.wikipedia.org/wiki/${thingToSearch}`)
.setAuthor("Wikipedia", "https://upload.wikimedia.org/wikipedia/en/thumb/8/80/Wikipedia-logo-v2.svg/1122px-Wikipedia-logo-v2.svg.png")
.setDescription(`${description} [Read the Rest Here](https://en.wikipedia.org/wiki/${thingToSearch})`);
return message.channel.sendEmbed(embed);
}
if (!description) return message.channel.send(":x: Error! Entry Not Found!");
description = description.substr(0, 1900);
description = description.split('\n').join("\n\n");
const embed = new Discord.RichEmbed()
.setColor(0xE7E7E7)
.setTitle(name)
.setURL(`https://en.wikipedia.org/wiki/${thingToSearch}`)
.setAuthor("Wikipedia", "https://upload.wikimedia.org/wikipedia/en/thumb/8/80/Wikipedia-logo-v2.svg/1122px-Wikipedia-logo-v2.svg.png")
.setDescription(`${description} [Read the Rest Here](https://en.wikipedia.org/wiki/${thingToSearch})`);
return message.channel.sendEmbed(embed);
}
catch (err) {
return message.channel.send(":x: Error! Entry Not Found!");
+17 -16
View File
@@ -13,16 +13,21 @@ module.exports = class YouTubeCommand extends commando.Command {
group: 'search',
memberName: 'youtube',
description: 'Searches YouTube for a video. (;youtube video)',
examples: [';youtube video']
examples: [';youtube video'],
args: [{
key: 'video',
prompt: 'What would you like to search for?',
type: 'string'
}]
});
}
async run(message) {
async run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
}
console.log(`[Command] ${message.content}`);
let videoToSearch = message.content.split(" ").slice(1).join("-");
let videoToSearch = encodeURI(args.video);
try {
let response = await request
.get('https://www.googleapis.com/youtube/v3/search')
@@ -33,19 +38,15 @@ module.exports = class YouTubeCommand extends commando.Command {
q: videoToSearch,
key: config.youtubekey
});
if (!response.body.items[0].snippet) {
return message.channel.send(':x: Error! No Video Found!');
}
else {
const embed = new Discord.RichEmbed()
.setColor(0xDD2825)
.setTitle(response.body.items[0].snippet.title)
.setDescription(response.body.items[0].snippet.description)
.setAuthor(`YouTube - ${response.body.items[0].snippet.channelTitle}`, 'https://cdn3.iconfinder.com/data/icons/social-icons-5/607/YouTube_Play.png')
.setURL(`https://www.youtube.com/watch?v=${response.body.items[0].id.videoId}`)
.setThumbnail(response.body.items[0].snippet.thumbnails.default.url);
return message.channel.sendEmbed(embed);
}
if (!response.body.items[0].snippet) return message.channel.send(':x: Error! No Video Found!');
const embed = new Discord.RichEmbed()
.setColor(0xDD2825)
.setTitle(response.body.items[0].snippet.title)
.setDescription(response.body.items[0].snippet.description)
.setAuthor(`YouTube - ${response.body.items[0].snippet.channelTitle}`, 'https://cdn3.iconfinder.com/data/icons/social-icons-5/607/YouTube_Play.png')
.setURL(`https://www.youtube.com/watch?v=${response.body.items[0].id.videoId}`)
.setThumbnail(response.body.items[0].snippet.thumbnails.default.url);
return message.channel.sendEmbed(embed);
}
catch (err) {
return message.channel.send(":x: Error! An error has occurred! Try again later! (If this continues to occur, the daily quota may have been reached).");
+16 -13
View File
@@ -9,16 +9,21 @@ module.exports = class YuGiOhCommand extends commando.Command {
group: 'search',
memberName: 'yugioh',
description: 'Gets info on a Yu-Gi-Oh! Card. (;yugioh Blue-Eyes White Dragon)',
examples: [';yugioh Blue-Eyes White Dragon']
examples: [';yugioh Blue-Eyes White Dragon'],
args: [{
key: 'card',
prompt: 'What card would you like to get data for?',
type: 'string'
}]
});
}
async run(message) {
async run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
}
console.log(`[Command] ${message.content}`);
let cardName = encodeURI(message.content.split(" ").slice(1).join(" "));
let cardName = encodeURI(args.card);
try {
let response = await request
.get(`http://yugiohprices.com/api/card_data/${cardName}`);
@@ -42,16 +47,14 @@ module.exports = class YuGiOhCommand extends commando.Command {
response.body.data.level, true);
return message.channel.sendEmbed(embed);
}
else {
const embed = new Discord.RichEmbed()
.setColor(0xBE5F1F)
.setTitle(response.body.data.name)
.setDescription(response.body.data.text)
.setAuthor('Yu-Gi-Oh!', 'http://vignette3.wikia.nocookie.net/yugioh/images/1/10/Back-TF-EN-VG.png/revision/latest?cb=20120824043558')
.addField('**Card Type:**',
response.body.data.card_type, true);
return message.channel.sendEmbed(embed);
}
const embed = new Discord.RichEmbed()
.setColor(0xBE5F1F)
.setTitle(response.body.data.name)
.setDescription(response.body.data.text)
.setAuthor('Yu-Gi-Oh!', 'http://vignette3.wikia.nocookie.net/yugioh/images/1/10/Back-TF-EN-VG.png/revision/latest?cb=20120824043558')
.addField('**Card Type:**',
response.body.data.card_type, true);
return message.channel.sendEmbed(embed);
}
catch (err) {
return message.channel.send(":x: Error! Card not Found!\n:notepad_spiral: Note: This command is **extremely** sensitive to casing and dashes and whatnot. Type the *exact* card name to get data!");
+11 -4
View File
@@ -8,16 +8,23 @@ module.exports = class BinaryCommand extends commando.Command {
group: 'textedit',
memberName: 'binary',
description: 'Converts text to binary. (;binary This text)',
examples: [';binary This text']
examples: [';binary This text'],
args: [{
key: 'text',
prompt: 'What text would you like to convert to binary?',
type: 'string'
}]
});
}
run(message) {
run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
console.log(`[Command] ${message.content}`);
let turnToBinary = message.content.split(" ").slice(1).join(" ");
return message.channel.send(stringToBinary(turnToBinary)).catch(error => message.channel.send(':x: Error! Translation is too long, or nothing was entered!'));
let turnToBinary = args.text;
let binaryText = stringToBinary(turnToBinary);
if (binaryText.length > 1950) return message.channel.send(":x: Error! Your message is too long!");
return message.channel.send(binaryText);
}
};
+13 -13
View File
@@ -8,25 +8,25 @@ module.exports = class CowsayCommand extends commando.Command {
group: 'textedit',
memberName: 'cowsay',
description: 'Converts text to cowsay. (;cowsay This text)',
examples: [';cowsay This text']
examples: [';cowsay This text'],
args: [{
key: 'text',
prompt: 'What text would you like the cow to say?',
type: 'string'
}]
});
}
run(message) {
run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
console.log(`[Command] ${message.content}`);
if (!message.content.split(" ").slice(1).join(" ")) {
return message.channel.send(":x: Error! You entered nothing!");
}
else {
let turnToCowsay = message.content.split(" ").slice(1).join(" ");
return message.channel.sendCode(null, cowsay.say({
text: turnToCowsay,
e: "oO",
T: "U "
})).catch(error => message.channel.send(':x: Error! Perhaps the content is too long?'));
}
let turnToCowsay = args.text;
return message.channel.sendCode(null, cowsay.say({
text: turnToCowsay,
e: "oO",
T: "U "
})).catch(error => message.channel.send(':x: Error! Perhaps the content is too long?'));
}
};
+16 -24
View File
@@ -8,37 +8,29 @@ module.exports = class EmbedCommand extends commando.Command {
group: 'textedit',
memberName: 'embed',
description: 'Sends a message in an embed. (;embed This is an example.)',
examples: [';embed This is an example.']
examples: [';embed This is an example.'],
guildOnly: true,
args: [{
key: 'text',
prompt: 'What text would you like to embed?',
type: 'string'
}]
});
}
run(message) {
async run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
}
console.log(`[Command] ${message.content}`);
let embedMessage = message.content.split(" ").slice(1).join(" ");
if (!embedMessage) {
return message.channel.send(":x: Error! Nothing to embed!");
}
else {
if (message.channel.type === 'dm') {
const embed = new Discord.RichEmbed()
.setAuthor(message.author.username, message.author.avatarURL)
.setColor(0x00AE86)
.setTimestamp()
.setDescription(embedMessage);
return message.channel.sendEmbed(embed);
}
else {
const embed = new Discord.RichEmbed()
.setAuthor(message.author.username, message.author.avatarURL)
.setColor(0x00AE86)
.setTimestamp()
.setDescription(embedMessage);
message.delete();
return message.channel.sendEmbed(embed);
}
}
const embed = new Discord.RichEmbed()
.setAuthor(message.author.username, message.author.avatarURL)
.setColor(0x00AE86)
.setTimestamp()
.setDescription(embedMessage);
let deleteMsg = await message.delete();
let embedSend = await message.channel.sendEmbed(embed);
return [deleteMsg, embedSend];
}
};
+18 -16
View File
@@ -11,28 +11,30 @@ module.exports = class MorseCommand extends commando.Command {
group: 'textedit',
memberName: 'morse',
description: 'Translates text to and from morse code. (;morse encode This is Morse Code.)',
examples: [';morse encode This is Morse Code.', ';morse decode .... . .-.. .-.. --- --..-- ....... .-- --- .-. .-.. -.. .-.-.-']
examples: [';morse encode This is Morse Code.', ';morse decode .... . .-.. .-.. --- --..-- ....... .-- --- .-. .-.. -.. .-.-.-'],
args: [{
key: 'method',
prompt: 'Would you like to encode or decode the text?',
type: 'string',
validate: (str) => {
str.toLowerCase() === 'encode' || str.toLowerCase() === 'decode';
}
}, {
key: 'text',
prompt: 'What text would you like to convert to morse?',
type: 'string'
}]
});
}
run(message) {
run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
console.log(`[Command] ${message.content}`);
let [methodToUse] = message.content.toLowerCase().split(" ").slice(1);
let toMorse = message.content.split(" ").slice(2).join(" ");
if (!toMorse) {
return message.channel.send(":x: Error! Nothing to translate! Perhaps you forgot to set the method? Use either encode or decode before your text.");
}
else if (methodToUse === 'encode') {
return message.channel.send(morse.encode(toMorse)).catch(error => message.channel.send(':x: Error! Something went wrong! Perhaps you entered incorrect text?'));
}
else if (methodToUse === 'decode') {
return message.channel.send(morse.decode(toMorse)).catch(error => message.channel.send(':x: Error! Something went wrong! Perhaps you entered incorrect text?'));
}
else {
return message.channel.send(":x: Error! Method not set/not correct! Use either encode or decode.");
}
let methodToUse = args.method;
let toMorse = args.text;
if (methodToUse === 'encode') return message.channel.send(morse.encode(toMorse)).catch(error => message.channel.send(':x: Error! Something went wrong! Perhaps you entered incorrect text?'));
if (methodToUse === 'decode') return message.channel.send(morse.decode(toMorse)).catch(error => message.channel.send(':x: Error! Something went wrong! Perhaps you entered incorrect text?'));
}
};
+10 -14
View File
@@ -12,27 +12,23 @@ module.exports = class PirateCommand extends commando.Command {
group: 'textedit',
memberName: 'pirate',
description: 'Talk like a pirate! (;pirate This is being said like a pirate!)',
examples: [';pirate This is being said like a pirate!']
examples: [';pirate This is being said like a pirate!'],
args: [{
key: 'text',
prompt: 'What text would you like to convert to pirate?',
type: 'string'
}]
});
}
run(message) {
run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
console.log(`[Command] ${message.content}`);
let turnToPirate = message.content.split(" ").slice(1).join(" ");
let turnToPirate = args.text;
let pirate = pirateSpeak.translate(turnToPirate);
if (!turnToPirate) {
return message.channel.send(":x: Error! Nothing to translate!");
}
else {
if (pirate.length > 1950) {
return message.channel.send(":x: Error! Your message is too long!");
}
else {
return message.channel.send(pirate);
}
}
if (pirate.length > 1950) return message.channel.send(":x: Error! Your message is too long!");
return message.channel.send(pirate);
}
};
+10 -10
View File
@@ -7,22 +7,22 @@ module.exports = class ReverseCommand extends commando.Command {
group: 'textedit',
memberName: 'reverse',
description: 'Reverses text (;reverse This text please)',
examples: [';reverse This text please']
examples: [';reverse This text please'],
args: [{
key: 'text',
prompt: 'What text would you like to reverse?',
type: 'string'
}]
});
}
run(message) {
run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
console.log(`[Command] ${message.content}`);
let stringToReverse = message.content.split(" ").slice(1).join(" ");
if (!stringToReverse) {
return message.channel.send(":x: Error! Nothing to reverse!");
}
else {
let reversed = stringToReverse.split("").reverse().join("");
return message.channel.send(reversed);
}
let stringToReverse = args.text;
let reversed = stringToReverse.split("").reverse().join("");
return message.channel.send(reversed);
}
};
+11 -6
View File
@@ -12,28 +12,33 @@ module.exports = class RinSayCommand extends commando.Command {
group: 'textedit',
memberName: 'rin',
description: "Posts a message to the Rin webhook in Heroes of Dreamland. (;rin Hey guys!)",
examples: [";rin Hey guys!"]
examples: [";rin Hey guys!"],
guildOnly: true,
args: [{
key: 'text',
prompt: 'What text would you like Rin to say?',
type: 'string'
}]
});
}
hasPermission(msg) {
return this.client.isOwner(msg.author);
}
async run(message) {
async run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'MANAGE_MESSAGES'])) return;
}
console.log(`[Command] ${message.content}`);
let rinContent = message.content.split(" ").slice(1).join(" ");
let rinContent = args.text;
try {
let post = await request
.post(config.webhook)
.send({
content: rinContent
});
if (message.content.type !== 'dm') {
return message.delete();
}
let deleteMsg = await message.delete();
return [post, deleteMsg];
}
catch (err) {
return message.channel.send(':x: Error! Message failed to send!');
+14 -15
View File
@@ -11,27 +11,26 @@ module.exports = class RomajiCommand extends commando.Command {
group: 'textedit',
memberName: 'romaji',
description: 'Convert Hiragana and Katakana to Romaji (;romaji ひらがな)',
examples: [';romaji ひらがな']
examples: [';romaji ひらがな'],
args: [{
key: 'kana',
prompt: 'What kana would you like to convert to romaji?',
type: 'string',
validate: (str) => {
hepburn.containsKana(str);
}
}]
});
}
run(message) {
run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
console.log(`[Command] ${message.content}`);
let romajify = message.content.split(" ").slice(1).join(" ");
if (hepburn.containsKana(romajify)) {
let romajified = hepburn.fromKana(romajify);
if (romajified.length > 1950) {
return message.channel.send(":x: Error! Your message is too long!");
}
else {
return message.channel.send(romajified);
}
}
else {
return message.channel.send(":x: Error! Message contains no Kana!\n:notepad_spiral: Note: You cannot use this command on Kanji!");
}
let romajify = args.kana;
let romajified = hepburn.fromKana(romajify);
if (romajified.length > 1950) return message.channel.send(":x: Error! Your message is too long!");
return message.channel.send(romajified);
}
};
+13 -16
View File
@@ -13,27 +13,24 @@ module.exports = class SayCommand extends commando.Command {
group: 'textedit',
memberName: 'say',
description: 'Make XiaoBot say what you wish. (;say I can talk!)',
examples: [';say I can talk!']
examples: [';say I can talk!'],
guildOnly: true,
args: [{
key: 'text',
prompt: 'What text would you like XiaoBot to say?',
type: 'string'
}]
});
}
run(message) {
async run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'MANAGE_MESSAGES'])) return;
}
console.log(`[Command] ${message.content}`);
let copycat = message.content.split(" ").slice(1).join(" ");
if (!copycat) {
return message.channel.send(":x: Error! Nothing to say!");
}
else {
if (message.channel.type === 'dm') {
return message.channel.send(copycat);
}
else {
message.delete();
return message.channel.send(copycat);
}
}
let copycat = args.text;
let deleteMsg = await message.delete();
let copyMsg = await message.channel.send(copycat);
return [deleteMsg, copyMsg];
}
};
+9 -9
View File
@@ -19,21 +19,21 @@ module.exports = class ShuffleCommand extends commando.Command {
group: 'textedit',
memberName: 'shuffle',
description: 'Shuffles text (;shuffle This Text)',
examples: [';shuffle This Text']
examples: [';shuffle This Text'],
args: [{
key: 'text',
prompt: 'What text would you like to shuffle?',
type: 'string'
}]
});
}
run(message) {
run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
console.log(`[Command] ${message.content}`);
let thingToShuffle = message.content.split(" ").slice(1).join(" ");
if (!thingToShuffle) {
return message.channel.send(":x: Error! Nothing to shuffle!");
}
else {
return message.channel.send(thingToShuffle.shuffle());
}
let thingToShuffle = args.text;
return message.channel.send(thingToShuffle.shuffle());
}
};
+10 -11
View File
@@ -286,7 +286,6 @@ const temmize = function(text) {
return temmify;
};
module.exports = class TemmieCommand extends commando.Command {
constructor(Client) {
super(Client, {
@@ -294,22 +293,22 @@ module.exports = class TemmieCommand extends commando.Command {
group: 'textedit',
memberName: 'temmie',
description: "Translate text to Temmie speak. (;temmie I am Temmie)",
examples: [";temmie I am Temmie."]
examples: [";temmie I am Temmie."],
args: [{
key: 'text',
prompt: 'What text would you like to convert to Temmie speak?',
type: 'string'
}]
});
}
run(message) {
run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
console.log(`[Command] ${message.content}`);
let thingToTranslate = message.content.split(" ").slice(1).join(" ");
if (!thingToTranslate) {
return message.channel.send(':x: Error! Nothing to translate!');
}
else {
let temmized = temmize(thingToTranslate);
return message.channel.send(temmized);
}
let thingToTranslate = args.text;
let temmized = temmize(thingToTranslate);
return message.channel.send(temmized);
}
};
+32 -34
View File
@@ -116,48 +116,46 @@ module.exports = class TranslateCommand extends commando.Command {
group: 'textedit',
memberName: 'translate',
description: 'Translates text to a given language. (;translate ja Give me the money!)',
examples: [';translate ja Give me the the money!', ';translate list']
examples: [';translate ja Give me the the money!', ';translate list'],
args: [{
key: 'to',
prompt: 'What language would you like to translate to?',
type: 'string',
validate: (str) => {
languages[str] || str.toLowerCase() === 'list';
}
}, {
key: 'text',
prompt: 'What text would you like to translate?',
type: 'string'
}]
});
}
async run(message) {
async run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
}
console.log(`[Command] ${message.content}`);
let [languageto] = message.content.toLowerCase().split(" ").slice(1);
let thingToTranslate = message.content.split(" ").slice(2).join(" ");
if (languageto === "list") {
return message.channel.send("af': 'Afrikaans\nsq': 'Albanian'\n'ar': 'Arabic\nhy': 'Armenian\naz': 'Azerbaijani\neu': 'Basque\nbe': 'Belarusian\nbn': 'Bengali\nbs': 'Bosnian\nbg': 'Bulgarian\nca': 'Catalan\nceb': 'Cebuano\nny': 'Chichewa\nzh-cn': 'Chinese Simplified\nzh-tw': 'Chinese Traditional\nco': 'Corsican\nhr': 'Croatian\ncs': 'Czech\nda': 'Danish\nnl': 'Dutch\nen': 'English\neo': 'Esperanto\net': 'Estonian\ntl': 'Filipino\nfi': 'Finnish\nfr': 'French\nfy': 'Frisian\ngl': 'Galician\nka': 'Georgian\nde': 'German\nel': 'Greek\ngu': 'Gujarati\nht': 'Haitian Creole\nha': 'Hausa\nhaw': 'Hawaiian\niw': 'Hebrew\nhi': 'Hindi\nhmn': 'Hmong\nhu': 'Hungarian\nis': 'Icelandic\nig': 'Igbo\nid': 'Indonesian\nga': 'Irish\nit': 'Italian\nja': 'Japanese\njw': 'Javanese\nkn': 'Kannada\nkk': 'Kazakh\nkm': 'Khmer\nko': 'Korean\nku': 'Kurdish (Kurmanji)\nky': 'Kyrgyz\nlo': 'Lao\nla': 'Latin\nlv': 'Latvian\nlt': 'Lithuanian\nlb': 'Luxembourgish\nmk': 'Macedonian\nmg': 'Malagasy\nms': 'Malay\nml': 'Malayalam\nmt': 'Maltese\nmi': 'Maori\nmr': 'Marathi\nmn': 'Mongolian\nmy': 'Myanmar (Burmese)\nne': 'Nepali\nno': 'Norwegian\nps': 'Pashto\nfa': 'Persian\npl': 'Polish\npt': 'Portuguese\nma': 'Punjabi\nro': 'Romanian\nru': 'Russian\nsm': 'Samoan\ngd': 'Scots Gaelic\nsr': 'Serbian\nst': 'Sesotho\nsn': 'Shona\nsd': 'Sindhi\nsi': 'Sinhala\nsk': 'Slovak\nsl': 'Slovenian\nso': 'Somali\nes': 'Spanish\nsu': 'Sudanese\nsw': 'Swahili\nsv': 'Swedish\ntg': 'Tajik\nta': 'Tamil\nte': 'Telugu\nth': 'Thai\ntr': 'Turkish\nuk': 'Ukrainian\nur': 'Urdu\nuz': 'Uzbek\nvi': 'Vietnamese\ncy': 'Welsh\nxh': 'Xhosa\nyi': 'Yiddish\nyo': 'Yoruba\nzu': 'Zulu'");
let languageto = args.to;
let thingToTranslate = args.text;
if (languageto === "list") return message.channel.send("af': 'Afrikaans\nsq': 'Albanian'\n'ar': 'Arabic\nhy': 'Armenian\naz': 'Azerbaijani\neu': 'Basque\nbe': 'Belarusian\nbn': 'Bengali\nbs': 'Bosnian\nbg': 'Bulgarian\nca': 'Catalan\nceb': 'Cebuano\nny': 'Chichewa\nzh-cn': 'Chinese Simplified\nzh-tw': 'Chinese Traditional\nco': 'Corsican\nhr': 'Croatian\ncs': 'Czech\nda': 'Danish\nnl': 'Dutch\nen': 'English\neo': 'Esperanto\net': 'Estonian\ntl': 'Filipino\nfi': 'Finnish\nfr': 'French\nfy': 'Frisian\ngl': 'Galician\nka': 'Georgian\nde': 'German\nel': 'Greek\ngu': 'Gujarati\nht': 'Haitian Creole\nha': 'Hausa\nhaw': 'Hawaiian\niw': 'Hebrew\nhi': 'Hindi\nhmn': 'Hmong\nhu': 'Hungarian\nis': 'Icelandic\nig': 'Igbo\nid': 'Indonesian\nga': 'Irish\nit': 'Italian\nja': 'Japanese\njw': 'Javanese\nkn': 'Kannada\nkk': 'Kazakh\nkm': 'Khmer\nko': 'Korean\nku': 'Kurdish (Kurmanji)\nky': 'Kyrgyz\nlo': 'Lao\nla': 'Latin\nlv': 'Latvian\nlt': 'Lithuanian\nlb': 'Luxembourgish\nmk': 'Macedonian\nmg': 'Malagasy\nms': 'Malay\nml': 'Malayalam\nmt': 'Maltese\nmi': 'Maori\nmr': 'Marathi\nmn': 'Mongolian\nmy': 'Myanmar (Burmese)\nne': 'Nepali\nno': 'Norwegian\nps': 'Pashto\nfa': 'Persian\npl': 'Polish\npt': 'Portuguese\nma': 'Punjabi\nro': 'Romanian\nru': 'Russian\nsm': 'Samoan\ngd': 'Scots Gaelic\nsr': 'Serbian\nst': 'Sesotho\nsn': 'Shona\nsd': 'Sindhi\nsi': 'Sinhala\nsk': 'Slovak\nsl': 'Slovenian\nso': 'Somali\nes': 'Spanish\nsu': 'Sudanese\nsw': 'Swahili\nsv': 'Swedish\ntg': 'Tajik\nta': 'Tamil\nte': 'Telugu\nth': 'Thai\ntr': 'Turkish\nuk': 'Ukrainian\nur': 'Urdu\nuz': 'Uzbek\nvi': 'Vietnamese\ncy': 'Welsh\nxh': 'Xhosa\nyi': 'Yiddish\nyo': 'Yoruba\nzu': 'Zulu'");
if (thingToTranslate.length > 200) return message.channel.send(":x: Error! Please keep translations below 200 characters!");
try {
let res = await translate(thingToTranslate, {
to: languageto
});
let languagefrom = res.from.language.iso.toLowerCase();
const embed = new Discord.RichEmbed()
.setColor(0x00AE86)
.addField(`Input (From: ${languages[languagefrom]}):`,
thingToTranslate)
.addField(`Translation (To: ${languages[languageto]}):`,
res.text);
return message.channel.sendEmbed(embed);
}
else if (languages[languageto]) {
if (!thingToTranslate) {
return message.channel.send(":x: Error! Nothing to translate!");
}
else if (thingToTranslate.length > 200) {
return message.channel.send(":x: Error! Please keep translations below 200 characters!");
}
else {
try {
let res = await translate(thingToTranslate, {
to: languageto
});
let languagefrom = res.from.language.iso.toLowerCase();
const embed = new Discord.RichEmbed()
.setColor(0x00AE86)
.addField(`Input (From: ${languages[languagefrom]}):`,
thingToTranslate)
.addField(`Translation (To: ${languages[languageto]}):`,
res.text);
return message.channel.sendEmbed(embed);
}
catch (err) {
return message.channel.send(":x: Error! Something went wrong!");
}
}
}
else {
return message.channel.send(":x: Error! Language not found! Use `;translate list` to view a list of translate codes!");
catch (err) {
return message.channel.send(":x: Error! Something went wrong!");
}
}
};
+22 -26
View File
@@ -9,40 +9,36 @@ module.exports = class YodaCommand extends commando.Command {
group: 'textedit',
memberName: 'yoda',
description: 'Converts text to Yoda Speak. (;yoda This is Yoda.)',
examples: [';yoda This is Yoda.']
examples: [';yoda This is Yoda.'],
args: [{
key: 'text',
prompt: 'What text would you like to convert to Yoda speak?',
type: 'string'
}]
});
}
async run(message) {
async run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
console.log(`[Command] ${message.content}`);
let turnToYoda = message.content.split(" ").slice(1).join(" ");
if (!turnToYoda) {
return message.channel.send(':x: Error! Nothing to translate!');
let turnToYoda = args.text;
try {
let response = await request
.get('https://yoda.p.mashape.com/yoda')
.set({
'X-Mashape-Key': config.mashapekey,
'Accept': 'text/plain'
})
.query({
sentence: turnToYoda
});
if (!response.text) return message.channel.send(':x: Error! Something went wrong! Keep it simple to avoid this error.');
return message.channel.send(response.text);
}
else {
try {
let response = await request
.get('https://yoda.p.mashape.com/yoda')
.set({
'X-Mashape-Key': config.mashapekey,
'Accept': 'text/plain'
})
.query({
sentence: turnToYoda
});
if (!response) {
return message.channel.send(':x: Error! Something went wrong! Keep it simple to avoid this error.');
}
else {
return message.channel.send(response.text);
}
}
catch (err) {
return message.channel.send(":x: Error! Something went wrong!");
}
catch (err) {
return message.channel.send(":x: Error! Something went wrong!");
}
}
};
+10 -12
View File
@@ -8,24 +8,22 @@ module.exports = class ZalgoCommand extends commando.Command {
group: 'textedit',
memberName: 'zalgo',
description: 'Zalgoizes Text (;zalgo This Text)',
examples: [';zalgo This Text']
examples: [';zalgo This Text'],
args: [{
key: 'text',
prompt: 'What text would you like to convert to zalgo?',
type: 'string'
}]
});
}
run(message) {
run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
console.log(`[Command] ${message.content}`);
let zalgoified = zalgo(message.content.split(" ").slice(1).join(" "));
if (!zalgoified) {
return message.channel.send(":x: Error! Nothing to zalgoify!");
}
else if (zalgoified.length > 1950) {
return message.channel.send(":x: Error! Your message is too long!");
}
else {
return message.channel.send(zalgoified);
}
let zalgoified = zalgo(args.text);
if (zalgoified.length > 1950) return message.channel.send(":x: Error! Your message is too long!");
return message.channel.send(zalgoified);
}
};
+9 -13
View File
@@ -7,25 +7,21 @@ module.exports = class AvatarCommand extends commando.Command {
group: 'userinfo',
memberName: 'avatar',
description: "Gives a link to someone's avatar. (;avatar @User)",
examples: [";avatar @XiaoBot"]
examples: [";avatar @XiaoBot"],
args: [{
key: 'user',
prompt: 'Which user would you like to get the avatar of?',
type: 'user'
}]
});
}
run(message) {
run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
console.log(`[Command] ${message.content}`);
if (message.mentions.users.size !== 1) {
return message.channel.send(':x: Error! Please mention one user!');
}
else {
if (!message.mentions.users.first().avatarURL) {
return message.channel.send(":x: Error! This person has no avatar!");
}
else {
return message.channel.send(message.mentions.users.first().avatarURL);
}
}
let user = args.user;
return message.channel.send(user.displayAvatarURL);
}
};
+59 -76
View File
@@ -1,5 +1,7 @@
const commando = require('discord.js-commando');
const Discord = require('discord.js');
const moment = require('moment');
require('moment-duration-format');
module.exports = class UserInfoCommand extends commando.Command {
constructor(Client) {
@@ -13,90 +15,71 @@ module.exports = class UserInfoCommand extends commando.Command {
group: 'userinfo',
memberName: 'user',
description: "Gives some info on a user. (;user @User)",
examples: [";user @User"]
examples: [";user @User"],
guildOnly: true,
args: [{
key: 'user',
prompt: 'Which user would you like to get info on?',
type: 'user'
}]
});
}
run(message) {
run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
}
console.log(`[Command] ${message.content}`);
if (message.channel.type !== 'dm') {
let stat;
switch (message.mentions.users.first().presence.status) {
case "online":
stat = "<:vpOnline:212789758110334977> Online";
break;
case "idle":
stat = "<:vpAway:212789859071426561> Idle";
break;
case "dnd":
stat = "<:vpDnD:230093576355184640> Do Not Disturb";
break;
case "offline":
stat = "<:vpOffline:212790005943369728> Offline";
break;
}
let color;
switch (message.mentions.users.first().presence.status) {
case "online":
color = 0x00AE86;
break;
case "idle":
color = 0xFFFF00;
break;
case "dnd":
color = 0xFF0000;
break;
case "offline":
color = 0x808080;
break;
}
if (message.mentions.users.size !== 1) {
return message.channel.send(':x: Error! Please mention one user!');
}
else {
if (!message.mentions.users.first().presence.game) {
const embed = new Discord.RichEmbed()
.setColor(color)
.setThumbnail(message.mentions.users.first().avatarURL)
.addField('**Name:**',
`${message.mentions.users.first().username}#${message.mentions.users.first().discriminator}`, true)
.addField('**ID:**',
message.mentions.users.first().id, true)
.addField('**Joined Discord On:**',
message.mentions.users.first().createdAt, true)
.addField('**Joined Server On:**',
message.guild.member(message.mentions.users.first()).joinedAt, true)
.addField('**Status:**',
stat, true)
.addField('**Playing:**',
"None", true);
return message.channel.sendEmbed(embed);
}
else {
const embed = new Discord.RichEmbed()
.setColor(color)
.setThumbnail(message.mentions.users.first().avatarURL)
.addField('**Name:**',
`${message.mentions.users.first().username}#${message.mentions.users.first().discriminator}`, true)
.addField('**ID:**',
message.mentions.users.first().id, true)
.addField('**Joined Discord On:**',
message.mentions.users.first().createdAt, true)
.addField('**Joined Server On:**',
message.guild.member(message.mentions.users.first()).joinedAt, true)
.addField('**Status:**',
stat, true)
.addField('**Playing:**',
message.mentions.users.first().presence.game.name, true);
return message.channel.sendEmbed(embed);
}
}
let user = args.user;
let stat;
switch (user.presence.status) {
case "online":
stat = "<:vpOnline:212789758110334977> Online";
break;
case "idle":
stat = "<:vpAway:212789859071426561> Idle";
break;
case "dnd":
stat = "<:vpDnD:230093576355184640> Do Not Disturb";
break;
case "offline":
stat = "<:vpOffline:212790005943369728> Offline";
break;
}
else {
return message.channel.send(":x: Error! This command does not work in DM!");
let color;
switch (user.presence.status) {
case "online":
color = 0x00AE86;
break;
case "idle":
color = 0xFFFF00;
break;
case "dnd":
color = 0xFF0000;
break;
case "offline":
color = 0x808080;
break;
}
let userGame = user.presence.game;
if (!user.presence.game) {
userGame = "None";
}
const embed = new Discord.RichEmbed()
.setColor(color)
.setThumbnail(user.displayAvatarURL)
.addField('**Name:**',
`${user.username}#${user.discriminator}`, true)
.addField('**ID:**',
user.id, true)
.addField('**Joined Discord On:**',
`${user.createdAt} (${moment.duration(user.createdTimestamp - Date.now()).format('y[ years], M[ months], w[ weeks, and ]d[ days]')} ago)`, true)
.addField('**Joined Server On:**',
`${message.guild.member(user).joinedAt} (${moment.duration(message.guild.member(user).joinedTimestamp - Date.now()).format('y[ years], M[ months], w[ weeks, and ]d[ days]')} ago)`, true)
.addField('**Status:**',
stat, true)
.addField('**Playing:**',
userGame, true);
return message.channel.sendEmbed(embed);
}
};
+29 -35
View File
@@ -37,22 +37,20 @@ client.registry
})
.registerCommandsIn(path.join(__dirname, 'commands'));
client.on('message', (message) => {
client.on('message', message => {
if (message.author.bot) return;
if (message.channel.type === 'dm') return;
if (message.content.startsWith(`<@${client.user.id}>`)) {
if (message.guild.id === config.server || message.guild.id === config.personalServer || message.author.id === config.owner) {
if (message.author.id === clevusers.allowed[message.author.id]) {
let cleverMessage = message.content.replace(`<@${client.user.id}>`, "");
console.log(`[Cleverbot] ${cleverMessage}`);
message.channel.startTyping();
cleverbot.write(cleverMessage, function(response) {
message.reply(response.output);
message.channel.stopTyping();
});
}
}
}
if (!message.content.startsWith(`<@${client.user.id}>`)) return;
if (message.guild.id !== config.server || message.guild.id !== config.personalServer || message.author.id !== config.owner) return;
if (!clevusers.allowed[message.author.id]) return;
let cleverMessage = message.content.replace(`<@${client.user.id}>`, "");
console.log(`[Cleverbot] ${cleverMessage}`);
message.channel.startTyping();
cleverbot.write(cleverMessage, async function(response) {
let responseMsg = await message.reply(response.output);
let stopType = await message.channel.stopTyping();
return [responseMsg, stopType];
});
});
client.on('messageReactionAdd', (reaction, user) => {
@@ -63,40 +61,36 @@ client.on('messageReactionAdd', (reaction, user) => {
if (!starboard) return;
if (reaction.message.author.id === user.id) {
reaction.remove(user.id);
reaction.message.channel.send(`:x: Error! ${user.username}, you can't star your own messages!`);
return reaction.message.channel.send(`:x: Error! ${user.username}, you can't star your own messages!`);
}
else {
if (reaction.message.attachments.size > 0 && reaction.message.attachments.first().height) {
const embed = new Discord.RichEmbed()
.setAuthor(reaction.message.author.username, reaction.message.author.avatarURL)
.setColor(0xFFA500)
.setTimestamp()
.setImage(reaction.message.attachments.first().url)
.setDescription(reaction.message.content);
starboard.sendEmbed(embed);
}
else {
const embed = new Discord.RichEmbed()
.setAuthor(reaction.message.author.username, reaction.message.author.avatarURL)
.setColor(0xFFA500)
.setTimestamp()
.setDescription(reaction.message.content);
starboard.sendEmbed(embed);
}
if (reaction.message.attachments.size > 0 && reaction.message.attachments.first().height) {
const embed = new Discord.RichEmbed()
.setAuthor(reaction.message.author.username, reaction.message.author.avatarURL)
.setColor(0xFFA500)
.setTimestamp()
.setImage(reaction.message.attachments.first().url)
.setDescription(reaction.message.content);
return starboard.sendEmbed(embed);
}
const embed = new Discord.RichEmbed()
.setAuthor(reaction.message.author.username, reaction.message.author.avatarURL)
.setColor(0xFFA500)
.setTimestamp()
.setDescription(reaction.message.content);
return starboard.sendEmbed(embed);
});
client.on('guildMemberAdd', (member) => {
if (member.guild.id !== config.server) return;
member.addRole(member.guild.roles.find('name', 'Members'));
let addedMemberName = member.user.username;
member.guild.channels.get(config.announcementChannel).send(`Welcome ${addedMemberName}!`);
return member.guild.channels.get(config.announcementChannel).send(`Welcome ${addedMemberName}!`);
});
client.on('guildMemberRemove', (member) => {
if (member.guild.id !== config.server) return;
let removedMemberName = member.user.username;
member.guild.channels.get(config.announcementChannel).send(`Bye ${removedMemberName}...`);
return member.guild.channels.get(config.announcementChannel).send(`Bye ${removedMemberName}...`);
});
client.on('guildCreate', (guild) => {