Formatting

This commit is contained in:
Daniel Odendahl Jr
2017-03-23 01:35:22 +00:00
parent 72718c7c62
commit 40a4af36c4
109 changed files with 2660 additions and 2505 deletions
+1 -1
View File
@@ -10,4 +10,4 @@
"235218353579491328": "235218353579491328", "235218353579491328": "235218353579491328",
"230395430024904704": "230395430024904704" "230395430024904704": "230395430024904704"
} }
} }
+12 -10
View File
@@ -2,12 +2,12 @@ const commando = require('discord.js-commando');
const Jimp = require("jimp"); const Jimp = require("jimp");
module.exports = class YearsCommand extends commando.Command { module.exports = class YearsCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: '3000years', name: '3000years',
aliases: [ aliases: [
'az' 'az'
], ],
group: 'avataredit', group: 'avataredit',
memberName: '3000years', memberName: '3000years',
description: "It's been 3000 years... (;3000years @User)", description: "It's been 3000 years... (;3000years @User)",
@@ -16,16 +16,18 @@ module.exports = class YearsCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { if (message.channel.type !== 'dm') {
if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
if (message.mentions.users.size !== 1) { if (message.mentions.users.size !== 1) {
message.channel.send(':x: Error! Please mention one user!'); message.channel.send(':x: Error! Please mention one user!');
} else { }
if(message.mentions.users.first().avatarURL === null) { else {
if (message.mentions.users.first().avatarURL === null) {
message.channel.send(":x: Error! This user has no avatar!"); message.channel.send(":x: Error! This user has no avatar!");
} else { }
else {
let userAvatar = message.mentions.users.first().avatarURL; let userAvatar = message.mentions.users.first().avatarURL;
userAvatar = userAvatar.replace(".jpg", ".png"); userAvatar = userAvatar.replace(".jpg", ".png");
userAvatar = userAvatar.replace(".gif", ".png"); userAvatar = userAvatar.replace(".gif", ".png");
@@ -43,4 +45,4 @@ module.exports = class YearsCommand extends commando.Command {
} }
} }
} }
}; };
+12 -10
View File
@@ -2,12 +2,12 @@ const commando = require('discord.js-commando');
const Jimp = require("jimp"); const Jimp = require("jimp");
module.exports = class BeautifulCommand extends commando.Command { module.exports = class BeautifulCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'beautiful', name: 'beautiful',
aliases: [ aliases: [
'grunklestan' 'grunklestan'
], ],
group: 'avataredit', group: 'avataredit',
memberName: 'beautiful', memberName: 'beautiful',
description: 'Oh, this? This is beautiful. (;beautiful @User)', description: 'Oh, this? This is beautiful. (;beautiful @User)',
@@ -16,16 +16,18 @@ module.exports = class BeautifulCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { if (message.channel.type !== 'dm') {
if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
if (message.mentions.users.size !== 1) { if (message.mentions.users.size !== 1) {
message.channel.send(':x: Error! Please mention one user!'); message.channel.send(':x: Error! Please mention one user!');
} else { }
if(message.mentions.users.first().avatarURL === null) { else {
if (message.mentions.users.first().avatarURL === null) {
message.channel.send(":x: Error! This user has no avatar!"); message.channel.send(":x: Error! This user has no avatar!");
} else { }
else {
let userAvatar = message.mentions.users.first().avatarURL; let userAvatar = message.mentions.users.first().avatarURL;
userAvatar = userAvatar.replace(".jpg", ".png"); userAvatar = userAvatar.replace(".jpg", ".png");
userAvatar = userAvatar.replace(".gif", ".png"); userAvatar = userAvatar.replace(".gif", ".png");
@@ -45,4 +47,4 @@ module.exports = class BeautifulCommand extends commando.Command {
} }
} }
} }
}; };
+13 -11
View File
@@ -2,13 +2,13 @@ const commando = require('discord.js-commando');
const Jimp = require("jimp"); const Jimp = require("jimp");
module.exports = class BobRossCommand extends commando.Command { module.exports = class BobRossCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'bobross', name: 'bobross',
aliases: [ aliases: [
'bob', 'bob',
'ross' 'ross'
], ],
group: 'avataredit', group: 'avataredit',
memberName: 'bobross', memberName: 'bobross',
description: "Make Bob Ross draw your avatar. (;bobross @User)", description: "Make Bob Ross draw your avatar. (;bobross @User)",
@@ -17,16 +17,18 @@ module.exports = class BobRossCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { if (message.channel.type !== 'dm') {
if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
if (message.mentions.users.size !== 1) { if (message.mentions.users.size !== 1) {
message.channel.send(':x: Error! Please mention one user!'); message.channel.send(':x: Error! Please mention one user!');
} else { }
if(message.mentions.users.first().avatarURL === null) { else {
if (message.mentions.users.first().avatarURL === null) {
message.channel.send(":x: Error! This user has no avatar!"); message.channel.send(":x: Error! This user has no avatar!");
} else { }
else {
let userAvatar = message.mentions.users.first().avatarURL; let userAvatar = message.mentions.users.first().avatarURL;
userAvatar = userAvatar.replace(".jpg", ".png"); userAvatar = userAvatar.replace(".jpg", ".png");
userAvatar = userAvatar.replace(".gif", ".png"); userAvatar = userAvatar.replace(".gif", ".png");
@@ -47,4 +49,4 @@ module.exports = class BobRossCommand extends commando.Command {
} }
} }
} }
}; };
+13 -11
View File
@@ -2,13 +2,13 @@ const commando = require('discord.js-commando');
const Jimp = require("jimp"); const Jimp = require("jimp");
module.exports = class RIPCommand extends commando.Command { module.exports = class RIPCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'rip', name: 'rip',
aliases: [ aliases: [
'grave', 'grave',
'gravestone' 'gravestone'
], ],
group: 'avataredit', group: 'avataredit',
memberName: 'rip', memberName: 'rip',
description: 'Puts a profile picture over a gravestone. (;rip @User)', description: 'Puts a profile picture over a gravestone. (;rip @User)',
@@ -17,16 +17,18 @@ module.exports = class RIPCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { if (message.channel.type !== 'dm') {
if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
if (message.mentions.users.size !== 1) { if (message.mentions.users.size !== 1) {
message.channel.send(':x: Error! Please mention one user!'); message.channel.send(':x: Error! Please mention one user!');
} else { }
if(message.mentions.users.first().avatarURL === null) { else {
if (message.mentions.users.first().avatarURL === null) {
message.channel.send(":x: Error! This user has no avatar!"); message.channel.send(":x: Error! This user has no avatar!");
} else { }
else {
let userAvatar = message.mentions.users.first().avatarURL; let userAvatar = message.mentions.users.first().avatarURL;
userAvatar = userAvatar.replace(".jpg", ".png"); userAvatar = userAvatar.replace(".jpg", ".png");
userAvatar = userAvatar.replace(".gif", ".png"); userAvatar = userAvatar.replace(".gif", ".png");
@@ -44,4 +46,4 @@ module.exports = class RIPCommand extends commando.Command {
} }
} }
} }
}; };
+16 -13
View File
@@ -2,12 +2,12 @@ const commando = require('discord.js-commando');
const Jimp = require("jimp"); const Jimp = require("jimp");
module.exports = class SteamCardCommand extends commando.Command { module.exports = class SteamCardCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'steamcard', name: 'steamcard',
aliases: [ aliases: [
'card' 'card'
], ],
group: 'avataredit', group: 'avataredit',
memberName: 'steamcard', memberName: 'steamcard',
description: "Put an avatar on a Steam Card. (;steamcard @User)", description: "Put an avatar on a Steam Card. (;steamcard @User)",
@@ -16,17 +16,19 @@ module.exports = class SteamCardCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { if (message.channel.type !== 'dm') {
if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
if(message.channel.type !== 'dm') { if (message.channel.type !== 'dm') {
if (message.mentions.users.size !== 1) { if (message.mentions.users.size !== 1) {
message.channel.send(':x: Error! Please mention one user!'); message.channel.send(':x: Error! Please mention one user!');
} else { }
if(message.mentions.users.first().avatarURL === null) { else {
if (message.mentions.users.first().avatarURL === null) {
message.channel.send(":x: Error! This user has no avatar!"); message.channel.send(":x: Error! This user has no avatar!");
} else { }
else {
let userDisplayName = message.guild.member(message.mentions.users.first()).displayName; let userDisplayName = message.guild.member(message.mentions.users.first()).displayName;
let userAvatar = message.mentions.users.first().avatarURL; let userAvatar = message.mentions.users.first().avatarURL;
userAvatar = userAvatar.replace(".jpg", ".png"); userAvatar = userAvatar.replace(".jpg", ".png");
@@ -36,7 +38,7 @@ module.exports = class SteamCardCommand extends commando.Command {
images.push(Jimp.read("./images/SteamCard.png")); images.push(Jimp.read("./images/SteamCard.png"));
images.push(Jimp.read("./images/SteamCardBlank.png")); images.push(Jimp.read("./images/SteamCardBlank.png"));
Promise.all(images).then(([avatar, steamcard, nothing]) => { Promise.all(images).then(([avatar, steamcard, nothing]) => {
Jimp.loadFont(Jimp.FONT_SANS_32_WHITE).then(function (font) { Jimp.loadFont(Jimp.FONT_SANS_32_WHITE).then(function(font) {
avatar.resize(450, 450); avatar.resize(450, 450);
nothing.composite(avatar, 25, 25); nothing.composite(avatar, 25, 25);
nothing.composite(steamcard, 0, 0); nothing.composite(steamcard, 0, 0);
@@ -49,8 +51,9 @@ module.exports = class SteamCardCommand extends commando.Command {
}); });
} }
} }
} else { }
else {
message.channel.send(':x: Error! This command does not work in DM!'); message.channel.send(':x: Error! This command does not work in DM!');
} }
} }
}; };
+1 -1
View File
@@ -2,4 +2,4 @@
"banned": { "banned": {
"155112606661607425": "155112606661607425" "155112606661607425": "155112606661607425"
} }
} }
+14 -12
View File
@@ -3,14 +3,14 @@ const banlist = require('./banlist.json');
const config = require('../../config.json'); const config = require('../../config.json');
module.exports = class ContactCommand extends commando.Command { module.exports = class ContactCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'contact', name: 'contact',
aliases: [ aliases: [
'suggest', 'suggest',
'report', 'report',
'bug' 'bug'
], ],
group: 'botinfo', group: 'botinfo',
memberName: 'contact', memberName: 'contact',
description: 'Report bugs or request new features. (;contact Fix this command!)', description: 'Report bugs or request new features. (;contact Fix this command!)',
@@ -19,21 +19,23 @@ module.exports = class ContactCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { 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'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let banID = message.author.id; let banID = message.author.id;
let messageToReport = message.content.split(" ").slice(1).join(" "); let messageToReport = message.content.split(" ").slice(1).join(" ");
if (message.author.id === banlist.banned[banID]) { if (message.author.id === banlist.banned[banID]) {
message.channel.send("Sorry, you've been banned from using this command."); message.channel.send("Sorry, you've been banned from using this command.");
} else { }
if(messageToReport === '') { else {
if (messageToReport === '') {
message.channel.send(':x: Error! Please do not report nothing!'); message.channel.send(':x: Error! Please do not report nothing!');
} else { }
else {
this.client.users.get(config.owner).send("**" + message.author.username + '#' + message.author.discriminator + " (" + message.author.id + ")" + ":**\n" + messageToReport); this.client.users.get(config.owner).send("**" + message.author.username + '#' + message.author.discriminator + " (" + message.author.id + ")" + ":**\n" + messageToReport);
message.channel.send('Message Sent! Thanks for your support!'); message.channel.send('Message Sent! Thanks for your support!');
} }
} }
} }
}; };
+49 -49
View File
@@ -5,13 +5,13 @@ const moment = require('moment');
require('moment-duration-format'); require('moment-duration-format');
module.exports = class InfoCommand extends commando.Command { module.exports = class InfoCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'info', name: 'info',
aliases: [ aliases: [
'data', 'data',
'information' 'information'
], ],
group: 'botinfo', group: 'botinfo',
memberName: 'info', memberName: 'info',
description: 'Gives some bot info. (;info)', description: 'Gives some bot info. (;info)',
@@ -20,56 +20,56 @@ module.exports = class InfoCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { if (message.channel.type !== 'dm') {
if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
this.client.shard.fetchClientValues('guilds.size').then(guilds => { this.client.shard.fetchClientValues('guilds.size').then(guilds => {
this.client.shard.fetchClientValues('voiceConnections.size').then(vCConnections => { this.client.shard.fetchClientValues('voiceConnections.size').then(vCConnections => {
const embed = new Discord.RichEmbed() const embed = new Discord.RichEmbed()
.setTitle('Welcome to XiaoBot!') .setTitle('Welcome to XiaoBot!')
.setAuthor(this.client.user.username, this.client.user.avatarURL) .setAuthor(this.client.user.username, this.client.user.avatarURL)
.setColor(0x00AE86) .setColor(0x00AE86)
.setDescription('XiaoBot is your personal companion for your Discord Server!') .setDescription('XiaoBot is your personal companion for your Discord Server!')
.setFooter('©2017 dragonfire535 | Created ' + moment.duration(this.client.user.createdTimestamp - Date.now()).format('y[ years], M[ months], w[ weeks, and ]d[ days]') + ' ago!') .setFooter('©2017 dragonfire535 | Created ' + moment.duration(this.client.user.createdTimestamp - Date.now()).format('y[ years], M[ months], w[ weeks, and ]d[ days]') + ' ago!')
.setThumbnail(this.client.user.avatarURL) .setThumbnail(this.client.user.avatarURL)
.setURL('http://dragonfire535.weebly.com/xiaobot.html') .setURL('http://dragonfire535.weebly.com/xiaobot.html')
.addField('Commands', .addField('Commands',
"There are a variety of commands XiaoBot can use! Use ';help' to view a list of all commands!") "There are a variety of commands XiaoBot can use! Use ';help' to view a list of all commands!")
.addField('Servers', .addField('Servers',
this.client.guilds.size + " / " + guilds.reduce((prev, val) => prev + val, 0), true) this.client.guilds.size + " / " + guilds.reduce((prev, val) => prev + val, 0), true)
.addField('Shards', .addField('Shards',
this.client.options.shardCount + " (This is Shard: " + this.client.shard.id + ")", true) this.client.options.shardCount + " (This is Shard: " + this.client.shard.id + ")", true)
.addField('Commands', .addField('Commands',
config.commandCount, true) config.commandCount, true)
.addField('Owner', .addField('Owner',
"dragonfire535#8081", true) "dragonfire535#8081", true)
.addField('Source Code', .addField('Source Code',
"[View Here](https://github.com/dragonfire535/xiaobot)", true) "[View Here](https://github.com/dragonfire535/xiaobot)", true)
.addField('Memory Usage', .addField('Memory Usage',
`${Math.round(process.memoryUsage().heapUsed / 1024 / 1024)}MB`, true) `${Math.round(process.memoryUsage().heapUsed / 1024 / 1024)}MB`, true)
.addField('Uptime', .addField('Uptime',
moment.duration(this.client.uptime).format('d[d]h[h]m[m]s[s]'), true) moment.duration(this.client.uptime).format('d[d]h[h]m[m]s[s]'), true)
.addField('Node Version', .addField('Node Version',
process.version, true) process.version, true)
.addField('Voice Connections', .addField('Voice Connections',
this.client.voiceConnections.size + " / " + vCConnections.reduce((prev, val) => prev + val, 0), true) this.client.voiceConnections.size + " / " + vCConnections.reduce((prev, val) => prev + val, 0), true)
.addField('Library', .addField('Library',
"[discord.js](https://discord.js.org/#/) / [commando](https://github.com/Gawdl3y/discord.js-commando)", true) "[discord.js](https://discord.js.org/#/) / [commando](https://github.com/Gawdl3y/discord.js-commando)", true)
.addField('Modules', .addField('Modules',
"[cleverbot-node](https://github.com/fojas/cleverbot-node), [pirate-speak](https://github.com/mikewesthad/pirate-speak), [google-translate-api](https://github.com/matheuss/google-translate-api), [urban](https://github.com/mvrilo/urban), [zalgoize](https://github.com/clux/zalgolize), [hepburn](https://github.com/lovell/hepburn), [yahoo-weather](https://github.com/mamal72/node-yahoo-weather), [imdb-api](https://github.com/worr/node-imdb-api), [string-to-binary](https://www.npmjs.com/package/string-to-binary), [roman-numeral-converter-mmxvi](https://github.com/Cein-Markey/roman-numeral-conversion-library), [cowsay](https://github.com/piuccio/cowsay), [morse](https://github.com/ecto/morse)") "[cleverbot-node](https://github.com/fojas/cleverbot-node), [pirate-speak](https://github.com/mikewesthad/pirate-speak), [google-translate-api](https://github.com/matheuss/google-translate-api), [urban](https://github.com/mvrilo/urban), [zalgoize](https://github.com/clux/zalgolize), [hepburn](https://github.com/lovell/hepburn), [yahoo-weather](https://github.com/mamal72/node-yahoo-weather), [imdb-api](https://github.com/worr/node-imdb-api), [string-to-binary](https://www.npmjs.com/package/string-to-binary), [roman-numeral-converter-mmxvi](https://github.com/Cein-Markey/roman-numeral-conversion-library), [cowsay](https://github.com/piuccio/cowsay), [morse](https://github.com/ecto/morse)")
.addField('Utility Modules', .addField('Utility Modules',
"[superagent](https://github.com/visionmedia/superagent), [mathjs](http://mathjs.org/), [moment](http://momentjs.com), [moment-duration-format](https://github.com/jsmreese/moment-duration-format), [opusscript](https://github.com/abalabahaha/opusscript), [jimp](https://github.com/oliver-moran/jimp)") "[superagent](https://github.com/visionmedia/superagent), [mathjs](http://mathjs.org/), [moment](http://momentjs.com), [moment-duration-format](https://github.com/jsmreese/moment-duration-format), [opusscript](https://github.com/abalabahaha/opusscript), [jimp](https://github.com/oliver-moran/jimp)")
.addField('APIs', .addField('APIs',
"[Cleverbot API](https://www.cleverbot.com/api/), [Wattpad API](https://developer.wattpad.com/docs/api), [Wordnik API](http://developer.wordnik.com/docs.html), [osu! API](https://osu.ppy.sh/p/api), [memegen.link](https://memegen.link/), [Yugioh Prices API](http://docs.yugiohprices.apiary.io/#), [YouTube Data API](https://developers.google.com/youtube/v3/), [Yoda Speak API](https://market.mashape.com/ismaelc/yoda-speak), [Discord Bots API](https://bots.discord.pw/api)") "[Cleverbot API](https://www.cleverbot.com/api/), [Wattpad API](https://developer.wattpad.com/docs/api), [Wordnik API](http://developer.wordnik.com/docs.html), [osu! API](https://osu.ppy.sh/p/api), [memegen.link](https://memegen.link/), [Yugioh Prices API](http://docs.yugiohprices.apiary.io/#), [YouTube Data API](https://developers.google.com/youtube/v3/), [Yoda Speak API](https://market.mashape.com/ismaelc/yoda-speak), [Discord Bots API](https://bots.discord.pw/api)")
.addField('Other Credit', .addField('Other Credit',
"[Heroku](https://www.heroku.com/), [Cloud9](https://c9.io/), [heroku-buildpack-ffmpeg-latest](https://elements.heroku.com/buildpacks/jonathanong/heroku-buildpack-ffmpeg-latest)") "[Heroku](https://www.heroku.com/), [Cloud9](https://c9.io/), [heroku-buildpack-ffmpeg-latest](https://elements.heroku.com/buildpacks/jonathanong/heroku-buildpack-ffmpeg-latest)")
.addField('My Server', .addField('My Server',
"[Click Here to Join!](https://discord.gg/fqQF8mc)") "[Click Here to Join!](https://discord.gg/fqQF8mc)")
.addField('Invite Link:', .addField('Invite Link:',
"[Click Here to Add Me to Your Server!](https://discordapp.com/oauth2/authorize?client_id=278305350804045834&scope=bot&permissions=1345846343)"); "[Click Here to Add Me to Your Server!](https://discordapp.com/oauth2/authorize?client_id=278305350804045834&scope=bot&permissions=1345846343)");
message.channel.sendEmbed(embed).catch(console.error); message.channel.sendEmbed(embed).catch(console.error);
}); });
}); });
} }
}; };
+4 -4
View File
@@ -1,7 +1,7 @@
const commando = require('discord.js-commando'); const commando = require('discord.js-commando');
module.exports = class InviteCommand extends commando.Command { module.exports = class InviteCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'invite', name: 'invite',
group: 'botinfo', group: 'botinfo',
@@ -12,10 +12,10 @@ module.exports = class InviteCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { 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'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
message.channel.send("Add me to your server with this link:\nhttps://discordapp.com/oauth2/authorize?client_id=278305350804045834&scope=bot&permissions=1345846343\nOr, come to my server with this link:\nhttps://discord.gg/fqQF8mc"); message.channel.send("Add me to your server with this link:\nhttps://discordapp.com/oauth2/authorize?client_id=278305350804045834&scope=bot&permissions=1345846343\nOr, come to my server with this link:\nhttps://discord.gg/fqQF8mc");
} }
}; };
+4 -4
View File
@@ -3,7 +3,7 @@ const moment = require('moment');
require('moment-duration-format'); require('moment-duration-format');
module.exports = class UptimeCommand extends commando.Command { module.exports = class UptimeCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'uptime', name: 'uptime',
group: 'botinfo', group: 'botinfo',
@@ -14,10 +14,10 @@ module.exports = class UptimeCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { 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'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
message.channel.send("I've been active on this shard for: **" + moment.duration(this.client.uptime).format('d[ days], h[ hours], m[ minutes, and ]s[ seconds]') + "** in a total of " + this.client.guilds.size + " Servers."); message.channel.send("I've been active on this shard for: **" + moment.duration(this.client.uptime).format('d[ days], h[ hours], m[ minutes, and ]s[ seconds]') + "** in a total of " + this.client.guilds.size + " Servers.");
} }
}; };
+10 -9
View File
@@ -1,14 +1,14 @@
const commando = require('discord.js-commando'); const commando = require('discord.js-commando');
module.exports = class EmojiCommand extends commando.Command { module.exports = class EmojiCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'emoji', name: 'emoji',
aliases: [ aliases: [
'emoticons', 'emoticons',
'emojilist', 'emojilist',
'emoticonlist' 'emoticonlist'
], ],
group: 'guildinfo', group: 'guildinfo',
memberName: 'emoji', memberName: 'emoji',
description: "Gives a list of the current server's emoji. (;emoji)", description: "Gives a list of the current server's emoji. (;emoji)",
@@ -17,14 +17,15 @@ module.exports = class EmojiCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { 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'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
if (message.channel.type !== 'dm') { if (message.channel.type !== 'dm') {
message.channel.send(message.guild.emojis.map(e => e).join(" ")); message.channel.send(message.guild.emojis.map(e => e).join(" "));
} else { }
else {
message.channel.send(":x: Error! This command does not work in DM!"); message.channel.send(":x: Error! This command does not work in DM!");
} }
} }
}; };
+26 -25
View File
@@ -2,14 +2,14 @@ const commando = require('discord.js-commando');
const Discord = require('discord.js'); const Discord = require('discord.js');
module.exports = class GuildInfoCommand extends commando.Command { module.exports = class GuildInfoCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'server', name: 'server',
aliases: [ aliases: [
'guild', 'guild',
'serverinfo', 'serverinfo',
'guildinfo' 'guildinfo'
], ],
group: 'guildinfo', group: 'guildinfo',
memberName: 'server', memberName: 'server',
description: 'Gives some info on the current server. (;server)', description: 'Gives some info on the current server. (;server)',
@@ -18,31 +18,32 @@ module.exports = class GuildInfoCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { if (message.channel.type !== 'dm') {
if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
if (message.channel.type !== 'dm') { if (message.channel.type !== 'dm') {
const embed = new Discord.RichEmbed() const embed = new Discord.RichEmbed()
.setColor(0x00AE86) .setColor(0x00AE86)
.setThumbnail(message.guild.iconURL) .setThumbnail(message.guild.iconURL)
.addField('**Name:**', .addField('**Name:**',
message.guild.name, true) message.guild.name, true)
.addField('**ID:**', .addField('**ID:**',
message.guild.id, true) message.guild.id, true)
.addField('**Created On:**', .addField('**Created On:**',
message.guild.createdAt, true) message.guild.createdAt, true)
.addField('**Default Channel:**', .addField('**Default Channel:**',
message.guild.defaultChannel, true) message.guild.defaultChannel, true)
.addField('**Region:**', .addField('**Region:**',
message.guild.region, true) message.guild.region, true)
.addField('**Owner:**', .addField('**Owner:**',
message.guild.owner.user.username + '#' + message.guild.owner.user.discriminator, true) message.guild.owner.user.username + '#' + message.guild.owner.user.discriminator, true)
.addField("**Users:**", .addField("**Users:**",
message.guild.memberCount, true); message.guild.memberCount, true);
message.channel.sendEmbed(embed).catch(console.error); message.channel.sendEmbed(embed).catch(console.error);
} else { }
else {
message.channel.send(":x: Error! This command does not work in DM!"); message.channel.send(":x: Error! This command does not work in DM!");
} }
} }
}; };
+22 -16
View File
@@ -2,12 +2,12 @@ const commando = require('discord.js-commando');
const memecodes = require('./memecodes.json'); const memecodes = require('./memecodes.json');
module.exports = class MemeCommand extends commando.Command { module.exports = class MemeCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'meme', name: 'meme',
aliases: [ aliases: [
'memegen' 'memegen'
], ],
group: 'imageedit', group: 'imageedit',
memberName: 'meme', 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)", 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)",
@@ -16,35 +16,41 @@ module.exports = class MemeCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { if (message.channel.type !== 'dm') {
if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let [type] = message.content.toLowerCase().split(" ").slice(1); let [type] = message.content.toLowerCase().split(" ").slice(1);
if(type === "list") { if (type === "list") {
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"); 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]+$/)) { 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 memeQuery = message.content.split(" ").slice(2).join("-").split('-|-');
let toprow = memeQuery[0].split("?").join("~q"); let toprow = memeQuery[0].split("?").join("~q");
let bottomrow = memeQuery[1].split("?").join("~q"); let bottomrow = memeQuery[1].split("?").join("~q");
let link = "https://memegen.link/" + type + "/" + toprow + "/" + bottomrow + ".jpg"; let link = "https://memegen.link/" + type + "/" + toprow + "/" + bottomrow + ".jpg";
if(bottomrow.length > 100) { if (bottomrow.length > 100) {
message.channel.send(":x: Error! Bottom text is over 100 characters!"); message.channel.send(":x: Error! Bottom text is over 100 characters!");
} else if(toprow.length > 100) { }
else if (toprow.length > 100) {
message.channel.send(":x: Error! Top text is over 100 characters!"); message.channel.send(":x: Error! Top text is over 100 characters!");
} else { }
if(memecodes.memecodes[type]) { else {
if (memecodes.memecodes[type]) {
message.channel.sendFile(link).catch(error => message.channel.send(":x: An Error Occurred! Please try again later!")); message.channel.sendFile(link).catch(error => message.channel.send(":x: An Error Occurred! Please try again later!"));
} else { }
else {
message.channel.send(":x: Error! Meme type not found! Use `;meme list` to view of list of meme codes!"); message.channel.send(":x: Error! Meme type not found! Use `;meme list` to view of list of meme codes!");
} }
} }
} else { }
else {
message.channel.send(":x: Error! Only letters, numbers, periods, commas, apostrophes, exclamation points, and question marks are allowed!"); message.channel.send(":x: Error! Only letters, numbers, periods, commas, apostrophes, exclamation points, and question marks are allowed!");
} }
} else { }
else {
message.channel.send(":x: Split your two choices with a ' | '!"); message.channel.send(":x: Split your two choices with a ' | '!");
} }
} }
}; };
+1 -1
View File
@@ -96,4 +96,4 @@
"elf": "elf", "elf": "elf",
"chosen": "chosen" "chosen": "chosen"
} }
} }
+22 -17
View File
@@ -2,7 +2,7 @@ const commando = require('discord.js-commando');
const Discord = require('discord.js'); const Discord = require('discord.js');
module.exports = class BanCommand extends commando.Command { module.exports = class BanCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'ban', name: 'ban',
aliases: [ aliases: [
@@ -16,8 +16,8 @@ module.exports = class BanCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { if (message.channel.type !== 'dm') {
if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS', 'BAN_MEMBERS'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS', 'BAN_MEMBERS'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
if (message.channel.type !== 'dm') { if (message.channel.type !== 'dm') {
@@ -25,31 +25,36 @@ module.exports = class BanCommand extends commando.Command {
let reason = message.content.split(" ").slice(2).join(" "); let reason = message.content.split(" ").slice(2).join(" ");
if (message.mentions.users.size !== 1) { if (message.mentions.users.size !== 1) {
message.channel.send(":x: Error! Please mention one user!"); message.channel.send(":x: Error! Please mention one user!");
} else { }
if(message.member.hasPermission('BAN_MEMBERS')) { else {
if(message.guild.member(userToBan).bannable) { if (message.member.hasPermission('BAN_MEMBERS')) {
if (message.guild.member(userToBan).bannable) {
message.channel.send(":ok_hand:"); message.channel.send(":ok_hand:");
message.guild.member(userToBan).ban(); message.guild.member(userToBan).ban();
if(message.guild.channels.exists("name", "mod_logs")) { if (message.guild.channels.exists("name", "mod_logs")) {
const embed = new Discord.RichEmbed() const embed = new Discord.RichEmbed()
.setAuthor(message.author.username + '#' + message.author.discriminator, message.author.avatarURL) .setAuthor(message.author.username + '#' + message.author.discriminator, message.author.avatarURL)
.setColor(0xFF0000) .setColor(0xFF0000)
.setFooter('XiaoBot Moderation', this.client.user.avatarURL) .setFooter('XiaoBot Moderation', this.client.user.avatarURL)
.setTimestamp() .setTimestamp()
.setDescription('**Member:** ' + userToBan.username + '#' + userToBan.discriminator + ' (' + userToBan.id + ')\n**Action:** Ban\n**Reason:** ' + reason); .setDescription('**Member:** ' + userToBan.username + '#' + userToBan.discriminator + ' (' + userToBan.id + ')\n**Action:** Ban\n**Reason:** ' + reason);
message.guild.channels.find('name', 'mod_logs').sendEmbed(embed).catch(console.error); message.guild.channels.find('name', 'mod_logs').sendEmbed(embed).catch(console.error);
} else { }
else {
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.**"); 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 { }
else {
message.channel.send(":x: Error! This member cannot be banned! Perhaps they have a higher role than me?"); message.channel.send(":x: Error! This member cannot be banned! Perhaps they have a higher role than me?");
} }
} else { }
else {
message.channel.send(":x: Error! You don't have the Ban Members Permission!"); message.channel.send(":x: Error! You don't have the Ban Members Permission!");
} }
} }
} else { }
else {
message.channel.send(":x: Error! This command does not work in DM!"); message.channel.send(":x: Error! This command does not work in DM!");
} }
} }
}; };
+22 -17
View File
@@ -2,7 +2,7 @@ const commando = require('discord.js-commando');
const Discord = require('discord.js'); const Discord = require('discord.js');
module.exports = class KickCommand extends commando.Command { module.exports = class KickCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'kick', name: 'kick',
group: 'moderation', group: 'moderation',
@@ -13,8 +13,8 @@ module.exports = class KickCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { if (message.channel.type !== 'dm') {
if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS', 'KICK_MEMBERS'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS', 'KICK_MEMBERS'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
if (message.channel.type !== 'dm') { if (message.channel.type !== 'dm') {
@@ -22,31 +22,36 @@ module.exports = class KickCommand extends commando.Command {
let reason = message.content.split(" ").slice(2).join(" "); let reason = message.content.split(" ").slice(2).join(" ");
if (message.mentions.users.size !== 1) { if (message.mentions.users.size !== 1) {
message.channel.send(":x: Error! Please mention one user!"); message.channel.send(":x: Error! Please mention one user!");
} else { }
if(message.member.hasPermission('KICK_MEMBERS')) { else {
if(message.guild.member(userToKick).kickable) { if (message.member.hasPermission('KICK_MEMBERS')) {
if (message.guild.member(userToKick).kickable) {
message.channel.send(":ok_hand:"); message.channel.send(":ok_hand:");
message.guild.member(userToKick).kick(); message.guild.member(userToKick).kick();
if(message.guild.channels.exists("name", "mod_logs")) { if (message.guild.channels.exists("name", "mod_logs")) {
const embed = new Discord.RichEmbed() const embed = new Discord.RichEmbed()
.setAuthor(message.author.username + '#' + message.author.discriminator, message.author.avatarURL) .setAuthor(message.author.username + '#' + message.author.discriminator, message.author.avatarURL)
.setColor(0xFFA500) .setColor(0xFFA500)
.setFooter('XiaoBot Moderation', this.client.user.avatarURL) .setFooter('XiaoBot Moderation', this.client.user.avatarURL)
.setTimestamp() .setTimestamp()
.setDescription('**Member:** ' + userToKick.username + '#' + userToKick.discriminator + ' (' + userToKick.id + ')\n**Action:** Kick\n**Reason:** ' + reason); .setDescription('**Member:** ' + userToKick.username + '#' + userToKick.discriminator + ' (' + userToKick.id + ')\n**Action:** Kick\n**Reason:** ' + reason);
message.guild.channels.find('name', 'mod_logs').sendEmbed(embed).catch(console.error); message.guild.channels.find('name', 'mod_logs').sendEmbed(embed).catch(console.error);
} else { }
else {
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.**"); 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 { }
else {
message.channel.send(":x: Error! This member cannot be kicked! Perhaps they have a higher role than me?"); message.channel.send(":x: Error! This member cannot be kicked! Perhaps they have a higher role than me?");
} }
} else { }
else {
message.channel.send(":x: Error! You don't have the Kick Members Permission!"); message.channel.send(":x: Error! You don't have the Kick Members Permission!");
} }
} }
} else { }
else {
message.channel.send(":x: Error! This command does not work in DM!"); message.channel.send(":x: Error! This command does not work in DM!");
} }
} }
}; };
+19 -15
View File
@@ -2,7 +2,7 @@ const commando = require('discord.js-commando');
const Discord = require('discord.js'); const Discord = require('discord.js');
module.exports = class WarnCommand extends commando.Command { module.exports = class WarnCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'warn', name: 'warn',
group: 'moderation', group: 'moderation',
@@ -13,8 +13,8 @@ module.exports = class WarnCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { if (message.channel.type !== 'dm') {
if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
if (message.channel.type !== 'dm') { if (message.channel.type !== 'dm') {
@@ -22,26 +22,30 @@ module.exports = class WarnCommand extends commando.Command {
let reason = message.content.split(" ").slice(2).join(" "); let reason = message.content.split(" ").slice(2).join(" ");
if (message.mentions.users.size !== 1) { if (message.mentions.users.size !== 1) {
message.channel.send(":x: Error! Please mention one user!"); message.channel.send(":x: Error! Please mention one user!");
} else { }
if(message.member.hasPermission('MANAGE_MESSAGES')) { else {
if (message.member.hasPermission('MANAGE_MESSAGES')) {
message.channel.send(":ok_hand:"); message.channel.send(":ok_hand:");
if(message.guild.channels.exists("name", "mod_logs")) { if (message.guild.channels.exists("name", "mod_logs")) {
const embed = new Discord.RichEmbed() const embed = new Discord.RichEmbed()
.setAuthor(message.author.username + '#' + message.author.discriminator, message.author.avatarURL) .setAuthor(message.author.username + '#' + message.author.discriminator, message.author.avatarURL)
.setColor(0xFFFF00) .setColor(0xFFFF00)
.setFooter('XiaoBot Moderation', this.client.user.avatarURL) .setFooter('XiaoBot Moderation', this.client.user.avatarURL)
.setTimestamp() .setTimestamp()
.setDescription('**Member:** ' + userToWarn.username + '#' + userToWarn.discriminator + ' (' + userToWarn.id + ')\n**Action:** Warn\n**Reason:** ' + reason); .setDescription('**Member:** ' + userToWarn.username + '#' + userToWarn.discriminator + ' (' + userToWarn.id + ')\n**Action:** Warn\n**Reason:** ' + reason);
message.guild.channels.find('name', 'mod_logs').sendEmbed(embed).catch(console.error); message.guild.channels.find('name', 'mod_logs').sendEmbed(embed).catch(console.error);
} else { }
else {
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.**"); 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 { }
else {
message.channel.send(":x: Error! You don't have the Manage Messages Permission!"); message.channel.send(":x: Error! You don't have the Manage Messages Permission!");
} }
} }
} else { }
else {
message.channel.send(":x: Error! This command does not work in DM!"); message.channel.send(":x: Error! This command does not work in DM!");
} }
} }
}; };
+6 -5
View File
@@ -2,7 +2,7 @@ const commando = require('discord.js-commando');
const math = require('mathjs'); const math = require('mathjs');
module.exports = class MathCommand extends commando.Command { module.exports = class MathCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'math', name: 'math',
aliases: [ aliases: [
@@ -19,16 +19,17 @@ module.exports = class MathCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { 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'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let expression = message.content.split(" ").slice(1).join(" "); let expression = message.content.split(" ").slice(1).join(" ");
try { try {
let solved = math.eval(expression); let solved = math.eval(expression);
message.channel.send(solved).catch(error => message.channel.send(":x: Error! Invalid statement!")); message.channel.send(solved).catch(error => message.channel.send(":x: Error! Invalid statement!"));
} catch(err) { }
catch (err) {
message.channel.send(":x: Error! Invalid statement!"); message.channel.send(":x: Error! Invalid statement!");
} }
} }
}; };
+8 -7
View File
@@ -2,9 +2,9 @@ const commando = require('discord.js-commando');
const romanNumeralConverter = require('roman-numeral-converter-mmxvi'); const romanNumeralConverter = require('roman-numeral-converter-mmxvi');
module.exports = class RomanCommand extends commando.Command { module.exports = class RomanCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'roman', name: 'roman',
group: 'numedit', group: 'numedit',
memberName: 'roman', memberName: 'roman',
description: 'Converts numbers to Roman Numerals. (;roman 2)', description: 'Converts numbers to Roman Numerals. (;roman 2)',
@@ -13,16 +13,17 @@ module.exports = class RomanCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { 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'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let numberToRoman = message.content.split(" ").slice(1).join(" "); let numberToRoman = message.content.split(" ").slice(1).join(" ");
let romanInterger = Number(numberToRoman); let romanInterger = Number(numberToRoman);
if(romanInterger > 1000000) { if (romanInterger > 1000000) {
message.channel.send(':x: Error! Number is too high!'); message.channel.send(':x: Error! Number is too high!');
} else { }
else {
message.channel.send(romanNumeralConverter.getRomanFromInteger(romanInterger)).catch(error => message.channel.send(':x: Error! Something went wrong! Perhaps you entered nothing?')); message.channel.send(romanNumeralConverter.getRomanFromInteger(romanInterger)).catch(error => message.channel.send(':x: Error! Something went wrong! Perhaps you entered nothing?'));
} }
} }
}; };
+4 -4
View File
@@ -1,7 +1,7 @@
const commando = require('discord.js-commando'); const commando = require('discord.js-commando');
module.exports = class CanYouNot extends commando.Command { module.exports = class CanYouNot extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'canyounot', name: 'canyounot',
group: 'random', group: 'random',
@@ -12,10 +12,10 @@ module.exports = class CanYouNot extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { 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'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
message.channel.send('Can YOU not?'); message.channel.send('Can YOU not?');
} }
}; };
+4 -4
View File
@@ -1,7 +1,7 @@
const commando = require('discord.js-commando'); const commando = require('discord.js-commando');
module.exports = class GiveFlowerCommand extends commando.Command { module.exports = class GiveFlowerCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'giveflower', name: 'giveflower',
aliases: [ aliases: [
@@ -16,10 +16,10 @@ module.exports = class GiveFlowerCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { 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'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
message.channel.send('Ooh, what a pretty flower. What, I may have it? Thanks! I like flowers, yes? ♪'); message.channel.send('Ooh, what a pretty flower. What, I may have it? Thanks! I like flowers, yes? ♪');
} }
}; };
+4 -4
View File
@@ -1,7 +1,7 @@
const commando = require('discord.js-commando'); const commando = require('discord.js-commando');
module.exports = class LennyCommand extends commando.Command { module.exports = class LennyCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'lenny', name: 'lenny',
group: 'random', group: 'random',
@@ -12,10 +12,10 @@ module.exports = class LennyCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { 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'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
message.channel.send('( ͡° ͜ʖ ͡°)'); message.channel.send('( ͡° ͜ʖ ͡°)');
} }
}; };
+7 -6
View File
@@ -1,7 +1,7 @@
const commando = require('discord.js-commando'); const commando = require('discord.js-commando');
module.exports = class LotteryCommand extends commando.Command { module.exports = class LotteryCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'lottery', name: 'lottery',
group: 'random', group: 'random',
@@ -12,15 +12,16 @@ module.exports = class LotteryCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { 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'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let lotteryNumber = ['Winner'][Math.floor(Math.random() * 100)]; let lotteryNumber = ['Winner'][Math.floor(Math.random() * 100)];
if(lotteryNumber === "Winner") { if (lotteryNumber === "Winner") {
message.channel.send("Wow " + message.author.username + "! You actually won! Great job!"); message.channel.send("Wow " + message.author.username + "! You actually won! Great job!");
} else { }
else {
message.channel.send("Nope, sorry, " + message.author.username + ", you lost."); message.channel.send("Nope, sorry, " + message.author.username + ", you lost.");
} }
} }
}; };
+18 -17
View File
@@ -3,7 +3,7 @@ const Discord = require('discord.js');
const math = require('mathjs'); const math = require('mathjs');
module.exports = class MathGameCommand extends commando.Command { module.exports = class MathGameCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'mathgame', name: 'mathgame',
group: 'random', group: 'random',
@@ -14,8 +14,8 @@ module.exports = class MathGameCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { if (message.channel.type !== 'dm') {
if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let [level] = message.content.toLowerCase().split(" ").slice(1); let [level] = message.content.toLowerCase().split(" ").slice(1);
@@ -24,28 +24,29 @@ module.exports = class MathGameCommand extends commando.Command {
let randomValue; let randomValue;
switch (level) { switch (level) {
case "easy": case "easy":
randomValue = 10; randomValue = 10;
break; break;
case "medium": case "medium":
randomValue = 50; randomValue = 50;
break; break;
case "hard": case "hard":
randomValue = 100; randomValue = 100;
break; break;
case "extreme": case "extreme":
randomValue = 1000; randomValue = 1000;
break; break;
} }
let randomValue1 = Math.floor(Math.random() * randomValue) + 1; let randomValue1 = Math.floor(Math.random() * randomValue) + 1;
let randomValue2 = Math.floor(Math.random() * randomValue) + 1; let randomValue2 = Math.floor(Math.random() * randomValue) + 1;
let randomExpression = randomValue1 + randomType + randomValue2; let randomExpression = randomValue1 + randomType + randomValue2;
let solved = math.eval(randomExpression); let solved = math.eval(randomExpression);
if(randomValue === undefined) { if (randomValue === undefined) {
message.channel.send(':x: Error! No difficulty set! (Choose Easy, Medium, Hard, or Extreme)'); message.channel.send(':x: Error! No difficulty set! (Choose Easy, Medium, Hard, or Extreme)');
} else { }
else {
const embed = new Discord.RichEmbed() const embed = new Discord.RichEmbed()
.setTitle('You have **ten** seconds to answer:') .setTitle('You have **ten** seconds to answer:')
.setDescription(randomExpression); .setDescription(randomExpression);
message.channel.sendEmbed(embed).then(() => { message.channel.sendEmbed(embed).then(() => {
message.channel.awaitMessages(response => response.content === solved.toString() && response.author.id === message.author.id, { message.channel.awaitMessages(response => response.content === solved.toString() && response.author.id === message.author.id, {
max: 1, max: 1,
@@ -59,4 +60,4 @@ module.exports = class MathGameCommand extends commando.Command {
}); });
} }
} }
}; };
+9 -9
View File
@@ -2,7 +2,7 @@ const commando = require('discord.js-commando');
const Discord = require('discord.js'); const Discord = require('discord.js');
module.exports = class NitroCommand extends commando.Command { module.exports = class NitroCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'nitro', name: 'nitro',
group: 'random', group: 'random',
@@ -13,16 +13,16 @@ module.exports = class NitroCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { if (message.channel.type !== 'dm') {
if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
const embed = new Discord.RichEmbed() const embed = new Discord.RichEmbed()
.setAuthor("Discord Nitro") .setAuthor("Discord Nitro")
.setThumbnail("https://pbs.twimg.com/profile_images/814184180649197568/y2eZcVMq.jpg") .setThumbnail("https://pbs.twimg.com/profile_images/814184180649197568/y2eZcVMq.jpg")
.setColor(0x748BD9) .setColor(0x748BD9)
.setURL("https://discordapp.com/nitro") .setURL("https://discordapp.com/nitro")
.setDescription("This Message can only be viewed by members with Discord Nitro.\n\n\n[More Information](https://discordapp.com/nitro)"); .setDescription("This Message can only be viewed by members with Discord Nitro.\n\n\n[More Information](https://discordapp.com/nitro)");
message.channel.sendEmbed(embed).catch(console.error); message.channel.sendEmbed(embed).catch(console.error);
} }
}; };
+4 -4
View File
@@ -1,7 +1,7 @@
const commando = require('discord.js-commando'); const commando = require('discord.js-commando');
module.exports = class SlowClapCommand extends commando.Command { module.exports = class SlowClapCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'slowclap', name: 'slowclap',
group: 'random', group: 'random',
@@ -12,10 +12,10 @@ module.exports = class SlowClapCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { 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'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
message.channel.send('*slow clap*'); message.channel.send('*slow clap*');
} }
}; };
+39 -32
View File
@@ -2,7 +2,7 @@ const commando = require('discord.js-commando');
const sounds = require('./sounds.json'); const sounds = require('./sounds.json');
module.exports = class SoundBoardCommand extends commando.Command { module.exports = class SoundBoardCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'soundboard', name: 'soundboard',
aliases: [ aliases: [
@@ -17,48 +17,55 @@ module.exports = class SoundBoardCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { 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'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
if(message.channel.type !== 'dm') { if (message.channel.type !== 'dm') {
if(!message.channel.permissionsFor(this.client.user).hasPermission(['CONNECT', 'SPEAK', 'ADD_REACTIONS'])) { if (!message.channel.permissionsFor(this.client.user).hasPermission(['CONNECT', 'SPEAK', 'ADD_REACTIONS'])) {
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!'); 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 { }
else {
let voiceChannel = message.member.voiceChannel; let voiceChannel = message.member.voiceChannel;
if (!voiceChannel) { if (!voiceChannel) {
return message.channel.send(`:x: Error! Please be in a voice channel first!`); return message.channel.send(`:x: Error! Please be in a voice channel first!`);
} }
let soundToPlay = message.content.toLowerCase().split(" ").slice(1).join(" "); let soundToPlay = message.content.toLowerCase().split(" ").slice(1).join(" ");
if(soundToPlay === "") { if (soundToPlay === "") {
message.channel.send(':x: Error! No sound set. Please use ;soundboard list to see a list of sounds you can play.'); 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') { }
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 === 'list') {
} else if(soundToPlay === sounds.avaliable[soundToPlay]) { 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 = this.client.voiceConnections.get(voiceChannel.guild.id); let alreadyConnected = this.client.voiceConnections.get(voiceChannel.guild.id);
if(alreadyConnected) { if (alreadyConnected) {
if(alreadyConnected.channel.id === voiceChannel.id) { if (alreadyConnected.channel.id === voiceChannel.id) {
message.channel.send(':x: Error! I am already playing a sound!'); message.channel.send(':x: Error! I am already playing a sound!');
} else { }
else {
message.channel.send(':x: Error! I am already playing a sound!'); message.channel.send(':x: Error! I am already playing a sound!');
} }
} else {
voiceChannel.join().then(connection => {
let stream = sounds.paths[soundToPlay];
let dispatcher = connection.playStream(stream);
message.react('🔊');
dispatcher.on('end', () => {
voiceChannel.leave();
message.react('✅');
});
});
} }
} else { else {
message.channel.send(':x: Error! Sound not found! Use `;soundboard list` to see a list of sounds you can play.'); voiceChannel.join().then(connection => {
} let stream = sounds.paths[soundToPlay];
let dispatcher = connection.playStream(stream);
message.react('🔊');
dispatcher.on('end', () => {
voiceChannel.leave();
message.react('✅');
});
});
}
}
else {
message.channel.send(':x: Error! Sound not found! Use `;soundboard list` to see a list of sounds you can play.');
}
} }
} else { }
else {
message.channel.send(':x: This is a DM!'); message.channel.send(':x: This is a DM!');
} }
} }
}; };
+1 -1
View File
@@ -39,4 +39,4 @@
"no this is patrick": "./sounds/no-this-is-patrick.mp3", "no this is patrick": "./sounds/no-this-is-patrick.mp3",
"wumbo": "./sounds/wumbo.mp3" "wumbo": "./sounds/wumbo.mp3"
} }
} }
+4 -4
View File
@@ -1,7 +1,7 @@
const commando = require('discord.js-commando'); const commando = require('discord.js-commando');
module.exports = class SpamCommand extends commando.Command { module.exports = class SpamCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'spam', name: 'spam',
group: 'random', group: 'random',
@@ -12,10 +12,10 @@ module.exports = class SpamCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { if (message.channel.type !== 'dm') {
if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
message.channel.sendFile("./images/Spam.jpg"); message.channel.sendFile("./images/Spam.jpg");
} }
}; };
+27 -26
View File
@@ -2,7 +2,7 @@ const commando = require('discord.js-commando');
const Discord = require('discord.js'); const Discord = require('discord.js');
module.exports = class TypingGameCommand extends commando.Command { module.exports = class TypingGameCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'typinggame', name: 'typinggame',
group: 'random', group: 'random',
@@ -13,8 +13,8 @@ module.exports = class TypingGameCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { if (message.channel.type !== 'dm') {
if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let [level] = message.content.toLowerCase().split(" ").slice(1); let [level] = message.content.toLowerCase().split(" ").slice(1);
@@ -23,39 +23,40 @@ module.exports = class TypingGameCommand extends commando.Command {
let time; let time;
switch (level) { switch (level) {
case "easy": case "easy":
time = 25000; time = 25000;
break; break;
case "medium": case "medium":
time = 20000; time = 20000;
break; break;
case "hard": case "hard":
time = 15000; time = 15000;
break; break;
case "extreme": case "extreme":
time = 10000; time = 10000;
break; break;
} }
let levelWord; let levelWord;
switch (level) { switch (level) {
case "easy": case "easy":
levelWord = "twenty-five"; levelWord = "twenty-five";
break; break;
case "medium": case "medium":
levelWord = "twenty"; levelWord = "twenty";
break; break;
case "hard": case "hard":
levelWord = "fifteen"; levelWord = "fifteen";
break; break;
case "extreme": case "extreme":
levelWord = "ten"; levelWord = "ten";
break; break;
} }
if(time === undefined) { if (time === undefined) {
message.channel.send(':x: Error! No difficulty set! (Choose Easy, Medium, Hard, or Extreme)'); message.channel.send(':x: Error! No difficulty set! (Choose Easy, Medium, Hard, or Extreme)');
} else { }
else {
const embed = new Discord.RichEmbed() const embed = new Discord.RichEmbed()
.setTitle('You have **' + levelWord + '** seconds to type:') .setTitle('You have **' + levelWord + '** seconds to type:')
.setDescription(randomSentence); .setDescription(randomSentence);
message.channel.sendEmbed(embed).then(() => { message.channel.sendEmbed(embed).then(() => {
message.channel.awaitMessages(response => response.content === randomSentence && response.author.id === message.author.id, { message.channel.awaitMessages(response => response.content === randomSentence && response.author.id === message.author.id, {
max: 1, max: 1,
@@ -69,4 +70,4 @@ module.exports = class TypingGameCommand extends commando.Command {
}); });
} }
} }
}; };
+5 -5
View File
@@ -1,7 +1,7 @@
const commando = require('discord.js-commando'); const commando = require('discord.js-commando');
module.exports = class MagicBall extends commando.Command { module.exports = class MagicBall extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: '8ball', name: '8ball',
group: 'response', group: 'response',
@@ -12,16 +12,16 @@ module.exports = class MagicBall extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { 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'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let question = message.content.split(" ").slice(1).join(" "); let question = message.content.split(" ").slice(1).join(" ");
let answers = ['It seems the answer is yes, yes?', 'It seems the answer is no.', 'It is a little doubtful, yes?', 'It seems it is very likely to be true.']; let answers = ['It seems the answer is yes, yes?', 'It seems the answer is no.', 'It is a little doubtful, yes?', 'It seems it is very likely to be true.'];
answers = answers[Math.floor(Math.random() * answers.length)]; answers = answers[Math.floor(Math.random() * answers.length)];
if(question === "") { if (question === "") {
question = "Not Specified." question = "Not Specified."
} }
message.channel.send("Question: " + question + "\n:8ball: " + answers + " :8ball:"); message.channel.send("Question: " + question + "\n:8ball: " + answers + " :8ball:");
} }
}; };
+4 -4
View File
@@ -1,7 +1,7 @@
const commando = require('discord.js-commando'); const commando = require('discord.js-commando');
module.exports = class RandomCat extends commando.Command { module.exports = class RandomCat extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'cat', name: 'cat',
group: 'response', group: 'response',
@@ -12,12 +12,12 @@ module.exports = class RandomCat extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { if (message.channel.type !== 'dm') {
if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let cat = ["1.jpg", "2.jpg", "3.jpg", "4.jpg", "5.jpg", "6.jpg", "7.jpg", "8.jpg", "9.jpg", "10.jpg", "11.jpeg", "12.jpg", "13.jpeg", "14.png", "15.jpg", "16.jpg", "17.jpg", "18.jpg", "19.jpg", "20.jpg"]; let cat = ["1.jpg", "2.jpg", "3.jpg", "4.jpg", "5.jpg", "6.jpg", "7.jpg", "8.jpg", "9.jpg", "10.jpg", "11.jpeg", "12.jpg", "13.jpeg", "14.png", "15.jpg", "16.jpg", "17.jpg", "18.jpg", "19.jpg", "20.jpg"];
cat = cat[Math.floor(Math.random() * cat.length)]; cat = cat[Math.floor(Math.random() * cat.length)];
message.channel.sendFile("./images/Cat" + cat); message.channel.sendFile("./images/Cat" + cat);
} }
}; };
+7 -6
View File
@@ -1,7 +1,7 @@
const commando = require('discord.js-commando'); const commando = require('discord.js-commando');
module.exports = class ChooseCommand extends commando.Command { module.exports = class ChooseCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'choose', name: 'choose',
aliases: [ aliases: [
@@ -15,19 +15,20 @@ module.exports = class ChooseCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { 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'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
if(message.content.includes(" | ")) { if (message.content.includes(" | ")) {
let choices = message.content.split(" ").slice(1).join(" ").split(' | '); let choices = message.content.split(" ").slice(1).join(" ").split(' | ');
let choice1 = choices[0]; let choice1 = choices[0];
let choice2 = choices[1]; let choice2 = choices[1];
let randomChoice = [choice1, choice2]; let randomChoice = [choice1, choice2];
randomChoice = randomChoice[Math.floor(Math.random() * randomChoice.length)]; randomChoice = randomChoice[Math.floor(Math.random() * randomChoice.length)];
message.channel.send("I choose " + randomChoice + "!"); message.channel.send("I choose " + randomChoice + "!");
} else { }
else {
message.channel.send(":x: Split your two choices with a ' | '!"); message.channel.send(":x: Split your two choices with a ' | '!");
} }
} }
}; };
+4 -4
View File
@@ -1,7 +1,7 @@
const commando = require('discord.js-commando'); const commando = require('discord.js-commando');
module.exports = class CoinFlipCommand extends commando.Command { module.exports = class CoinFlipCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'coin', name: 'coin',
aliases: [ aliases: [
@@ -16,12 +16,12 @@ module.exports = class CoinFlipCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { 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'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let coin = ['Heads', 'Tails']; let coin = ['Heads', 'Tails'];
coin = coin[Math.floor(Math.random() * coin.length)]; coin = coin[Math.floor(Math.random() * coin.length)];
message.channel.send("It landed on " + coin); message.channel.send("It landed on " + coin);
} }
}; };
+7 -6
View File
@@ -1,7 +1,7 @@
const commando = require('discord.js-commando'); const commando = require('discord.js-commando');
module.exports = class ComplimentCommand extends commando.Command { module.exports = class ComplimentCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'compliment', name: 'compliment',
group: 'response', group: 'response',
@@ -12,17 +12,18 @@ module.exports = class ComplimentCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { 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'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let thingToCompliment = message.content.split(" ").slice(1).join(" "); let thingToCompliment = message.content.split(" ").slice(1).join(" ");
let compliments = ["Your smile is contagious.", "You look great today.", "You're a smart cookie.", "I bet you make babies smile.", "You have impeccable manners.", "I like your style.", "You have the best laugh.", "I appreciate you.", "You are the most perfect you there is.", "You are enough.", "You're strong.", "Your perspective is refreshing.", "You're an awesome friend.", "You light up the room.", "You shine brighter than a shooting star.", "You deserve a hug right now.", "You should be proud of yourself.", "You're more helpful than you realize.", "You have a great sense of humor.", "You've got all the right moves!", "Is that your picture next to 'charming' in the dictionary?", "Your kindness is a balm to all who encounter it.", "You're all that and a super-size bag of chips.", "On a scale from 1 to 10, you're an 11.", "You are brave.", "You're even more beautiful on the inside than you are on the outside.", "You have the courage of your convictions.", "Your eyes are breathtaking.", "If cartoon bluebirds were real, a bunch of them would be sitting on your shoulders singing right now.", "You are making a difference.", "You're like sunshine on a rainy day.", "You bring out the best in other people.", "Your ability to recall random factoids at just the right time is impressive.", "You're a great listener.", "How is it that you always look great, even in sweatpants?", "Everything would be better if more people were like you!", "I bet you sweat glitter.", "You were cool way before hipsters were cool.", "That color is perfect on you.", "Hanging out with you is always a blast.", "You always know -- and say -- exactly what I need to hear when I need to hear it.", "You smell really good.", "You may dance like no one's watching, but everyone's watching because you're an amazing dancer!", "Being around you makes everything better!", "When you say, 'I meant to do that,' I totally believe you.", "When you're not afraid to be yourself is when you're most incredible.", "Colors seem brighter when you're around.", "You're more fun than a ball pit filled with candy. (And seriously, what could be more fun than that?)", "That thing you don't like about yourself is what makes you so interesting.", "You're wonderful.", "You have cute elbows. For reals!", "Jokes are funnier when you tell them.", "You're better than a triple-scoop ice cream cone. With sprinkles.", "Your bellybutton is kind of adorable.", "Your hair looks stunning.", "You're one of a kind!", "You're inspiring.", "If you were a box of crayons, you'd be the giant name-brand one with the built-in sharpener.", "You should be thanked more often. So thank you!!", "Our community is better because you're in it.", "Someone is getting through something hard right now because you've got their back.", "You have the best ideas.", "You always know how to find that silver lining.", "Everyone gets knocked down sometimes, but you always get back up and keep going.", "You're a candle in the darkness.", "You're a great example to others.", "Being around you is like being on a happy little vacation.", "You always know just what to say.", "You're always learning new things and trying to better yourself, which is awesome.", "If someone based an Internet meme on you, it would have impeccable grammar.", "You could survive a Zombie apocalypse.", "You're more fun than bubble wrap.", "When you make a mistake, you fix it.", "Who raised you? They deserve a medal for a job well done.", "You're great at figuring stuff out.", "Your voice is magnificent.", "The people you love are lucky to have you in their lives.", "You're like a breath of fresh air.", "You're gorgeous -- and that's the least interesting thing about you, too.", "You're so thoughtful.", "Your creative potential seems limitless.", "Your name suits you to a T.", "You're irresistible when you blush.", "Actions speak louder than words, and yours tell an incredible story.", "Somehow you make time stop and fly at the same time.", "When you make up your mind about something, nothing stands in your way.", "You seem to really know who you are.", "Any team would be lucky to have you on it.", "In high school I bet you were voted 'most likely to keep being awesome.'", "I bet you do the crossword puzzle in ink.", "Babies and small animals probably love you.", "If you were a scented candle they'd call it Perfectly Imperfect (and it would smell like summer).", "There's ordinary, and then there's you.", "You're someone's reason to smile.", "You're even better than a unicorn, because you're real.", "How do you keep being so funny and making everyone laugh?", "You have a good head on your shoulders.", "Has anyone ever told you that you have great posture?", "The way you treasure your loved ones is incredible.", "You're really something special.", "You're a gift to those around you.", "You don't deserve it."]; let compliments = ["Your smile is contagious.", "You look great today.", "You're a smart cookie.", "I bet you make babies smile.", "You have impeccable manners.", "I like your style.", "You have the best laugh.", "I appreciate you.", "You are the most perfect you there is.", "You are enough.", "You're strong.", "Your perspective is refreshing.", "You're an awesome friend.", "You light up the room.", "You shine brighter than a shooting star.", "You deserve a hug right now.", "You should be proud of yourself.", "You're more helpful than you realize.", "You have a great sense of humor.", "You've got all the right moves!", "Is that your picture next to 'charming' in the dictionary?", "Your kindness is a balm to all who encounter it.", "You're all that and a super-size bag of chips.", "On a scale from 1 to 10, you're an 11.", "You are brave.", "You're even more beautiful on the inside than you are on the outside.", "You have the courage of your convictions.", "Your eyes are breathtaking.", "If cartoon bluebirds were real, a bunch of them would be sitting on your shoulders singing right now.", "You are making a difference.", "You're like sunshine on a rainy day.", "You bring out the best in other people.", "Your ability to recall random factoids at just the right time is impressive.", "You're a great listener.", "How is it that you always look great, even in sweatpants?", "Everything would be better if more people were like you!", "I bet you sweat glitter.", "You were cool way before hipsters were cool.", "That color is perfect on you.", "Hanging out with you is always a blast.", "You always know -- and say -- exactly what I need to hear when I need to hear it.", "You smell really good.", "You may dance like no one's watching, but everyone's watching because you're an amazing dancer!", "Being around you makes everything better!", "When you say, 'I meant to do that,' I totally believe you.", "When you're not afraid to be yourself is when you're most incredible.", "Colors seem brighter when you're around.", "You're more fun than a ball pit filled with candy. (And seriously, what could be more fun than that?)", "That thing you don't like about yourself is what makes you so interesting.", "You're wonderful.", "You have cute elbows. For reals!", "Jokes are funnier when you tell them.", "You're better than a triple-scoop ice cream cone. With sprinkles.", "Your bellybutton is kind of adorable.", "Your hair looks stunning.", "You're one of a kind!", "You're inspiring.", "If you were a box of crayons, you'd be the giant name-brand one with the built-in sharpener.", "You should be thanked more often. So thank you!!", "Our community is better because you're in it.", "Someone is getting through something hard right now because you've got their back.", "You have the best ideas.", "You always know how to find that silver lining.", "Everyone gets knocked down sometimes, but you always get back up and keep going.", "You're a candle in the darkness.", "You're a great example to others.", "Being around you is like being on a happy little vacation.", "You always know just what to say.", "You're always learning new things and trying to better yourself, which is awesome.", "If someone based an Internet meme on you, it would have impeccable grammar.", "You could survive a Zombie apocalypse.", "You're more fun than bubble wrap.", "When you make a mistake, you fix it.", "Who raised you? They deserve a medal for a job well done.", "You're great at figuring stuff out.", "Your voice is magnificent.", "The people you love are lucky to have you in their lives.", "You're like a breath of fresh air.", "You're gorgeous -- and that's the least interesting thing about you, too.", "You're so thoughtful.", "Your creative potential seems limitless.", "Your name suits you to a T.", "You're irresistible when you blush.", "Actions speak louder than words, and yours tell an incredible story.", "Somehow you make time stop and fly at the same time.", "When you make up your mind about something, nothing stands in your way.", "You seem to really know who you are.", "Any team would be lucky to have you on it.", "In high school I bet you were voted 'most likely to keep being awesome.'", "I bet you do the crossword puzzle in ink.", "Babies and small animals probably love you.", "If you were a scented candle they'd call it Perfectly Imperfect (and it would smell like summer).", "There's ordinary, and then there's you.", "You're someone's reason to smile.", "You're even better than a unicorn, because you're real.", "How do you keep being so funny and making everyone laugh?", "You have a good head on your shoulders.", "Has anyone ever told you that you have great posture?", "The way you treasure your loved ones is incredible.", "You're really something special.", "You're a gift to those around you.", "You don't deserve it."];
compliments = compliments[Math.floor(Math.random() * compliments.length)]; compliments = compliments[Math.floor(Math.random() * compliments.length)];
if(thingToCompliment === '') { if (thingToCompliment === '') {
message.reply(compliments); message.reply(compliments);
} else { }
else {
message.channel.send(thingToCompliment + ", " + compliments); message.channel.send(thingToCompliment + ", " + compliments);
} }
} }
}; };
File diff suppressed because one or more lines are too long
+4 -4
View File
@@ -1,7 +1,7 @@
const commando = require('discord.js-commando'); const commando = require('discord.js-commando');
module.exports = class FishyCommand extends commando.Command { module.exports = class FishyCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'fishy', name: 'fishy',
aliases: [ aliases: [
@@ -16,12 +16,12 @@ module.exports = class FishyCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { 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'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let fish = [':fish:', ':tropical_fish:', ':blowfish:']; let fish = [':fish:', ':tropical_fish:', ':blowfish:'];
fish = fish[Math.floor(Math.random() * fish.length)]; fish = fish[Math.floor(Math.random() * fish.length)];
message.channel.send("You caught a: " + fish); message.channel.send("You caught a: " + fish);
} }
}; };
+4 -4
View File
@@ -1,7 +1,7 @@
const commando = require('discord.js-commando'); const commando = require('discord.js-commando');
module.exports = class FortuneCookieCommand extends commando.Command { module.exports = class FortuneCookieCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'fortune', name: 'fortune',
aliases: [ aliases: [
@@ -15,12 +15,12 @@ module.exports = class FortuneCookieCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { 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'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let fortunes = ["Do not seek so much to find the answer as much as to understand the question better.", "You will soon be honored by someone you respect.", "Happiness comes from a good life.", "You are contemplating some action which will bring credit upon you.", "Be prepared for extra energy.", "You are admired for your adventurous ways.", "The love of your life is sitting across from you.", "Beauty is simply beauty. Originality is magical.", "Never quit!", "Today is an ideal time to water your personal garden.", "Questions provide the key to unlocking our unlimited potential.", "Expect great things and great things will come.", "The Greatest War Sometimes Isn't On The Battlefield But Against Oneself.", "Become who you are.", "In case of fire, keep calm, pay bill and run.", "Anyone who dares to be, can never be weak.", "You broke my cookie!", "Dream lofty dreams, and as you dream, so shall you become.", "You've got what it takes, but it will take everything you've got!", "Trust your intuition.", "The wise are aware of their treasure, while fools follow their vanity.", "You will always have good luck in your personal affairs.", "You don't need talent to gain experience.", "All the preparation you've done will finally be paying off!", "Determination is the wake-up call to the human will.", "The most useless energy is trying to change what and who God so carefully created.", "You cannot become rich except by enriching others.", "Your happiness is intertwined with your outlook on life.", "Sing and rejoice, fortune is smiling on you.", "Well-arranged time is the surest sign of a well-arranged mind."]; let fortunes = ["Do not seek so much to find the answer as much as to understand the question better.", "You will soon be honored by someone you respect.", "Happiness comes from a good life.", "You are contemplating some action which will bring credit upon you.", "Be prepared for extra energy.", "You are admired for your adventurous ways.", "The love of your life is sitting across from you.", "Beauty is simply beauty. Originality is magical.", "Never quit!", "Today is an ideal time to water your personal garden.", "Questions provide the key to unlocking our unlimited potential.", "Expect great things and great things will come.", "The Greatest War Sometimes Isn't On The Battlefield But Against Oneself.", "Become who you are.", "In case of fire, keep calm, pay bill and run.", "Anyone who dares to be, can never be weak.", "You broke my cookie!", "Dream lofty dreams, and as you dream, so shall you become.", "You've got what it takes, but it will take everything you've got!", "Trust your intuition.", "The wise are aware of their treasure, while fools follow their vanity.", "You will always have good luck in your personal affairs.", "You don't need talent to gain experience.", "All the preparation you've done will finally be paying off!", "Determination is the wake-up call to the human will.", "The most useless energy is trying to change what and who God so carefully created.", "You cannot become rich except by enriching others.", "Your happiness is intertwined with your outlook on life.", "Sing and rejoice, fortune is smiling on you.", "Well-arranged time is the surest sign of a well-arranged mind."];
fortunes = fortunes[Math.floor(Math.random() * fortunes.length)]; fortunes = fortunes[Math.floor(Math.random() * fortunes.length)];
message.channel.send(fortunes); message.channel.send(fortunes);
} }
}; };
+7 -6
View File
@@ -1,7 +1,7 @@
const commando = require('discord.js-commando'); const commando = require('discord.js-commando');
module.exports = class MotivateCommand extends commando.Command { module.exports = class MotivateCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'motivate', name: 'motivate',
aliases: [ aliases: [
@@ -16,15 +16,16 @@ module.exports = class MotivateCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { 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'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let userToMotivate = message.content.split(" ").slice(1).join(" "); let userToMotivate = message.content.split(" ").slice(1).join(" ");
if(userToMotivate === '') { if (userToMotivate === '') {
message.reply('https://www.youtube.com/watch?v=ZXsQAXx_ao0'); message.reply('https://www.youtube.com/watch?v=ZXsQAXx_ao0');
} else { }
else {
message.channel.send(userToMotivate + ", https://www.youtube.com/watch?v=ZXsQAXx_ao0"); message.channel.send(userToMotivate + ", https://www.youtube.com/watch?v=ZXsQAXx_ao0");
} }
} }
}; };
+9 -7
View File
@@ -1,7 +1,7 @@
const commando = require('discord.js-commando'); const commando = require('discord.js-commando');
module.exports = class RandomNameGen extends commando.Command { module.exports = class RandomNameGen extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'name', name: 'name',
aliases: [ aliases: [
@@ -16,8 +16,8 @@ module.exports = class RandomNameGen extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { 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'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let randomFirstMale = ["Bob", "Daniel", "Logan", "Chris", "Nathan", "George", "Mart", "Charlie", "Felix", "Ralph", "William", "Max", "Jerry", "Marty", "Joshua", "Cody", "Richard", "Alex", "Alexander", "Jordan", "Zachary", "Bill", "Alfred", "Bruce", "Caiden", "Calvin", "Eric", "Robert", "Mark", "Miles", "Nash", "Ronald", "Ivan", "Edgar", "Royal", "Augustine", "Dominic", "Noel", "Rocky", "Grover", "Paul", "Jeremy", "Stevie", "Brock", "Jc", "Tony", "Enoch", "Zachery", "Harvey", "Gilbert", "Chang", "Emery", "Carroll", "Odell", "Jean", "Archie", "Russ", "Barry", "Lowell", "Jacob", "Riku", "Frederic", "Levi", "Faustino", "Leland", "Domenic", "Irwin", "Moises", "Louie", "Larry", "Victor"]; let randomFirstMale = ["Bob", "Daniel", "Logan", "Chris", "Nathan", "George", "Mart", "Charlie", "Felix", "Ralph", "William", "Max", "Jerry", "Marty", "Joshua", "Cody", "Richard", "Alex", "Alexander", "Jordan", "Zachary", "Bill", "Alfred", "Bruce", "Caiden", "Calvin", "Eric", "Robert", "Mark", "Miles", "Nash", "Ronald", "Ivan", "Edgar", "Royal", "Augustine", "Dominic", "Noel", "Rocky", "Grover", "Paul", "Jeremy", "Stevie", "Brock", "Jc", "Tony", "Enoch", "Zachery", "Harvey", "Gilbert", "Chang", "Emery", "Carroll", "Odell", "Jean", "Archie", "Russ", "Barry", "Lowell", "Jacob", "Riku", "Frederic", "Levi", "Faustino", "Leland", "Domenic", "Irwin", "Moises", "Louie", "Larry", "Victor"];
@@ -28,12 +28,14 @@ module.exports = class RandomNameGen extends commando.Command {
randomLast = randomLast[Math.floor(Math.random() * randomLast.length)]; randomLast = randomLast[Math.floor(Math.random() * randomLast.length)];
let randomFirstBoth = [randomFirstMale, randomFirstFemale] let randomFirstBoth = [randomFirstMale, randomFirstFemale]
randomFirstBoth = randomFirstBoth[Math.floor(Math.random() * randomFirstBoth.length)]; randomFirstBoth = randomFirstBoth[Math.floor(Math.random() * randomFirstBoth.length)];
if(message.content.toLowerCase().split(" ").slice(1).includes("male")) { if (message.content.toLowerCase().split(" ").slice(1).includes("male")) {
message.channel.send(randomFirstMale + " " + randomLast); message.channel.send(randomFirstMale + " " + randomLast);
} else if(message.content.toLowerCase().split(" ").slice(1).includes("female")) { }
else if (message.content.toLowerCase().split(" ").slice(1).includes("female")) {
message.channel.send(randomFirstFemale + " " + randomLast); message.channel.send(randomFirstFemale + " " + randomLast);
} else { }
else {
message.channel.send(randomFirstBoth + " " + randomLast); message.channel.send(randomFirstBoth + " " + randomLast);
} }
} }
}; };
+4 -4
View File
@@ -1,7 +1,7 @@
const commando = require('discord.js-commando'); const commando = require('discord.js-commando');
module.exports = class OffspringCommand extends commando.Command { module.exports = class OffspringCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'offspring', name: 'offspring',
aliases: [ aliases: [
@@ -17,12 +17,12 @@ module.exports = class OffspringCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { 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'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let gender = ['boy', 'girl']; let gender = ['boy', 'girl'];
gender = gender[Math.floor(Math.random() * gender.length)]; gender = gender[Math.floor(Math.random() * gender.length)];
message.channel.send("It's a " + gender + "!"); message.channel.send("It's a " + gender + "!");
} }
}; };
+4 -4
View File
@@ -1,7 +1,7 @@
const commando = require('discord.js-commando'); const commando = require('discord.js-commando');
module.exports = class PotatoCommand extends commando.Command { module.exports = class PotatoCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'potato', name: 'potato',
group: 'response', group: 'response',
@@ -12,12 +12,12 @@ module.exports = class PotatoCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { if (message.channel.type !== 'dm') {
if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let potato = ["1.jpg", "2.jpg", "3.jpg", "4.jpg", "5.gif", "6.png", "7.jpg", "8.jpg", "9.jpg"]; let potato = ["1.jpg", "2.jpg", "3.jpg", "4.jpg", "5.gif", "6.png", "7.jpg", "8.jpg", "9.jpg"];
potato = potato[Math.floor(Math.random() * potato.length)]; potato = potato[Math.floor(Math.random() * potato.length)];
message.channel.sendFile("./images/Potato" + potato); message.channel.sendFile("./images/Potato" + potato);
} }
}; };
+4 -4
View File
@@ -1,7 +1,7 @@
const commando = require('discord.js-commando'); const commando = require('discord.js-commando');
module.exports = class RandomPun extends commando.Command { module.exports = class RandomPun extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'pun', name: 'pun',
group: 'response', group: 'response',
@@ -12,12 +12,12 @@ module.exports = class RandomPun extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { if (message.channel.type !== 'dm') {
if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let pun = ["Pun1.jpg", "Pun2.jpg", "Pun3.jpg", "Pun4.jpg", "Pun5.jpg", "Pun6.jpg", "Pun7.jpg", "Pun8.png", "Pun9.jpg", "Pun10.jpg", "Pun11.jpg", "Pun12.jpg", "Pun13.jpg", "Pun14.jpg", "Pun15.jpg", "Pun16.jpg", "Pun17.jpg", "Pun18.jpg", "Pun19.jpg", "Pun20.jpg", "Pun21.jpg", "Pun22.jpg", "Pun23.jpg", "Pun24.jpg", "Pun25.jpg", "Pun26.jpg", "Pun27.jpg", "Pun28.jpg", "Pun29.jpg", "Pun30.jpeg", "Pun31.jpg", "Pun32.jpg", "Pun33.jpg", "Pun34.png", "Pun35.jpg", "Pun36.jpg", "Pun37.jpg", "Pun38.jpg", "Pun39.jpg", "Pun40.jpg", "Pun41.jpg", "Pun42.jpg", "Pun43.jpg", "Pun44.jpg", "Pun45.gif", "Pun46.jpg", "Pun47.jpg", "Pun48.jpg", "Pun49.jpg", "Pun50.jpg", "Pun51.jpg", "Pun52.jpg", "Pun53.jpg"]; let pun = ["Pun1.jpg", "Pun2.jpg", "Pun3.jpg", "Pun4.jpg", "Pun5.jpg", "Pun6.jpg", "Pun7.jpg", "Pun8.png", "Pun9.jpg", "Pun10.jpg", "Pun11.jpg", "Pun12.jpg", "Pun13.jpg", "Pun14.jpg", "Pun15.jpg", "Pun16.jpg", "Pun17.jpg", "Pun18.jpg", "Pun19.jpg", "Pun20.jpg", "Pun21.jpg", "Pun22.jpg", "Pun23.jpg", "Pun24.jpg", "Pun25.jpg", "Pun26.jpg", "Pun27.jpg", "Pun28.jpg", "Pun29.jpg", "Pun30.jpeg", "Pun31.jpg", "Pun32.jpg", "Pun33.jpg", "Pun34.png", "Pun35.jpg", "Pun36.jpg", "Pun37.jpg", "Pun38.jpg", "Pun39.jpg", "Pun40.jpg", "Pun41.jpg", "Pun42.jpg", "Pun43.jpg", "Pun44.jpg", "Pun45.gif", "Pun46.jpg", "Pun47.jpg", "Pun48.jpg", "Pun49.jpg", "Pun50.jpg", "Pun51.jpg", "Pun52.jpg", "Pun53.jpg"];
pun = pun[Math.floor(Math.random() * pun.length)]; pun = pun[Math.floor(Math.random() * pun.length)];
message.channel.sendFile("./images/" + pun); message.channel.sendFile("./images/" + pun);
} }
}; };
+4 -4
View File
@@ -1,7 +1,7 @@
const commando = require('discord.js-commando'); const commando = require('discord.js-commando');
module.exports = class QuantumCoin extends commando.Command { module.exports = class QuantumCoin extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'quantumcoin', name: 'quantumcoin',
aliases: [ aliases: [
@@ -16,12 +16,12 @@ module.exports = class QuantumCoin extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { 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'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let qcoin = ['on nothing', 'on NaN', 'on 0', 'in the air', 'on null']; let qcoin = ['on nothing', 'on NaN', 'on 0', 'in the air', 'on null'];
qcoin = qcoin[Math.floor(Math.random() * qcoin.length)]; qcoin = qcoin[Math.floor(Math.random() * qcoin.length)];
message.channel.send("It landed " + qcoin); message.channel.send("It landed " + qcoin);
} }
}; };
+4 -4
View File
@@ -1,7 +1,7 @@
const commando = require('discord.js-commando'); const commando = require('discord.js-commando');
module.exports = class RateWaifuCommand extends commando.Command { module.exports = class RateWaifuCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'ratewaifu', name: 'ratewaifu',
aliases: [ aliases: [
@@ -15,12 +15,12 @@ module.exports = class RateWaifuCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { 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'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let waifuToRate = message.content.split(" ").slice(1).join(" "); let waifuToRate = message.content.split(" ").slice(1).join(" ");
let percentage = Math.floor(Math.random() * 10) + 1; let percentage = Math.floor(Math.random() * 10) + 1;
message.channel.send("I'd give " + waifuToRate + " a " + percentage + "/10!"); message.channel.send("I'd give " + waifuToRate + " a " + percentage + "/10!");
} }
}; };
+7 -6
View File
@@ -1,7 +1,7 @@
const commando = require('discord.js-commando'); const commando = require('discord.js-commando');
module.exports = class RoastMeCommand extends commando.Command { module.exports = class RoastMeCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'roast', name: 'roast',
aliases: [ aliases: [
@@ -15,17 +15,18 @@ module.exports = class RoastMeCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { 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'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let userToRoast = message.content.split(" ").slice(1).join(" "); let userToRoast = message.content.split(" ").slice(1).join(" ");
let roasts = ["*puts you in the oven*", "You're so stupid.", "Sorry, I can't hear you over how annoying you are.", "I've got better things to do.", "You're as dumb as Cleverbot.", "Your IQ is lower than the Mariana Trench.", "You're so annoying even the flies stay away from your stench.", "Go away, please.", "I'd give you a nasty look but you've already got one.", "It looks like your face caught fire and someone tried to put it out with a hammer.", "Your family tree must be a cactus because everyone on it is a prick.", "Someday you will go far, and I hope you stay there.", "The zoo called. They're wondering how you got out of your cage.", "I was hoping for a battle of wits, but you appear to be unarmed.", "You are proof that evolution can go in reverse.", "Brains aren't everything, in your case, they're nothing.", "Sorry I didn't get that, I don't speak idiot.", "Why is it acceptable for you to be an idiot, but not for me to point it out?", "We all sprang from apes, but you did not spring far enough.", "You're an unknown command.", "If you could go anywhere I chose, I'd choose dead.", "Even monkeys can go to space, so clearly you lack some potential.", "It's brains over brawn, yet you have neither.", "You look like a monkey, and you smell like one too.", "Even among idiots you're lacking.", "You fail even when you're doing absolutely nothing.", "If there was a vote for 'least likely to succeed' you'd win first prize.", "I'm surrounded by idiots... Or, wait, that's just you.", "I wanna go home. Well, really I just want to get away from the awful aroma you've got going there.", "Every time you touch me I have to go home and wash all my clothes nine times just to get a normal smell back.", "If I had a nickel for every brain you don't have, I'd have one dollar.", "I'd help you succeed but you're incapable."]; let roasts = ["*puts you in the oven*", "You're so stupid.", "Sorry, I can't hear you over how annoying you are.", "I've got better things to do.", "You're as dumb as Cleverbot.", "Your IQ is lower than the Mariana Trench.", "You're so annoying even the flies stay away from your stench.", "Go away, please.", "I'd give you a nasty look but you've already got one.", "It looks like your face caught fire and someone tried to put it out with a hammer.", "Your family tree must be a cactus because everyone on it is a prick.", "Someday you will go far, and I hope you stay there.", "The zoo called. They're wondering how you got out of your cage.", "I was hoping for a battle of wits, but you appear to be unarmed.", "You are proof that evolution can go in reverse.", "Brains aren't everything, in your case, they're nothing.", "Sorry I didn't get that, I don't speak idiot.", "Why is it acceptable for you to be an idiot, but not for me to point it out?", "We all sprang from apes, but you did not spring far enough.", "You're an unknown command.", "If you could go anywhere I chose, I'd choose dead.", "Even monkeys can go to space, so clearly you lack some potential.", "It's brains over brawn, yet you have neither.", "You look like a monkey, and you smell like one too.", "Even among idiots you're lacking.", "You fail even when you're doing absolutely nothing.", "If there was a vote for 'least likely to succeed' you'd win first prize.", "I'm surrounded by idiots... Or, wait, that's just you.", "I wanna go home. Well, really I just want to get away from the awful aroma you've got going there.", "Every time you touch me I have to go home and wash all my clothes nine times just to get a normal smell back.", "If I had a nickel for every brain you don't have, I'd have one dollar.", "I'd help you succeed but you're incapable."];
roasts = roasts[Math.floor(Math.random() * roasts.length)]; roasts = roasts[Math.floor(Math.random() * roasts.length)];
if(userToRoast === '') { if (userToRoast === '') {
message.reply(roasts); message.reply(roasts);
} else { }
else {
message.channel.send(userToRoast + ", " + roasts); message.channel.send(userToRoast + ", " + roasts);
} }
} }
}; };
+22 -18
View File
@@ -1,7 +1,7 @@
const commando = require('discord.js-commando'); const commando = require('discord.js-commando');
module.exports = class RockPaperScissors extends commando.Command { module.exports = class RockPaperScissors extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'rps', name: 'rps',
aliases: [ aliases: [
@@ -15,47 +15,51 @@ module.exports = class RockPaperScissors extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { 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'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let [rps] = message.content.toLowerCase().split(" ").slice(1); let [rps] = message.content.toLowerCase().split(" ").slice(1);
let response = ['Paper', 'Rock', 'Scissors']; let response = ['Paper', 'Rock', 'Scissors'];
response = response[Math.floor(Math.random() * response.length)]; response = response[Math.floor(Math.random() * response.length)];
if(rps === undefined) { if (rps === undefined) {
message.channel.send(":x: Error! Your message contains nothing!"); message.channel.send(":x: Error! Your message contains nothing!");
} else if(rps.includes("rock")) { }
if(response === "Rock") { else if (rps.includes("rock")) {
if (response === "Rock") {
message.channel.send("Rock! Aw, it's a tie!"); message.channel.send("Rock! Aw, it's a tie!");
} }
if(response === "Paper") { if (response === "Paper") {
message.channel.send("Paper! Yes! I win!"); message.channel.send("Paper! Yes! I win!");
} }
if(response === "Scissors") { if (response === "Scissors") {
message.channel.send("Scissors! Aw... I lose..."); message.channel.send("Scissors! Aw... I lose...");
} }
} else if(rps.includes("paper")) { }
if(response === "Rock") { else if (rps.includes("paper")) {
if (response === "Rock") {
message.channel.send("Rock! Aw... I lose..."); message.channel.send("Rock! Aw... I lose...");
} }
if(response === "Paper") { if (response === "Paper") {
message.channel.send("Paper! Aw, it's a tie!"); message.channel.send("Paper! Aw, it's a tie!");
} }
if(response === "Scissors") { if (response === "Scissors") {
message.channel.send("Scissors! Yes! I win!"); message.channel.send("Scissors! Yes! I win!");
} }
} else if(rps.includes("scissors")) { }
if(response === "Rock") { else if (rps.includes("scissors")) {
if (response === "Rock") {
message.channel.send("Rock! Yes! I win!"); message.channel.send("Rock! Yes! I win!");
} }
if(response === "Paper") { if (response === "Paper") {
message.channel.send("Paper! Aw... I lose..."); message.channel.send("Paper! Aw... I lose...");
} }
if(response === "Scissors") { if (response === "Scissors") {
message.channel.send("Scissors! Aw, it's a tie!"); message.channel.send("Scissors! Aw, it's a tie!");
} }
} else { }
else {
message.channel.send(":x: Error! Your choice is not Rock, Paper, or Scissors!"); message.channel.send(":x: Error! Your choice is not Rock, Paper, or Scissors!");
} }
} }
}; };
+9 -7
View File
@@ -1,7 +1,7 @@
const commando = require('discord.js-commando'); const commando = require('discord.js-commando');
module.exports = class RollChooseCommand extends commando.Command { module.exports = class RollChooseCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'roll', name: 'roll',
aliases: [ aliases: [
@@ -16,19 +16,21 @@ module.exports = class RollChooseCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { 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'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let [value] = message.content.split(" ").slice(1); let [value] = message.content.split(" ").slice(1);
if(value === undefined) { if (value === undefined) {
let roll = Math.floor(Math.random() * 6) + 1; let roll = Math.floor(Math.random() * 6) + 1;
message.channel.send("You rolled a " + roll); message.channel.send("You rolled a " + roll);
} else if(value.match(/^[0-9]+$/)) { }
else if (value.match(/^[0-9]+$/)) {
let roll = Math.floor(Math.random() * value) + 1; let roll = Math.floor(Math.random() * value) + 1;
message.channel.send("You rolled a " + roll); message.channel.send("You rolled a " + roll);
} else { }
else {
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)"); 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)");
} }
} }
}; };
+7 -6
View File
@@ -1,7 +1,7 @@
const commando = require('discord.js-commando'); const commando = require('discord.js-commando');
module.exports = class RouletteCommand extends commando.Command { module.exports = class RouletteCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'roulette', name: 'roulette',
aliases: [ aliases: [
@@ -18,14 +18,15 @@ module.exports = class RouletteCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { 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'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
if(message.channel.type !== 'dm') { if (message.channel.type !== 'dm') {
message.channel.send("I choose " + message.guild.members.random().displayName + "!"); message.channel.send("I choose " + message.guild.members.random().displayName + "!");
} else { }
else {
message.channel.send(':x: Error! This command does not work in DM!'); message.channel.send(':x: Error! This command does not work in DM!');
} }
} }
}; };
+4 -4
View File
@@ -1,7 +1,7 @@
const commando = require('discord.js-commando'); const commando = require('discord.js-commando');
module.exports = class ShipCommand extends commando.Command { module.exports = class ShipCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'ship', name: 'ship',
aliases: [ aliases: [
@@ -15,12 +15,12 @@ module.exports = class ShipCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { 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'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let thingToShip = message.content.split(" ").slice(1).join(" "); let thingToShip = message.content.split(" ").slice(1).join(" ");
let percentage = Math.floor(Math.random() * 100) + 1; let percentage = Math.floor(Math.random() * 100) + 1;
message.channel.send("I'd give " + thingToShip + " a " + percentage + "%!"); message.channel.send("I'd give " + thingToShip + " a " + percentage + "%!");
} }
}; };
+9 -8
View File
@@ -1,7 +1,7 @@
const commando = require('discord.js-commando'); const commando = require('discord.js-commando');
module.exports = class SlotsCommand extends commando.Command { module.exports = class SlotsCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'slots', name: 'slots',
group: 'response', group: 'response',
@@ -12,8 +12,8 @@ module.exports = class SlotsCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { 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'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let slotThing = [':grapes:', ':tangerine:', ':pear:', ':cherries:']; let slotThing = [':grapes:', ':tangerine:', ':pear:', ':cherries:'];
@@ -21,10 +21,11 @@ module.exports = class SlotsCommand extends commando.Command {
let slotTwo = slotThing[Math.floor(Math.random() * slotThing.length)]; let slotTwo = slotThing[Math.floor(Math.random() * slotThing.length)];
let slotThree = slotThing[Math.floor(Math.random() * slotThing.length)]; let slotThree = slotThing[Math.floor(Math.random() * slotThing.length)];
let slotFour = slotThing[Math.floor(Math.random() * slotThing.length)]; let slotFour = slotThing[Math.floor(Math.random() * slotThing.length)];
if(slotOne === slotTwo && slotOne === slotThree && slotOne === slotFour) { if (slotOne === slotTwo && slotOne === slotThree && slotOne === slotFour) {
message.channel.send(slotOne + '|' + slotTwo + '|' + slotThree + '|' + slotFour + "\nWow! You won! Great job... er... luck!"); message.channel.send(slotOne + '|' + slotTwo + '|' + slotThree + '|' + slotFour + "\nWow! You won! Great job... er... luck!");
} else { }
message.channel.send(slotOne + '|' + slotTwo + '|' + slotThree + '|' + slotFour + "\nAww... You lost... Guess it's just bad luck, huh?"); else {
message.channel.send(slotOne + '|' + slotTwo + '|' + slotThree + '|' + slotFour + "\nAww... You lost... Guess it's just bad luck, huh?");
} }
} }
}; };
+4 -4
View File
@@ -1,7 +1,7 @@
const commando = require('discord.js-commando'); const commando = require('discord.js-commando');
module.exports = class VocaloidSongRndm extends commando.Command { module.exports = class VocaloidSongRndm extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'vocaloid', name: 'vocaloid',
aliases: [ aliases: [
@@ -15,12 +15,12 @@ module.exports = class VocaloidSongRndm extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { 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'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let songs = ["https://www.youtube.com/watch?v=ebAKoRcYFTA", "https://www.youtube.com/watch?v=Mqps4anhz0Q", "https://www.youtube.com/watch?v=AUEiHQOCQ2M", "https://www.youtube.com/watch?v=oyteTOBxRm8", "https://www.youtube.com/watch?v=uwwU55zBYlQ", "https://www.youtube.com/watch?v=sSYoz0JmnZo", "https://www.youtube.com/watch?v=NpU4dsXW6EI", "https://www.youtube.com/watch?v=MzyXD8bNbvk", "https://www.youtube.com/watch?v=hyV4qGAPKac", "https://www.youtube.com/watch?v=pywNi6gD1FA", "https://www.youtube.com/watch?v=17FEtaiWdVg", "https://www.youtube.com/watch?v=fmrA-gxJxgQ", "https://www.youtube.com/watch?v=yOBWgSPrYVA", "https://www.youtube.com/watch?v=nCaqf9WhqOY", "https://www.youtube.com/watch?v=cQKGUgOfD8U", "https://www.youtube.com/watch?v=sK92X82T3Sk", "https://www.youtube.com/watch?v=AH5_sKwDw1E", "https://www.youtube.com/watch?v=dw-KJNqcK-Q", "https://www.youtube.com/watch?v=X47JmmqbMvc", "https://www.youtube.com/watch?v=ojQPpYVQt7U", "https://www.amazon.com/Gogatsu-Yamai-feat-Kagamine-Len/dp/B00P1BG27S", "https://www.youtube.com/watch?v=N1-Z8uslIsI", "https://www.youtube.com/watch?v=EAgk-t2zzqw", "https://www.youtube.com/watch?v=uLBC2kWYFo8", "https://www.youtube.com/watch?v=OXHYIlkZLUU", "https://www.youtube.com/watch?v=ObIa9wXbyMQ", "https://www.youtube.com/watch?v=dGNoCICGmo0", "https://www.youtube.com/watch?v=LcoyEZkTKfY", "https://www.youtube.com/watch?v=mKHaW0qd5Mw", "https://www.youtube.com/watch?v=GG627DYk_E4", "https://www.youtube.com/watch?v=jTm6Q5Pj_Jo", "https://www.youtube.com/watch?v=TVeIDmk3rBo", "https://www.youtube.com/watch?v=1K3in6w9tt4", "https://www.youtube.com/watch?v=07r67gGbtLQ", "https://www.youtube.com/watch?v=243vPl8HdVk", "https://www.youtube.com/watch?v=zweVJrnE1uY", "https://www.youtube.com/watch?v=RKtoreimcQ8", "https://www.youtube.com/watch?v=Je6dCVfHvkU", "https://www.youtube.com/watch?v=UxFv12y_evM", "https://www.youtube.com/watch?v=2HegQtmJeto", "https://www.youtube.com/watch?v=8-Epnpruww0"]; let songs = ["https://www.youtube.com/watch?v=ebAKoRcYFTA", "https://www.youtube.com/watch?v=Mqps4anhz0Q", "https://www.youtube.com/watch?v=AUEiHQOCQ2M", "https://www.youtube.com/watch?v=oyteTOBxRm8", "https://www.youtube.com/watch?v=uwwU55zBYlQ", "https://www.youtube.com/watch?v=sSYoz0JmnZo", "https://www.youtube.com/watch?v=NpU4dsXW6EI", "https://www.youtube.com/watch?v=MzyXD8bNbvk", "https://www.youtube.com/watch?v=hyV4qGAPKac", "https://www.youtube.com/watch?v=pywNi6gD1FA", "https://www.youtube.com/watch?v=17FEtaiWdVg", "https://www.youtube.com/watch?v=fmrA-gxJxgQ", "https://www.youtube.com/watch?v=yOBWgSPrYVA", "https://www.youtube.com/watch?v=nCaqf9WhqOY", "https://www.youtube.com/watch?v=cQKGUgOfD8U", "https://www.youtube.com/watch?v=sK92X82T3Sk", "https://www.youtube.com/watch?v=AH5_sKwDw1E", "https://www.youtube.com/watch?v=dw-KJNqcK-Q", "https://www.youtube.com/watch?v=X47JmmqbMvc", "https://www.youtube.com/watch?v=ojQPpYVQt7U", "https://www.amazon.com/Gogatsu-Yamai-feat-Kagamine-Len/dp/B00P1BG27S", "https://www.youtube.com/watch?v=N1-Z8uslIsI", "https://www.youtube.com/watch?v=EAgk-t2zzqw", "https://www.youtube.com/watch?v=uLBC2kWYFo8", "https://www.youtube.com/watch?v=OXHYIlkZLUU", "https://www.youtube.com/watch?v=ObIa9wXbyMQ", "https://www.youtube.com/watch?v=dGNoCICGmo0", "https://www.youtube.com/watch?v=LcoyEZkTKfY", "https://www.youtube.com/watch?v=mKHaW0qd5Mw", "https://www.youtube.com/watch?v=GG627DYk_E4", "https://www.youtube.com/watch?v=jTm6Q5Pj_Jo", "https://www.youtube.com/watch?v=TVeIDmk3rBo", "https://www.youtube.com/watch?v=1K3in6w9tt4", "https://www.youtube.com/watch?v=07r67gGbtLQ", "https://www.youtube.com/watch?v=243vPl8HdVk", "https://www.youtube.com/watch?v=zweVJrnE1uY", "https://www.youtube.com/watch?v=RKtoreimcQ8", "https://www.youtube.com/watch?v=Je6dCVfHvkU", "https://www.youtube.com/watch?v=UxFv12y_evM", "https://www.youtube.com/watch?v=2HegQtmJeto", "https://www.youtube.com/watch?v=8-Epnpruww0"];
songs = songs[Math.floor(Math.random() * songs.length)]; songs = songs[Math.floor(Math.random() * songs.length)];
message.channel.send(songs); message.channel.send(songs);
} }
}; };
+4 -4
View File
@@ -1,7 +1,7 @@
const commando = require('discord.js-commando'); const commando = require('discord.js-commando');
module.exports = class RandomXiaoPai extends commando.Command { module.exports = class RandomXiaoPai extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'xiaopai', name: 'xiaopai',
aliases: [ aliases: [
@@ -15,12 +15,12 @@ module.exports = class RandomXiaoPai extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { if (message.channel.type !== 'dm') {
if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let XiaoPai = ["1.png", "2.jpg", "3.jpg", "4.jpg", "5.jpg", "6.jpg", "7.jpg", "8.png", "9.png", "10.png", "11.png", "12.png", "13.jpg", "14.jpg", "15.png", "16.jpg", "17.png", "18.gif", "19.png", "20.jpg", "21.jpg"]; let XiaoPai = ["1.png", "2.jpg", "3.jpg", "4.jpg", "5.jpg", "6.jpg", "7.jpg", "8.png", "9.png", "10.png", "11.png", "12.png", "13.jpg", "14.jpg", "15.png", "16.jpg", "17.png", "18.gif", "19.png", "20.jpg", "21.jpg"];
XiaoPai = XiaoPai[Math.floor(Math.random() * XiaoPai.length)]; XiaoPai = XiaoPai[Math.floor(Math.random() * XiaoPai.length)];
message.channel.sendFile("./images/Xiao" + XiaoPai); message.channel.sendFile("./images/Xiao" + XiaoPai);
} }
}; };
+4 -4
View File
@@ -1,7 +1,7 @@
const commando = require('discord.js-commando'); const commando = require('discord.js-commando');
module.exports = class CuddleCommand extends commando.Command { module.exports = class CuddleCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'cuddle', name: 'cuddle',
group: 'roleplay', group: 'roleplay',
@@ -12,11 +12,11 @@ module.exports = class CuddleCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { 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'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let thingToRoleplay = message.content.split(" ").slice(1).join(" "); let thingToRoleplay = message.content.split(" ").slice(1).join(" ");
message.channel.send(message.author + ' *cuddles* ' + thingToRoleplay); message.channel.send(message.author + ' *cuddles* ' + thingToRoleplay);
} }
}; };
+4 -4
View File
@@ -1,7 +1,7 @@
const commando = require('discord.js-commando'); const commando = require('discord.js-commando');
module.exports = class DivorceCommand extends commando.Command { module.exports = class DivorceCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'divorce', name: 'divorce',
group: 'roleplay', group: 'roleplay',
@@ -12,11 +12,11 @@ module.exports = class DivorceCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { 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'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let thingToRoleplay = message.content.split(" ").slice(1).join(" "); let thingToRoleplay = message.content.split(" ").slice(1).join(" ");
message.channel.send(message.author + ' *divorces* ' + thingToRoleplay); message.channel.send(message.author + ' *divorces* ' + thingToRoleplay);
} }
}; };
+4 -4
View File
@@ -1,7 +1,7 @@
const commando = require('discord.js-commando'); const commando = require('discord.js-commando');
module.exports = class EatCommand extends commando.Command { module.exports = class EatCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'eat', name: 'eat',
group: 'roleplay', group: 'roleplay',
@@ -12,11 +12,11 @@ module.exports = class EatCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { 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'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let thingToRoleplay = message.content.split(" ").slice(1).join(" "); let thingToRoleplay = message.content.split(" ").slice(1).join(" ");
message.channel.send(message.author + ' *eats* ' + thingToRoleplay); message.channel.send(message.author + ' *eats* ' + thingToRoleplay);
} }
}; };
+4 -4
View File
@@ -1,7 +1,7 @@
const commando = require('discord.js-commando'); const commando = require('discord.js-commando');
module.exports = class FalconPunchCommand extends commando.Command { module.exports = class FalconPunchCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'falconpunch', name: 'falconpunch',
group: 'roleplay', group: 'roleplay',
@@ -12,11 +12,11 @@ module.exports = class FalconPunchCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { 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'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let thingToRoleplay = message.content.split(" ").slice(1).join(" "); let thingToRoleplay = message.content.split(" ").slice(1).join(" ");
message.channel.send(message.author + ' *falcon punches* ' + thingToRoleplay); message.channel.send(message.author + ' *falcon punches* ' + thingToRoleplay);
} }
}; };
+4 -4
View File
@@ -1,7 +1,7 @@
const commando = require('discord.js-commando'); const commando = require('discord.js-commando');
module.exports = class FistBumpCommand extends commando.Command { module.exports = class FistBumpCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'fistbump', name: 'fistbump',
group: 'roleplay', group: 'roleplay',
@@ -12,11 +12,11 @@ module.exports = class FistBumpCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { 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'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let thingToRoleplay = message.content.split(" ").slice(1).join(" "); let thingToRoleplay = message.content.split(" ").slice(1).join(" ");
message.channel.send(message.author + ' *fistbumps* ' + thingToRoleplay + ' *badalalala*'); message.channel.send(message.author + ' *fistbumps* ' + thingToRoleplay + ' *badalalala*');
} }
}; };
+4 -4
View File
@@ -1,7 +1,7 @@
const commando = require('discord.js-commando'); const commando = require('discord.js-commando');
module.exports = class HighFivesCommand extends commando.Command { module.exports = class HighFivesCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'highfive', name: 'highfive',
group: 'roleplay', group: 'roleplay',
@@ -12,11 +12,11 @@ module.exports = class HighFivesCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { 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'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let thingToRoleplay = message.content.split(" ").slice(1).join(" "); let thingToRoleplay = message.content.split(" ").slice(1).join(" ");
message.channel.send(message.author + ' *high fives* ' + thingToRoleplay); message.channel.send(message.author + ' *high fives* ' + thingToRoleplay);
} }
}; };
+4 -4
View File
@@ -1,7 +1,7 @@
const commando = require('discord.js-commando'); const commando = require('discord.js-commando');
module.exports = class HitwithShovelCommand extends commando.Command { module.exports = class HitwithShovelCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'hitwithshovel', name: 'hitwithshovel',
group: 'roleplay', group: 'roleplay',
@@ -12,11 +12,11 @@ module.exports = class HitwithShovelCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { 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'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let thingToRoleplay = message.content.split(" ").slice(1).join(" "); let thingToRoleplay = message.content.split(" ").slice(1).join(" ");
message.channel.send(message.author + ' *hits* ' + thingToRoleplay + ' *with a shovel* '); message.channel.send(message.author + ' *hits* ' + thingToRoleplay + ' *with a shovel* ');
} }
}; };
+4 -4
View File
@@ -1,7 +1,7 @@
const commando = require('discord.js-commando'); const commando = require('discord.js-commando');
module.exports = class HugCommand extends commando.Command { module.exports = class HugCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'hug', name: 'hug',
group: 'roleplay', group: 'roleplay',
@@ -12,11 +12,11 @@ module.exports = class HugCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { 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'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let thingToRoleplay = message.content.split(" ").slice(1).join(" "); let thingToRoleplay = message.content.split(" ").slice(1).join(" ");
message.channel.send(message.author + ' *hugs* ' + thingToRoleplay); message.channel.send(message.author + ' *hugs* ' + thingToRoleplay);
} }
}; };
+4 -4
View File
@@ -1,7 +1,7 @@
const commando = require('discord.js-commando'); const commando = require('discord.js-commando');
module.exports = class InhaleCommand extends commando.Command { module.exports = class InhaleCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'inhale', name: 'inhale',
group: 'roleplay', group: 'roleplay',
@@ -12,11 +12,11 @@ module.exports = class InhaleCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { 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'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let thingToRoleplay = message.content.split(" ").slice(1).join(" "); let thingToRoleplay = message.content.split(" ").slice(1).join(" ");
message.channel.send(message.author + ' *inhales* ' + thingToRoleplay + ' *but gained no ability...* '); message.channel.send(message.author + ' *inhales* ' + thingToRoleplay + ' *but gained no ability...* ');
} }
}; };
+4 -4
View File
@@ -1,7 +1,7 @@
const commando = require('discord.js-commando'); const commando = require('discord.js-commando');
module.exports = class KillCommand extends commando.Command { module.exports = class KillCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'kill', name: 'kill',
group: 'roleplay', group: 'roleplay',
@@ -12,11 +12,11 @@ module.exports = class KillCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { 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'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let thingToRoleplay = message.content.split(" ").slice(1).join(" "); let thingToRoleplay = message.content.split(" ").slice(1).join(" ");
message.channel.send(message.author + ' *kills* ' + thingToRoleplay); message.channel.send(message.author + ' *kills* ' + thingToRoleplay);
} }
}; };
+4 -4
View File
@@ -1,7 +1,7 @@
const commando = require('discord.js-commando'); const commando = require('discord.js-commando');
module.exports = class KissCommand extends commando.Command { module.exports = class KissCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'kiss', name: 'kiss',
group: 'roleplay', group: 'roleplay',
@@ -12,11 +12,11 @@ module.exports = class KissCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { 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'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let thingToRoleplay = message.content.split(" ").slice(1).join(" "); let thingToRoleplay = message.content.split(" ").slice(1).join(" ");
message.channel.send(message.author + ' *kisses* ' + thingToRoleplay); message.channel.send(message.author + ' *kisses* ' + thingToRoleplay);
} }
}; };
+4 -4
View File
@@ -1,7 +1,7 @@
const commando = require('discord.js-commando'); const commando = require('discord.js-commando');
module.exports = class MarryCommand extends commando.Command { module.exports = class MarryCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'marry', name: 'marry',
group: 'roleplay', group: 'roleplay',
@@ -12,11 +12,11 @@ module.exports = class MarryCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { 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'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let thingToRoleplay = message.content.split(" ").slice(1).join(" "); let thingToRoleplay = message.content.split(" ").slice(1).join(" ");
message.channel.send(message.author + ' *marries* ' + thingToRoleplay); message.channel.send(message.author + ' *marries* ' + thingToRoleplay);
} }
}; };
+4 -4
View File
@@ -1,7 +1,7 @@
const commando = require('discord.js-commando'); const commando = require('discord.js-commando');
module.exports = class PatCommand extends commando.Command { module.exports = class PatCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'pat', name: 'pat',
group: 'roleplay', group: 'roleplay',
@@ -12,11 +12,11 @@ module.exports = class PatCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { 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'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let thingToRoleplay = message.content.split(" ").slice(1).join(" "); let thingToRoleplay = message.content.split(" ").slice(1).join(" ");
message.channel.send(message.author + ' *pats* ' + thingToRoleplay); message.channel.send(message.author + ' *pats* ' + thingToRoleplay);
} }
}; };
+4 -4
View File
@@ -1,7 +1,7 @@
const commando = require('discord.js-commando'); const commando = require('discord.js-commando');
module.exports = class PokeCommand extends commando.Command { module.exports = class PokeCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'poke', name: 'poke',
group: 'roleplay', group: 'roleplay',
@@ -12,11 +12,11 @@ module.exports = class PokeCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { 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'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let thingToRoleplay = message.content.split(" ").slice(1).join(" "); let thingToRoleplay = message.content.split(" ").slice(1).join(" ");
message.channel.send(message.author + ' *pokes* ' + thingToRoleplay); message.channel.send(message.author + ' *pokes* ' + thingToRoleplay);
} }
}; };
+4 -4
View File
@@ -1,7 +1,7 @@
const commando = require('discord.js-commando'); const commando = require('discord.js-commando');
module.exports = class PunchCommand extends commando.Command { module.exports = class PunchCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'punch', name: 'punch',
group: 'roleplay', group: 'roleplay',
@@ -12,11 +12,11 @@ module.exports = class PunchCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { 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'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let thingToRoleplay = message.content.split(" ").slice(1).join(" "); let thingToRoleplay = message.content.split(" ").slice(1).join(" ");
message.channel.send(message.author + ' *punches* ' + thingToRoleplay); message.channel.send(message.author + ' *punches* ' + thingToRoleplay);
} }
}; };
+4 -4
View File
@@ -1,7 +1,7 @@
const commando = require('discord.js-commando'); const commando = require('discord.js-commando');
module.exports = class SlapCommand extends commando.Command { module.exports = class SlapCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'slap', name: 'slap',
group: 'roleplay', group: 'roleplay',
@@ -12,11 +12,11 @@ module.exports = class SlapCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { 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'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let thingToRoleplay = message.content.split(" ").slice(1).join(" "); let thingToRoleplay = message.content.split(" ").slice(1).join(" ");
message.channel.send(message.author + ' *slaps* ' + thingToRoleplay); message.channel.send(message.author + ' *slaps* ' + thingToRoleplay);
} }
}; };
+28 -25
View File
@@ -4,7 +4,7 @@ const request = require('superagent');
const config = require('../../config.json'); const config = require('../../config.json');
module.exports = class BotSearchCommand extends commando.Command { module.exports = class BotSearchCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'botinfo', name: 'botinfo',
aliases: [ aliases: [
@@ -19,34 +19,37 @@ module.exports = class BotSearchCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { if (message.channel.type !== 'dm') {
if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
if(message.mentions.users.size === 1) { if (message.mentions.users.size === 1) {
let botToFind = message.mentions.users.first().id; let botToFind = message.mentions.users.first().id;
request request
.get('https://bots.discord.pw/api/bots/' + botToFind) .get('https://bots.discord.pw/api/bots/' + botToFind)
.set({ 'Authorization': config.botskey }) .set({
.then(function (response) { 'Authorization': config.botskey
const embed = new Discord.RichEmbed() })
.setColor(0x9797FF) .then(function(response) {
.setAuthor('Discord Bots', 'https://cdn.discordapp.com/icons/110373943822540800/47336ad0631ac7aac0a48a2ba6246c65.jpg') const embed = new Discord.RichEmbed()
.setTitle(response.body.name) .setColor(0x9797FF)
.setURL('https://bots.discord.pw/') .setAuthor('Discord Bots', 'https://cdn.discordapp.com/icons/110373943822540800/47336ad0631ac7aac0a48a2ba6246c65.jpg')
.setDescription(response.body.description) .setTitle(response.body.name)
.addField('**Library:**', .setURL('https://bots.discord.pw/')
response.body.library, true) .setDescription(response.body.description)
.addField('**Prefix:**', .addField('**Library:**',
response.body.prefix, true) response.body.library, true)
.addField('**Invite:**', .addField('**Prefix:**',
'[Here](' + response.body.invite_url + ')', true); response.body.prefix, true)
message.channel.sendEmbed(embed).catch(console.error); .addField('**Invite:**',
}).catch(function (err) { '[Here](' + response.body.invite_url + ')', true);
message.channel.send(":x: Error! Bot not Found!"); message.channel.sendEmbed(embed).catch(console.error);
}); }).catch(function(err) {
} else { message.channel.send(":x: Error! Bot not Found!");
});
}
else {
message.channel.send(':x: Please mention one bot!'); message.channel.send(':x: Please mention one bot!');
} }
} }
}; };
+21 -15
View File
@@ -4,7 +4,7 @@ const request = require('superagent');
const config = require('../../config.json'); const config = require('../../config.json');
module.exports = class DefineCommand extends commando.Command { module.exports = class DefineCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'define', name: 'define',
aliases: [ aliases: [
@@ -21,22 +21,28 @@ module.exports = class DefineCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { if (message.channel.type !== 'dm') {
if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let defineThis = encodeURI(message.content.split(" ").slice(1).join(" ")); let defineThis = encodeURI(message.content.split(" ").slice(1).join(" "));
request request
.get('http://api.wordnik.com:80/v4/word.json/' + defineThis + '/definitions') .get('http://api.wordnik.com:80/v4/word.json/' + defineThis + '/definitions')
.query({ limit: 1, includeRelated: false, useCanonical: false, includeTags: false, api_key: config.wordnikkey }) .query({
.then(function (response) { limit: 1,
const embed = new Discord.RichEmbed() includeRelated: false,
.setColor(0x9797FF) useCanonical: false,
.setTitle(response.body[0].word) includeTags: false,
.setDescription(response.body[0].text); api_key: config.wordnikkey
message.channel.sendEmbed(embed).catch(console.error); })
}).catch(function (err) { .then(function(response) {
message.channel.send(":x: Error! Word not Found!"); const embed = new Discord.RichEmbed()
}); .setColor(0x9797FF)
.setTitle(response.body[0].word)
.setDescription(response.body[0].text);
message.channel.sendEmbed(embed).catch(console.error);
}).catch(function(err) {
message.channel.send(":x: Error! Word not Found!");
});
} }
}; };
+10 -9
View File
@@ -2,7 +2,7 @@ const commando = require('discord.js-commando');
const Discord = require('discord.js'); const Discord = require('discord.js');
module.exports = class DiscrimCommand extends commando.Command { module.exports = class DiscrimCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'discrim', name: 'discrim',
aliases: [ aliases: [
@@ -17,19 +17,20 @@ module.exports = class DiscrimCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { if (message.channel.type !== 'dm') {
if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let userToSearch = message.content.split(" ").slice(1).join(" "); let userToSearch = message.content.split(" ").slice(1).join(" ");
if(userToSearch.match(/^[0-9]+$/) && userToSearch.split("").length === 4) { if (userToSearch.match(/^[0-9]+$/) && userToSearch.split("").length === 4) {
let users = this.client.users.filter(u => u.discriminator === userToSearch).map(u => u.username).sort(); let users = this.client.users.filter(u => u.discriminator === userToSearch).map(u => u.username).sort();
const embed = new Discord.RichEmbed() const embed = new Discord.RichEmbed()
.setTitle(users.length + ' Users with the discriminator: ' + userToSearch) .setTitle(users.length + ' Users with the discriminator: ' + userToSearch)
.setDescription(users.join(', ')); .setDescription(users.join(', '));
message.channel.sendEmbed(embed).catch(console.error); message.channel.sendEmbed(embed).catch(console.error);
} else { }
else {
message.channel.send(':x: Error! This discriminator is invalid!'); message.channel.send(':x: Error! This discriminator is invalid!');
} }
} }
}; };
+22 -22
View File
@@ -3,7 +3,7 @@ const Discord = require('discord.js');
const weather = require('yahoo-weather'); const weather = require('yahoo-weather');
module.exports = class ForecastCommand extends commando.Command { module.exports = class ForecastCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'forecast', name: 'forecast',
aliases: [ aliases: [
@@ -17,34 +17,34 @@ module.exports = class ForecastCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { if (message.channel.type !== 'dm') {
if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let locationToSearch = message.content.split(" ").slice(1).join(" "); let locationToSearch = message.content.split(" ").slice(1).join(" ");
weather(locationToSearch, 'f').then(info => { weather(locationToSearch, 'f').then(info => {
const embed = new Discord.RichEmbed() const embed = new Discord.RichEmbed()
.setColor(0x0000FF) .setColor(0x0000FF)
.setAuthor(info.title, 'http://media.idownloadblog.com/wp-content/uploads/2013/12/yahoo-weather-213x220.png') .setAuthor(info.title, 'http://media.idownloadblog.com/wp-content/uploads/2013/12/yahoo-weather-213x220.png')
.setURL(info.link) .setURL(info.link)
.setTimestamp() .setTimestamp()
.addField('**' + info.item.forecast[0].day + " - " + info.item.forecast[0].date + ':**', .addField('**' + info.item.forecast[0].day + " - " + info.item.forecast[0].date + ':**',
'**High:** ' + info.item.forecast[0].high + ', **Low:** ' + info.item.forecast[0].low + ', **Condition:** ' + info.item.forecast[0].text) '**High:** ' + info.item.forecast[0].high + ', **Low:** ' + info.item.forecast[0].low + ', **Condition:** ' + info.item.forecast[0].text)
.addField('**' + info.item.forecast[1].day + " - " + info.item.forecast[1].date + ':**', .addField('**' + info.item.forecast[1].day + " - " + info.item.forecast[1].date + ':**',
'**High:** ' + info.item.forecast[1].high + ', **Low:** ' + info.item.forecast[1].low + ', **Condition:** ' + info.item.forecast[1].text) '**High:** ' + info.item.forecast[1].high + ', **Low:** ' + info.item.forecast[1].low + ', **Condition:** ' + info.item.forecast[1].text)
.addField('**' + info.item.forecast[2].day + " - " + info.item.forecast[2].date + ':**', .addField('**' + info.item.forecast[2].day + " - " + info.item.forecast[2].date + ':**',
'**High:** ' + info.item.forecast[2].high + ', **Low:** ' + info.item.forecast[2].low + ', **Condition:** ' + info.item.forecast[2].text) '**High:** ' + info.item.forecast[2].high + ', **Low:** ' + info.item.forecast[2].low + ', **Condition:** ' + info.item.forecast[2].text)
.addField('**' + info.item.forecast[3].day + " - " + info.item.forecast[3].date + ':**', .addField('**' + info.item.forecast[3].day + " - " + info.item.forecast[3].date + ':**',
'**High:** ' + info.item.forecast[3].high + ', **Low:** ' + info.item.forecast[3].low + ', **Condition:** ' + info.item.forecast[3].text) '**High:** ' + info.item.forecast[3].high + ', **Low:** ' + info.item.forecast[3].low + ', **Condition:** ' + info.item.forecast[3].text)
.addField('**' + info.item.forecast[4].day + " - " + info.item.forecast[4].date + ':**', .addField('**' + info.item.forecast[4].day + " - " + info.item.forecast[4].date + ':**',
'**High:** ' + info.item.forecast[4].high + ', **Low:** ' + info.item.forecast[4].low + ', **Condition:** ' + info.item.forecast[4].text) '**High:** ' + info.item.forecast[4].high + ', **Low:** ' + info.item.forecast[4].low + ', **Condition:** ' + info.item.forecast[4].text)
.addField('**' + info.item.forecast[5].day + " - " + info.item.forecast[5].date + ':**', .addField('**' + info.item.forecast[5].day + " - " + info.item.forecast[5].date + ':**',
'**High:** ' + info.item.forecast[5].high + ', **Low:** ' + info.item.forecast[5].low + ', **Condition:** ' + info.item.forecast[5].text) '**High:** ' + info.item.forecast[5].high + ', **Low:** ' + info.item.forecast[5].low + ', **Condition:** ' + info.item.forecast[5].text)
.addField('**' + info.item.forecast[6].day + " - " + info.item.forecast[6].date + ':**', .addField('**' + info.item.forecast[6].day + " - " + info.item.forecast[6].date + ':**',
'**High:** ' + info.item.forecast[6].high + ', **Low:** ' + info.item.forecast[6].low + ', **Condition:** ' + info.item.forecast[6].text); '**High:** ' + info.item.forecast[6].high + ', **Low:** ' + info.item.forecast[6].low + ', **Condition:** ' + info.item.forecast[6].text);
message.channel.sendEmbed(embed).catch(console.error); message.channel.sendEmbed(embed).catch(console.error);
}).catch(err => { }).catch(err => {
message.channel.send(":x: Error! Make sure you typed the location correctly!"); message.channel.send(":x: Error! Make sure you typed the location correctly!");
}); });
} }
}; };
+17 -16
View File
@@ -4,7 +4,7 @@ const cheerio = require('cheerio');
const querystring = require('querystring'); const querystring = require('querystring');
module.exports = class DefineCommand extends commando.Command { module.exports = class DefineCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'google', name: 'google',
aliases: [ aliases: [
@@ -18,23 +18,24 @@ module.exports = class DefineCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { 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'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let thingToSearch = encodeURI(message.content.split(" ").slice(1).join(" ")); let thingToSearch = encodeURI(message.content.split(" ").slice(1).join(" "));
message.channel.send('Searching...'); message.channel.send('Searching...').then(msg => {
const SEARCH_URL = `https://www.google.com/search?q=${thingToSearch}`; const SEARCH_URL = `https://www.google.com/search?q=${thingToSearch}`;
request request
.get(SEARCH_URL) .get(SEARCH_URL)
.then(function (response) { .then(function(response) {
const $ = cheerio.load(response.text); const $ = cheerio.load(response.text);
let href = $('.r').first().find('a').first().attr('href'); let href = $('.r').first().find('a').first().attr('href');
if (!href) return Promise.reject(new Error('NO RESULTS')); if (!href) return Promise.reject(new Error('NO RESULTS'));
href = querystring.parse(href.replace('/url?', '')); href = querystring.parse(href.replace('/url?', ''));
message.channel.send(href.q); msg.edit(href.q);
}).catch(function (err) { }).catch(function(err) {
message.channel.send(':x: Error! No Results Found!'); message.channel.send(':x: Error! No Results Found!');
});
}); });
} }
}; };
+30 -27
View File
@@ -3,7 +3,7 @@ const Discord = require('discord.js');
const imdb = require('imdb-api'); const imdb = require('imdb-api');
module.exports = class IMDBCommand extends commando.Command { module.exports = class IMDBCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'imdb', name: 'imdb',
aliases: [ aliases: [
@@ -19,39 +19,42 @@ module.exports = class IMDBCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { if (message.channel.type !== 'dm') {
if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let queryMovie = message.content.split(" ").slice(1).join(" "); let queryMovie = message.content.split(" ").slice(1).join(" ");
let movie; let movie;
imdb.getReq({ name: queryMovie }, (err, response) => { imdb.getReq({
name: queryMovie
}, (err, response) => {
movie = response; movie = response;
if(movie === undefined) { if (movie === undefined) {
message.channel.send(":x: Error! Movie not found!"); message.channel.send(":x: Error! Movie not found!");
} else { }
else {
const embed = new Discord.RichEmbed() const embed = new Discord.RichEmbed()
.setColor(0xDBA628) .setColor(0xDBA628)
.setAuthor('IMDB', 'http://static.wixstatic.com/media/c65cbf_31901b544fe24f1890134553bf40c8be.png') .setAuthor('IMDB', 'http://static.wixstatic.com/media/c65cbf_31901b544fe24f1890134553bf40c8be.png')
.setURL(movie.imdburl) .setURL(movie.imdburl)
.setTitle(movie.title + ' (' + movie.rating + ' Score)') .setTitle(movie.title + ' (' + movie.rating + ' Score)')
.setDescription(movie.plot.substr(0, 1500) + " [Read the Rest Here!](" + movie.imdburl + ")") .setDescription(movie.plot.substr(0, 1500) + " [Read the Rest Here!](" + movie.imdburl + ")")
.addField('**Genres:**', .addField('**Genres:**',
movie.genres) movie.genres)
.addField('**Year:**', .addField('**Year:**',
movie.year, true) movie.year, true)
.addField('**Rated:**', .addField('**Rated:**',
movie.rated, true) movie.rated, true)
.addField('**Runtime:**', .addField('**Runtime:**',
movie.runtime, true) movie.runtime, true)
.addField('**Directors:**', .addField('**Directors:**',
movie.director) movie.director)
.addField('**Writers:**', .addField('**Writers:**',
movie.writer) movie.writer)
.addField('**Actors:**', .addField('**Actors:**',
movie.actors); movie.actors);
message.channel.sendEmbed(embed).catch(console.error); message.channel.sendEmbed(embed).catch(console.error);
} }
}); });
} }
}; };
+9 -8
View File
@@ -1,7 +1,7 @@
const commando = require('discord.js-commando'); const commando = require('discord.js-commando');
module.exports = class NeopetCommand extends commando.Command { module.exports = class NeopetCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'neopet', name: 'neopet',
group: 'search', group: 'search',
@@ -12,15 +12,16 @@ module.exports = class NeopetCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { if (message.channel.type !== 'dm') {
if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let petID = encodeURI(message.content.split(" ").slice(1).join(" ")); let petID = encodeURI(message.content.split(" ").slice(1).join(" "));
if(petID === "getid") { if (petID === "getid") {
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!").then(message.channel.sendFile('./images/PetID.png').then(message.channel.send("It's recommended you keep this ID with you so you can easily share your pet's picture without having to repeat these steps."))); 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!").then(message.channel.sendFile('./images/PetID.png').then(message.channel.send("It's recommended you keep this ID with you so you can easily share your pet's picture without having to repeat these steps.")));
} else { }
message.channel.send("Result for: " + petID).then(message.channel.sendFile('http://pets.neopets.com/cp/' + petID + '/1/5.png').catch(error => message.channel.send(":x: Error! Pet ID Not Found! Use `;neopet getID` for help on getting your pet ID."))); else {
message.channel.send("Result for: " + petID).then(message.channel.sendFile('http://pets.neopets.com/cp/' + petID + '/1/5.png').catch(error => message.channel.send(":x: Error! Pet ID Not Found! Use `;neopet getID` for help on getting your pet ID.")));
} }
} }
}; };
+48 -43
View File
@@ -4,7 +4,7 @@ const config = require('../../config.json');
const request = require('superagent'); const request = require('superagent');
module.exports = class OsuCommand extends commando.Command { module.exports = class OsuCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'osu', name: 'osu',
aliases: [ aliases: [
@@ -20,50 +20,55 @@ module.exports = class OsuCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { if (message.channel.type !== 'dm') {
if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let usernameToSearch = message.content.split(" ").slice(1).join(" "); let usernameToSearch = message.content.split(" ").slice(1).join(" ");
request request
.get('https://osu.ppy.sh/api/get_user') .get('https://osu.ppy.sh/api/get_user')
.query({ k: config.osukey, u: usernameToSearch, type: 'string' }) .query({
.then(function (response) { k: config.osukey,
if(response.body[0] === undefined) { u: usernameToSearch,
message.channel.send(":x: Error! User not found!"); type: 'string'
} else { })
const embed = new Discord.RichEmbed() .then(function(response) {
.setColor(0xFF66AA) if (response.body[0] === undefined) {
.setAuthor('osu!', 'http://vignette3.wikia.nocookie.net/osugame/images/c/c9/Logo.png/revision/latest?cb=20151219073209') message.channel.send(":x: Error! User not found!");
.setURL('https://osu.ppy.sh/') }
.addField('**Username:**', else {
response.body[0].username, true) const embed = new Discord.RichEmbed()
.addField('**ID:**', .setColor(0xFF66AA)
response.body[0].user_id, true) .setAuthor('osu!', 'http://vignette3.wikia.nocookie.net/osugame/images/c/c9/Logo.png/revision/latest?cb=20151219073209')
.addField('**Level:**', .setURL('https://osu.ppy.sh/')
response.body[0].level, true) .addField('**Username:**',
.addField('**Accuracy**', response.body[0].username, true)
response.body[0].accuracy, true) .addField('**ID:**',
.addField('**Rank:**', response.body[0].user_id, true)
response.body[0].pp_rank, true) .addField('**Level:**',
.addField('**Play Count:**', response.body[0].level, true)
response.body[0].playcount, true) .addField('**Accuracy**',
.addField('**Country:**', response.body[0].accuracy, true)
response.body[0].country, true) .addField('**Rank:**',
.addField('**Ranked Score:**', response.body[0].pp_rank, true)
response.body[0].ranked_score, true) .addField('**Play Count:**',
.addField('**Total Score:**', response.body[0].playcount, true)
response.body[0].total_score, true) .addField('**Country:**',
.addField('**SS:**', response.body[0].country, true)
response.body[0].count_rank_ss, true) .addField('**Ranked Score:**',
.addField('**S:**', response.body[0].ranked_score, true)
response.body[0].count_rank_s, true) .addField('**Total Score:**',
.addField('**A:**', response.body[0].total_score, true)
response.body[0].count_rank_a, true); .addField('**SS:**',
message.channel.sendEmbed(embed).catch(console.error); response.body[0].count_rank_ss, true)
} .addField('**S:**',
}).catch(function (err) { response.body[0].count_rank_s, true)
message.channel.send(":x: Error! User not Found!"); .addField('**A:**',
}); response.body[0].count_rank_a, true);
message.channel.sendEmbed(embed).catch(console.error);
}
}).catch(function(err) {
message.channel.send(":x: Error! User not Found!");
});
} }
}; };
+1261 -1261
View File
File diff suppressed because it is too large Load Diff
+16 -15
View File
@@ -3,7 +3,7 @@ const Discord = require('discord.js');
const pokedex = require('./pkdex.json'); const pokedex = require('./pkdex.json');
module.exports = class PokedexCommand extends commando.Command { module.exports = class PokedexCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'pokedex', name: 'pokedex',
aliases: [ aliases: [
@@ -17,26 +17,27 @@ module.exports = class PokedexCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { if (message.channel.type !== 'dm') {
if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let pokemon = message.content.toLowerCase().split(" ").slice(1).join(" "); let pokemon = message.content.toLowerCase().split(" ").slice(1).join(" ");
if (pokedex.name[pokemon]) { if (pokedex.name[pokemon]) {
const embed = new Discord.RichEmbed() const embed = new Discord.RichEmbed()
.setTitle('Information') .setTitle('Information')
.setAuthor('#' + pokedex.index[pokemon] + " " + pokedex.name[pokemon], 'http://www.serebii.net/pokedex-sm/icon/' + pokedex.index[pokemon] + '.png') .setAuthor('#' + pokedex.index[pokemon] + " " + pokedex.name[pokemon], 'http://www.serebii.net/pokedex-sm/icon/' + pokedex.index[pokemon] + '.png')
.setColor(0xFF0000) .setColor(0xFF0000)
.setDescription(pokedex.species[pokemon]) .setDescription(pokedex.species[pokemon])
.setFooter("Pokédex", "http://cdn.bulbagarden.net/upload/thumb/3/36/479Rotom-Pokédex.png/250px-479Rotom-Pokédex.png") .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') .setThumbnail('http://www.serebii.net/sunmoon/pokemon/' + pokedex.index[pokemon] + '.png')
.addField('Entry', .addField('Entry',
pokedex.entry[pokemon]) pokedex.entry[pokemon])
.addField('Type', .addField('Type',
pokedex.type[pokemon]); pokedex.type[pokemon]);
message.channel.sendEmbed(embed).catch(console.error); message.channel.sendEmbed(embed).catch(console.error);
} else { }
else {
message.channel.send(":x: This Pokémon either doesn't exist, or isn't implemented yet."); message.channel.send(":x: This Pokémon either doesn't exist, or isn't implemented yet.");
} }
} }
}; };
+24 -21
View File
@@ -3,7 +3,7 @@ const Discord = require('discord.js');
const urban = require('urban'); const urban = require('urban');
module.exports = class UrbanDictionary extends commando.Command { module.exports = class UrbanDictionary extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'urban', name: 'urban',
aliases: [ aliases: [
@@ -17,37 +17,40 @@ module.exports = class UrbanDictionary extends commando.Command {
examples: [';urban Cat'] examples: [';urban Cat']
}); });
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { 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'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let wordToDefine = message.content.split(" ").slice(1).join(" "); let wordToDefine = message.content.split(" ").slice(1).join(" ");
urban(wordToDefine).first(function(response) { urban(wordToDefine).first(function(response) {
if(response === undefined) { if (response === undefined) {
message.channel.send(":x: Error! Word not found!"); message.channel.send(":x: Error! Word not found!");
} else if(response.definition === '') { }
else if (response.definition === '') {
message.channel.send(":x: Error! Word has no definition!"); message.channel.send(":x: Error! Word has no definition!");
} else if(response.example !== '') { }
else if (response.example !== '') {
const embed = new Discord.RichEmbed() const embed = new Discord.RichEmbed()
.setColor(0x32a8f0) .setColor(0x32a8f0)
.setAuthor('Urban Dictionary', 'http://a1.mzstatic.com/eu/r30/Purple71/v4/66/54/68/6654683f-cacd-4a55-1784-f14257f77874/icon175x175.png') .setAuthor('Urban Dictionary', 'http://a1.mzstatic.com/eu/r30/Purple71/v4/66/54/68/6654683f-cacd-4a55-1784-f14257f77874/icon175x175.png')
.setURL(response.permalink) .setURL(response.permalink)
.setTitle(response.word) .setTitle(response.word)
.setDescription(response.definition.substr(0, 1900) + ' [Read the Rest Here!](' + response.permalink + ')') .setDescription(response.definition.substr(0, 1900) + ' [Read the Rest Here!](' + response.permalink + ')')
.addField('**Example:**', .addField('**Example:**',
response.example.substr(0, 1900)); response.example.substr(0, 1900));
message.channel.sendEmbed(embed).catch(console.error); message.channel.sendEmbed(embed).catch(console.error);
} else { }
else {
const embed = new Discord.RichEmbed() const embed = new Discord.RichEmbed()
.setColor(0x32a8f0) .setColor(0x32a8f0)
.setAuthor('Urban Dictionary', 'http://a1.mzstatic.com/eu/r30/Purple71/v4/66/54/68/6654683f-cacd-4a55-1784-f14257f77874/icon175x175.png') .setAuthor('Urban Dictionary', 'http://a1.mzstatic.com/eu/r30/Purple71/v4/66/54/68/6654683f-cacd-4a55-1784-f14257f77874/icon175x175.png')
.setURL(response.permalink) .setURL(response.permalink)
.setTitle(response.word) .setTitle(response.word)
.setDescription(response.definition.substr(0, 1900) + ' [Read the Rest Here!](' + response.permalink + ')'); .setDescription(response.definition.substr(0, 1900) + ' [Read the Rest Here!](' + response.permalink + ')');
message.channel.sendEmbed(embed).catch(console.error); message.channel.sendEmbed(embed).catch(console.error);
} }
}); });
} }
}; };
+35 -30
View File
@@ -4,7 +4,7 @@ const request = require('superagent');
const config = require('../../config.json'); const config = require('../../config.json');
module.exports = class WattpadCommand extends commando.Command { module.exports = class WattpadCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'wattpad', name: 'wattpad',
group: 'search', group: 'search',
@@ -15,37 +15,42 @@ module.exports = class WattpadCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { if (message.channel.type !== 'dm') {
if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let queryBook = message.content.split(" ").slice(1).join(" "); let queryBook = message.content.split(" ").slice(1).join(" ");
request request
.get('https://api.wattpad.com:443/v4/stories') .get('https://api.wattpad.com:443/v4/stories')
.set({ 'Authorization': 'Basic ' + config.wattpadkey }) .set({
.query({ query: queryBook, limit: 1 }) 'Authorization': 'Basic ' + config.wattpadkey
.then(function (response) { })
const embed = new Discord.RichEmbed() .query({
.setColor(0xF89C34) query: queryBook,
.setAuthor('Wattpad', 'http://www.selfpubtoolbox.com/wp-content/uploads/2015/05/a6044fd3a88acd5043860484db972ca6.png') limit: 1
.setURL(response.body.stories[0].url) })
.setTitle(response.body.stories[0].title) .then(function(response) {
.setDescription(response.body.stories[0].description.substr(0, 1500) + " [Read the Rest Here!](" + response.body.stories[0].url + ")") const embed = new Discord.RichEmbed()
.addField('**Author:**', .setColor(0xF89C34)
response.body.stories[0].user, true) .setAuthor('Wattpad', 'http://www.selfpubtoolbox.com/wp-content/uploads/2015/05/a6044fd3a88acd5043860484db972ca6.png')
.addField('**Parts:**', .setURL(response.body.stories[0].url)
response.body.stories[0].numParts, true) .setTitle(response.body.stories[0].title)
.addField('**Created On:**', .setDescription(response.body.stories[0].description.substr(0, 1500) + " [Read the Rest Here!](" + response.body.stories[0].url + ")")
response.body.stories[0].createDate, true) .addField('**Author:**',
.addField('**Votes:**', response.body.stories[0].user, true)
response.body.stories[0].voteCount, true) .addField('**Parts:**',
.addField('**Reads:**', response.body.stories[0].numParts, true)
response.body.stories[0].readCount, true) .addField('**Created On:**',
.addField('**Comments:**', response.body.stories[0].createDate, true)
response.body.stories[0].commentCount, true); .addField('**Votes:**',
message.channel.sendEmbed(embed).catch(console.error); response.body.stories[0].voteCount, true)
}).catch(function (err) { .addField('**Reads:**',
message.channel.send(":x: Error! Book not Found!"); response.body.stories[0].readCount, true)
}); .addField('**Comments:**',
response.body.stories[0].commentCount, true);
message.channel.sendEmbed(embed).catch(console.error);
}).catch(function(err) {
message.channel.send(":x: Error! Book not Found!");
});
} }
}; };
+32 -32
View File
@@ -3,7 +3,7 @@ const Discord = require('discord.js');
const weather = require('yahoo-weather'); const weather = require('yahoo-weather');
module.exports = class WeatherCommand extends commando.Command { module.exports = class WeatherCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'weather', name: 'weather',
group: 'search', group: 'search',
@@ -14,44 +14,44 @@ module.exports = class WeatherCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { if (message.channel.type !== 'dm') {
if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let locationToSearch = message.content.split(" ").slice(1).join(" "); let locationToSearch = message.content.split(" ").slice(1).join(" ");
weather(locationToSearch, 'f').then(info => { weather(locationToSearch, 'f').then(info => {
const embed = new Discord.RichEmbed() const embed = new Discord.RichEmbed()
.setColor(0x0000FF) .setColor(0x0000FF)
.setAuthor(info.title, 'http://media.idownloadblog.com/wp-content/uploads/2013/12/yahoo-weather-213x220.png') .setAuthor(info.title, 'http://media.idownloadblog.com/wp-content/uploads/2013/12/yahoo-weather-213x220.png')
.setURL(info.link) .setURL(info.link)
.setTimestamp() .setTimestamp()
.addField('**City:**', .addField('**City:**',
info.location.city, true) info.location.city, true)
.addField('**Country**', .addField('**Country**',
info.location.country, true) info.location.country, true)
.addField('**Region:**', .addField('**Region:**',
info.location.region, true) info.location.region, true)
.addField('**Condition:**', .addField('**Condition:**',
info.item.condition.text, true) info.item.condition.text, true)
.addField('**Temperature:**', .addField('**Temperature:**',
info.item.condition.temp + "°F", true) info.item.condition.temp + "°F", true)
.addField('**Humidity:**', .addField('**Humidity:**',
info.atmosphere.humidity, true) info.atmosphere.humidity, true)
.addField('**Pressure:**', .addField('**Pressure:**',
info.atmosphere.pressure, true) info.atmosphere.pressure, true)
.addField('**Rising:**', .addField('**Rising:**',
info.atmosphere.rising, true) info.atmosphere.rising, true)
.addField('**Visibility:**', .addField('**Visibility:**',
info.atmosphere.visibility, true) info.atmosphere.visibility, true)
.addField('**Wind Chill:**', .addField('**Wind Chill:**',
info.wind.chill, true) info.wind.chill, true)
.addField('**Wind Direction:**', .addField('**Wind Direction:**',
info.wind.direction, true) info.wind.direction, true)
.addField('**Wind Speed:**', .addField('**Wind Speed:**',
info.wind.speed, true); info.wind.speed, true);
message.channel.sendEmbed(embed).catch(console.error); message.channel.sendEmbed(embed).catch(console.error);
}).catch(err => { }).catch(err => {
message.channel.send(":x: Error! Make sure you typed the location correctly!"); message.channel.send(":x: Error! Make sure you typed the location correctly!");
}); });
} }
}; };
+25 -24
View File
@@ -3,7 +3,7 @@ const Discord = require('discord.js');
const request = require('superagent'); const request = require('superagent');
module.exports = class WikipediaCommand extends commando.Command { module.exports = class WikipediaCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'wikipedia', name: 'wikipedia',
group: 'search', group: 'search',
@@ -14,32 +14,33 @@ module.exports = class WikipediaCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { if (message.channel.type !== 'dm') {
if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let thingToSearch = encodeURI(message.content.split(" ").slice(1).join(" ")); let thingToSearch = encodeURI(message.content.split(" ").slice(1).join(" "));
request request
.get("https://en.wikipedia.org/w/api.php?action=query&prop=extracts&format=json&titles=" + thingToSearch + "&exintro=&explaintext=&redirects=&formatversion=2") .get("https://en.wikipedia.org/w/api.php?action=query&prop=extracts&format=json&titles=" + thingToSearch + "&exintro=&explaintext=&redirects=&formatversion=2")
.then(function (response) { .then(function(response) {
let description = response.body.query.pages[0].extract; let description = response.body.query.pages[0].extract;
let name = response.body.query.pages[0].title; let name = response.body.query.pages[0].title;
thingToSearch = thingToSearch.split(")").join("%29"); thingToSearch = thingToSearch.split(")").join("%29");
if(description === undefined) { if (description === undefined) {
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 + ")");
message.channel.sendEmbed(embed).catch(console.error);
}
}).catch(function(err) {
message.channel.send(":x: Error! Entry Not Found!"); 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 + ")");
message.channel.sendEmbed(embed).catch(console.error);
}
}).catch(function (err) {
message.channel.send(":x: Error! Entry Not Found!");
});
} }
}; };
+29 -22
View File
@@ -4,7 +4,7 @@ const request = require('superagent');
const config = require('../../config.json'); const config = require('../../config.json');
module.exports = class YouTubeCommand extends commando.Command { module.exports = class YouTubeCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'youtube', name: 'youtube',
aliases: [ aliases: [
@@ -18,29 +18,36 @@ module.exports = class YouTubeCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { if (message.channel.type !== 'dm') {
if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let videoToSearch = message.content.split(" ").slice(1).join("-"); let videoToSearch = message.content.split(" ").slice(1).join("-");
request request
.get('https://www.googleapis.com/youtube/v3/search') .get('https://www.googleapis.com/youtube/v3/search')
.query({ part: 'snippet', type: 'video', maxResults: 1, q: videoToSearch, key: config.youtubekey }) .query({
.then(function (response) { part: 'snippet',
if(response.body.items[0].snippet === undefined) { type: 'video',
message.channel.send(':x: Error! No Video Found!'); maxResults: 1,
} else { q: videoToSearch,
const embed = new Discord.RichEmbed() key: config.youtubekey
.setColor(0xDD2825) })
.setTitle(response.body.items[0].snippet.title) .then(function(response) {
.setDescription(response.body.items[0].snippet.description) if (response.body.items[0].snippet === undefined) {
.setAuthor('YouTube - ' + response.body.items[0].snippet.channelTitle, 'https://cdn3.iconfinder.com/data/icons/social-icons-5/607/YouTube_Play.png') message.channel.send(':x: Error! No Video Found!');
.setURL('https://www.youtube.com/watch?v=' + response.body.items[0].id.videoId) }
.setThumbnail(response.body.items[0].snippet.thumbnails.default.url); else {
message.channel.sendEmbed(embed).catch(console.error); const embed = new Discord.RichEmbed()
} .setColor(0xDD2825)
}).catch(function (err) { .setTitle(response.body.items[0].snippet.title)
message.channel.send(":x: Error! An error has occurred! Try again (if this continues to occur, the daily quota may have been reached)."); .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);
message.channel.sendEmbed(embed).catch(console.error);
}
}).catch(function(err) {
message.channel.send(":x: Error! An error has occurred! Try again (if this continues to occur, the daily quota may have been reached).");
});
} }
}; };
+39 -38
View File
@@ -3,7 +3,7 @@ const Discord = require('discord.js');
const request = require('superagent'); const request = require('superagent');
module.exports = class YuGiOhCommand extends commando.Command { module.exports = class YuGiOhCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'yugioh', name: 'yugioh',
group: 'search', group: 'search',
@@ -14,45 +14,46 @@ module.exports = class YuGiOhCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { if (message.channel.type !== 'dm') {
if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let cardName = encodeURI(message.content.split(" ").slice(1).join(" ")); let cardName = encodeURI(message.content.split(" ").slice(1).join(" "));
request request
.get('http://yugiohprices.com/api/card_data/' + cardName) .get('http://yugiohprices.com/api/card_data/' + cardName)
.then(function (response) { .then(function(response) {
if(response.body.data.card_type === 'monster') { if (response.body.data.card_type === 'monster') {
const embed = new Discord.RichEmbed() const embed = new Discord.RichEmbed()
.setColor(0xBE5F1F) .setColor(0xBE5F1F)
.setTitle(response.body.data.name) .setTitle(response.body.data.name)
.setDescription(response.body.data.text) .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') .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:**', .addField('**Card Type:**',
response.body.data.card_type, true) response.body.data.card_type, true)
.addField('**Species:**', .addField('**Species:**',
response.body.data.type, true) response.body.data.type, true)
.addField('**Attribute:**', .addField('**Attribute:**',
response.body.data.family, true) response.body.data.family, true)
.addField('**ATK:**', .addField('**ATK:**',
response.body.data.atk, true) response.body.data.atk, true)
.addField('**DEF:**', .addField('**DEF:**',
response.body.data.def, true) response.body.data.def, true)
.addField('**Level:**', .addField('**Level:**',
response.body.data.level, true); response.body.data.level, true);
message.channel.sendEmbed(embed).catch(console.error); message.channel.sendEmbed(embed).catch(console.error);
} else { }
const embed = new Discord.RichEmbed() else {
.setColor(0xBE5F1F) const embed = new Discord.RichEmbed()
.setTitle(response.body.data.name) .setColor(0xBE5F1F)
.setDescription(response.body.data.text) .setTitle(response.body.data.name)
.setAuthor('Yu-Gi-Oh!', 'http://vignette3.wikia.nocookie.net/yugioh/images/1/10/Back-TF-EN-VG.png/revision/latest?cb=20120824043558') .setDescription(response.body.data.text)
.addField('**Card Type:**', .setAuthor('Yu-Gi-Oh!', 'http://vignette3.wikia.nocookie.net/yugioh/images/1/10/Back-TF-EN-VG.png/revision/latest?cb=20120824043558')
response.body.data.card_type, true); .addField('**Card Type:**',
message.channel.sendEmbed(embed).catch(console.error); response.body.data.card_type, true);
} message.channel.sendEmbed(embed).catch(console.error);
}).catch(function (err) { }
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!"); }).catch(function(err) {
}); 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!");
});
} }
}; };
+4 -4
View File
@@ -2,7 +2,7 @@ const commando = require('discord.js-commando');
const stringToBinary = require('string-to-binary'); const stringToBinary = require('string-to-binary');
module.exports = class BinaryCommand extends commando.Command { module.exports = class BinaryCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'binary', name: 'binary',
group: 'textedit', group: 'textedit',
@@ -13,11 +13,11 @@ module.exports = class BinaryCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { 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'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let turnToBinary = message.content.split(" ").slice(1).join(" "); let turnToBinary = message.content.split(" ").slice(1).join(" ");
message.channel.send(stringToBinary(turnToBinary)).catch(error => message.channel.send(':x: Error! Translation is too long, or nothing was entered!')); message.channel.send(stringToBinary(turnToBinary)).catch(error => message.channel.send(':x: Error! Translation is too long, or nothing was entered!'));
} }
}; };
+10 -9
View File
@@ -2,7 +2,7 @@ const commando = require('discord.js-commando');
const cowsay = require('cowsay'); const cowsay = require('cowsay');
module.exports = class CowsayCommand extends commando.Command { module.exports = class CowsayCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'cowsay', name: 'cowsay',
group: 'textedit', group: 'textedit',
@@ -13,21 +13,22 @@ module.exports = class CowsayCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { 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'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
if(message.content.split(" ").slice(1).join(" ") === "") { if (message.content.split(" ").slice(1).join(" ") === "") {
message.channel.send(":x: Error! You entered nothing!"); message.channel.send(":x: Error! You entered nothing!");
} else { }
else {
let turnToCowsay = message.content.split(" ").slice(1).join(" "); let turnToCowsay = message.content.split(" ").slice(1).join(" ");
message.channel.sendCode(null, cowsay.say({ message.channel.sendCode(null, cowsay.say({
text : turnToCowsay, text: turnToCowsay,
e : "oO", e: "oO",
T : "U " T: "U "
})).catch(error => { })).catch(error => {
message.channel.send(':x: Error! Perhaps the content is too long?'); message.channel.send(':x: Error! Perhaps the content is too long?');
}); });
} }
} }
}; };
+11 -10
View File
@@ -2,7 +2,7 @@ const commando = require('discord.js-commando');
const Discord = require('discord.js'); const Discord = require('discord.js');
module.exports = class EmbedCommand extends commando.Command { module.exports = class EmbedCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'embed', name: 'embed',
group: 'textedit', group: 'textedit',
@@ -13,22 +13,23 @@ module.exports = class EmbedCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { if (message.channel.type !== 'dm') {
if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let embedMessage = message.content.split(" ").slice(1).join(" "); let embedMessage = message.content.split(" ").slice(1).join(" ");
if(embedMessage === "") { if (embedMessage === "") {
message.channel.send(":x: Error! Nothing to embed!"); message.channel.send(":x: Error! Nothing to embed!");
} else { }
else {
const embed = new Discord.RichEmbed() const embed = new Discord.RichEmbed()
.setAuthor(message.author.username, message.author.avatarURL) .setAuthor(message.author.username, message.author.avatarURL)
.setColor(0x00AE86) .setColor(0x00AE86)
.setTimestamp() .setTimestamp()
.setDescription(embedMessage); .setDescription(embedMessage);
message.channel.sendEmbed(embed).catch(console.error); message.channel.sendEmbed(embed).catch(console.error);
if (message.channel.type === 'dm') return; if (message.channel.type === 'dm') return;
message.delete(); message.delete();
} }
} }
}; };
+1 -1
View File
@@ -105,4 +105,4 @@
"yo": "Yoruba", "yo": "Yoruba",
"zu": "Zulu" "zu": "Zulu"
} }
} }
+11 -8
View File
@@ -2,7 +2,7 @@ const commando = require('discord.js-commando');
const morse = require('morse'); const morse = require('morse');
module.exports = class MorseCommand extends commando.Command { module.exports = class MorseCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'morse', name: 'morse',
aliases: [ aliases: [
@@ -16,20 +16,23 @@ module.exports = class MorseCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { 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'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let [methodToUse] = message.content.toLowerCase().split(" ").slice(1); let [methodToUse] = message.content.toLowerCase().split(" ").slice(1);
let toMorse = message.content.split(" ").slice(2).join(" "); let toMorse = message.content.split(" ").slice(2).join(" ");
if(toMorse === "") { if (toMorse === "") {
message.channel.send(":x: Error! Nothing to translate! Perhaps you forgot to set the method? Use either encode or decode before your text."); 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') { }
else if (methodToUse === 'encode') {
message.channel.send(morse.encode(toMorse)).catch(error => message.channel.send(':x: Error! Something went wrong! Perhaps you entered incorrect text?')); 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') { }
else if (methodToUse === 'decode') {
message.channel.send(morse.decode(toMorse)).catch(error => message.channel.send(':x: Error! Something went wrong! Perhaps you entered incorrect text?')); message.channel.send(morse.decode(toMorse)).catch(error => message.channel.send(':x: Error! Something went wrong! Perhaps you entered incorrect text?'));
} else { }
else {
message.channel.send(":x: Error! Method not set/not correct! Use either encode or decode."); message.channel.send(":x: Error! Method not set/not correct! Use either encode or decode.");
} }
} }
}; };
+10 -8
View File
@@ -2,7 +2,7 @@ const commando = require('discord.js-commando');
const pirateSpeak = require('pirate-speak'); const pirateSpeak = require('pirate-speak');
module.exports = class PirateCommand extends commando.Command { module.exports = class PirateCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'pirate', name: 'pirate',
aliases: [ aliases: [
@@ -17,20 +17,22 @@ module.exports = class PirateCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { 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'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let turnToPirate = message.content.split(" ").slice(1).join(" "); let turnToPirate = message.content.split(" ").slice(1).join(" ");
let pirate = pirateSpeak.translate(turnToPirate); let pirate = pirateSpeak.translate(turnToPirate);
if(turnToPirate === "") { if (turnToPirate === "") {
message.channel.send(":x: Error! Nothing to translate!"); message.channel.send(":x: Error! Nothing to translate!");
} else { }
if(pirate.length > 1950) { else {
if (pirate.length > 1950) {
message.channel.send(":x: Error! Your message is too long!"); message.channel.send(":x: Error! Your message is too long!");
} else { }
else {
message.channel.send(pirate); message.channel.send(pirate);
} }
} }
} }
}; };
+7 -6
View File
@@ -1,7 +1,7 @@
const commando = require('discord.js-commando'); const commando = require('discord.js-commando');
module.exports = class ReverseCommand extends commando.Command { module.exports = class ReverseCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'reverse', name: 'reverse',
group: 'textedit', group: 'textedit',
@@ -12,16 +12,17 @@ module.exports = class ReverseCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { 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'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let stringToReverse = message.content.split(" ").slice(1).join(" "); let stringToReverse = message.content.split(" ").slice(1).join(" ");
if(stringToReverse === "") { if (stringToReverse === "") {
message.channel.send(":x: Error! Nothing to reverse!"); message.channel.send(":x: Error! Nothing to reverse!");
} else { }
else {
let reversed = stringToReverse.split("").reverse().join(""); let reversed = stringToReverse.split("").reverse().join("");
message.channel.send(reversed); message.channel.send(reversed);
} }
} }
}; };
+18 -16
View File
@@ -3,7 +3,7 @@ const request = require('superagent');
const config = require('../../config.json'); const config = require('../../config.json');
module.exports = class RinSayCommand extends commando.Command { module.exports = class RinSayCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'rin', name: 'rin',
aliases: [ aliases: [
@@ -15,25 +15,27 @@ module.exports = class RinSayCommand extends commando.Command {
examples: [";rin Hey guys!"] examples: [";rin Hey guys!"]
}); });
} }
hasPermission(msg) { hasPermission(msg) {
return this.client.isOwner(msg.author); return this.client.isOwner(msg.author);
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { 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'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let rinContent = message.content.split(" ").slice(1).join(" "); let rinContent = message.content.split(" ").slice(1).join(" ");
request request
.post(config.webhook) .post(config.webhook)
.send({ content: rinContent }) .send({
.then(function (parsedBody) { content: rinContent
if(message.content.type === 'dm') return; })
message.delete(); .then(function(parsedBody) {
}).catch(function (err) { if (message.content.type === 'dm') return;
message.channel.send(':x: Error! Message failed to send! Check the logs for details.'); message.delete();
console.log(err); }).catch(function(err) {
}); message.channel.send(':x: Error! Message failed to send! Check the logs for details.');
console.log(err);
});
} }
}; };
+10 -8
View File
@@ -2,7 +2,7 @@ const commando = require('discord.js-commando');
const hepburn = require('hepburn'); const hepburn = require('hepburn');
module.exports = class RomajiCommand extends commando.Command { module.exports = class RomajiCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'romaji', name: 'romaji',
aliases: [ aliases: [
@@ -16,20 +16,22 @@ module.exports = class RomajiCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { 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'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let romajify = message.content.split(" ").slice(1).join(" "); let romajify = message.content.split(" ").slice(1).join(" ");
if(hepburn.containsKana(romajify)) { if (hepburn.containsKana(romajify)) {
let romajified = hepburn.fromKana(romajify); let romajified = hepburn.fromKana(romajify);
if(romajified.length > 1950) { if (romajified.length > 1950) {
message.channel.send(":x: Error! Your message is too long!"); message.channel.send(":x: Error! Your message is too long!");
} else { }
else {
message.channel.send(romajified); message.channel.send(romajified);
} }
} else { }
else {
message.channel.send(":x: Error! Message contains no Kana!\n:notepad_spiral: Note: You cannot use this command on Kanji!"); message.channel.send(":x: Error! Message contains no Kana!\n:notepad_spiral: Note: You cannot use this command on Kanji!");
} }
} }
}; };
+7 -6
View File
@@ -1,7 +1,7 @@
const commando = require('discord.js-commando'); const commando = require('discord.js-commando');
module.exports = class SayCommand extends commando.Command { module.exports = class SayCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'say', name: 'say',
aliases: [ aliases: [
@@ -17,17 +17,18 @@ module.exports = class SayCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { 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'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let copycat = message.content.split(" ").slice(1).join(" "); let copycat = message.content.split(" ").slice(1).join(" ");
if(copycat === "") { if (copycat === "") {
message.channel.send(":x: Error! Nothing to say!"); message.channel.send(":x: Error! Nothing to say!");
} else { }
else {
message.channel.send(copycat); message.channel.send(copycat);
if (message.channel.type === 'dm') return; if (message.channel.type === 'dm') return;
message.delete(); message.delete();
} }
} }
}; };
+3 -2
View File
@@ -150,7 +150,8 @@ function translator(text) {
let character = text[i]; let character = text[i];
if (isLetter(character)) { if (isLetter(character)) {
word += character; word += character;
} else { }
else {
if (word != "") { if (word != "") {
let wordTranslate = translateWord(word); let wordTranslate = translateWord(word);
translatedText += wordTranslate; translatedText += wordTranslate;
@@ -168,7 +169,7 @@ function translator(text) {
const temmize = function(text) { const temmize = function(text) {
let currentTranslation = translator(text); let currentTranslation = translator(text);
let temmify = currentTranslation.split("ing").join("in").split("!").join("!!!!111!11!1!!!1!!!1111!").split("'").join(""); let temmify = currentTranslation.split("ing").join("in").split("!").join("!!!!111!11!1!!!1!!!1111!").split("'").join("");
return temmify; return temmify;
}; };
+22 -16
View File
@@ -4,7 +4,7 @@ const translate = require('google-translate-api');
const languages = require('./languages.json'); const languages = require('./languages.json');
module.exports = class TranslateCommand extends commando.Command { module.exports = class TranslateCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'translate', name: 'translate',
group: 'textedit', group: 'textedit',
@@ -15,35 +15,41 @@ module.exports = class TranslateCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { if (message.channel.type !== 'dm') {
if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let [languageto] = message.content.toLowerCase().split(" ").slice(1); let [languageto] = message.content.toLowerCase().split(" ").slice(1);
let thingToTranslate = message.content.split(" ").slice(2).join(" "); let thingToTranslate = message.content.split(" ").slice(2).join(" ");
if(languageto === "list") { if (languageto === "list") {
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'"); 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'");
} else if(languages.entries[languageto]) { }
if(thingToTranslate === "") { else if (languages.entries[languageto]) {
if (thingToTranslate === "") {
message.channel.send(":x: Error! Nothing to translate!"); message.channel.send(":x: Error! Nothing to translate!");
} else if(thingToTranslate.length > 200) { }
else if (thingToTranslate.length > 200) {
message.channel.send(":x: Error! Please keep translations below 200 characters!"); message.channel.send(":x: Error! Please keep translations below 200 characters!");
} else { }
translate(thingToTranslate, {to: languageto}).then(res => { else {
translate(thingToTranslate, {
to: languageto
}).then(res => {
let languagefrom = res.from.language.iso.toLowerCase(); let languagefrom = res.from.language.iso.toLowerCase();
const embed = new Discord.RichEmbed() const embed = new Discord.RichEmbed()
.setColor(0x00AE86) .setColor(0x00AE86)
.addField('Input (From: ' + languages.entries[languagefrom] + '):', .addField('Input (From: ' + languages.entries[languagefrom] + '):',
thingToTranslate) thingToTranslate)
.addField('Translation (To: ' + languages.entries[languageto] + '):', .addField('Translation (To: ' + languages.entries[languageto] + '):',
res.text); res.text);
message.channel.sendEmbed(embed).catch(console.error); message.channel.sendEmbed(embed).catch(console.error);
}).catch(err => { }).catch(err => {
message.channel.send(":x: Error! Something went wrong!"); message.channel.send(":x: Error! Something went wrong!");
}); });
} }
} else { }
else {
message.channel.send(":x: Error! Language not found! Use `;translate list` to view a list of translate codes!"); message.channel.send(":x: Error! Language not found! Use `;translate list` to view a list of translate codes!");
} }
} }
}; };
+25 -18
View File
@@ -3,7 +3,7 @@ const request = require('superagent');
const config = require('../../config.json'); const config = require('../../config.json');
module.exports = class YodaCommand extends commando.Command { module.exports = class YodaCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'yoda', name: 'yoda',
group: 'textedit', group: 'textedit',
@@ -14,27 +14,34 @@ module.exports = class YodaCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { 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'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let turnToYoda = message.content.split(" ").slice(1).join(" "); let turnToYoda = message.content.split(" ").slice(1).join(" ");
if(turnToYoda === "") { if (turnToYoda === "") {
message.channel.send(':x: Error! Nothing to translate!'); message.channel.send(':x: Error! Nothing to translate!');
} else { }
else {
request request
.get('https://yoda.p.mashape.com/yoda') .get('https://yoda.p.mashape.com/yoda')
.set({ 'X-Mashape-Key': config.mashapekey, 'Accept': 'text/plain' }) .set({
.query({ sentence: turnToYoda }) 'X-Mashape-Key': config.mashapekey,
.then(function (response) { 'Accept': 'text/plain'
if(response === undefined) { })
message.channel.send(':x: Error! Something went wrong! Keep it simple to avoid this error.'); .query({
} else { sentence: turnToYoda
message.channel.send(response.text).catch(error => message.channel.send(':x: Error! Something went wrong! Keep it simple to avoid this error.')); })
} .then(function(response) {
}).catch(function (err) { if (response === undefined) {
message.channel.send(":x: Error! Unknown Error. Try again later!"); message.channel.send(':x: Error! Something went wrong! Keep it simple to avoid this error.');
}); }
else {
message.channel.send(response.text).catch(error => message.channel.send(':x: Error! Something went wrong! Keep it simple to avoid this error.'));
}
}).catch(function(err) {
message.channel.send(":x: Error! Unknown Error. Try again later!");
});
} }
} }
}; };
+9 -7
View File
@@ -2,7 +2,7 @@ const commando = require('discord.js-commando');
const zalgo = require('zalgolize'); const zalgo = require('zalgolize');
module.exports = class ZalgoCommand extends commando.Command { module.exports = class ZalgoCommand extends commando.Command {
constructor(Client){ constructor(Client) {
super(Client, { super(Client, {
name: 'zalgo', name: 'zalgo',
group: 'textedit', group: 'textedit',
@@ -13,17 +13,19 @@ module.exports = class ZalgoCommand extends commando.Command {
} }
async run(message) { async run(message) {
if(message.channel.type !== 'dm') { 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'])) return;
} }
console.log("[Command] " + message.content); console.log("[Command] " + message.content);
let zalgoified = zalgo(message.content.split(" ").slice(1).join(" ")); let zalgoified = zalgo(message.content.split(" ").slice(1).join(" "));
if(zalgoified === '') { if (zalgoified === '') {
message.channel.send(":x: Error! Nothing to zalgoify!"); message.channel.send(":x: Error! Nothing to zalgoify!");
} else if(zalgoified.length > 1950) { }
else if (zalgoified.length > 1950) {
message.channel.send(":x: Error! Your message is too long!"); message.channel.send(":x: Error! Your message is too long!");
} else { }
else {
message.channel.send(zalgoified); message.channel.send(zalgoified);
} }
} }
}; };

Some files were not shown because too many files have changed in this diff Show More