mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-15 00:12:38 +02:00
updoot
This commit is contained in:
@@ -1,57 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const Canvas = require('canvas');
|
||||
const snekfetch = require('snekfetch');
|
||||
const { promisifyAll } = require('tsubaki');
|
||||
const fs = promisifyAll(require('fs'));
|
||||
const path = require('path');
|
||||
|
||||
module.exports = class YearsCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: '3000-years',
|
||||
aliases: ['az', '3ky', '3k-years'],
|
||||
group: 'avatar-edit',
|
||||
memberName: '3000-years',
|
||||
description: 'Draws a user\'s avatar over Pokémon\'s "It\'s been 3000 years" meme.',
|
||||
throttling: {
|
||||
usages: 1,
|
||||
duration: 30
|
||||
},
|
||||
clientPermissions: ['ATTACH_FILES'],
|
||||
args: [
|
||||
{
|
||||
key: 'user',
|
||||
prompt: 'Which user would you like to edit the avatar of?',
|
||||
type: 'user',
|
||||
default: ''
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const user = args.user || msg.author;
|
||||
const avatarURL = user.displayAvatarURL({
|
||||
format: 'png',
|
||||
size: 256
|
||||
});
|
||||
try {
|
||||
const Image = Canvas.Image;
|
||||
const canvas = new Canvas(856, 569);
|
||||
const ctx = canvas.getContext('2d');
|
||||
const base = new Image();
|
||||
const avatar = new Image();
|
||||
const generate = () => {
|
||||
ctx.drawImage(base, 0, 0);
|
||||
ctx.drawImage(avatar, 461, 127, 200, 200);
|
||||
};
|
||||
base.src = await fs.readFileAsync(path.join(__dirname, '..', '..', 'assets', 'images', '3000-years.png'));
|
||||
const { body } = await snekfetch.get(avatarURL);
|
||||
avatar.src = body;
|
||||
generate();
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: '3000-years.png' }] });
|
||||
} catch (err) {
|
||||
return msg.say(`Oh no, the image generation failed: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1,58 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const Canvas = require('canvas');
|
||||
const snekfetch = require('snekfetch');
|
||||
const { promisifyAll } = require('tsubaki');
|
||||
const fs = promisifyAll(require('fs'));
|
||||
const path = require('path');
|
||||
|
||||
module.exports = class BeautifulCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'beautiful',
|
||||
aliases: ['grunkle-stan'],
|
||||
group: 'avatar-edit',
|
||||
memberName: 'beautiful',
|
||||
description: 'Draws a user\'s avatar over Gravity Falls\' "Oh, this? This is beautiful." meme.',
|
||||
throttling: {
|
||||
usages: 1,
|
||||
duration: 30
|
||||
},
|
||||
clientPermissions: ['ATTACH_FILES'],
|
||||
args: [
|
||||
{
|
||||
key: 'user',
|
||||
prompt: 'Which user would you like to edit the avatar of?',
|
||||
type: 'user',
|
||||
default: ''
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const user = args.user || msg.author;
|
||||
const avatarURL = user.displayAvatarURL({
|
||||
format: 'png',
|
||||
size: 256
|
||||
});
|
||||
try {
|
||||
const Image = Canvas.Image;
|
||||
const canvas = new Canvas(500, 532);
|
||||
const ctx = canvas.getContext('2d');
|
||||
const base = new Image();
|
||||
const avatar = new Image();
|
||||
const generate = () => {
|
||||
ctx.drawImage(base, 0, 0);
|
||||
ctx.drawImage(avatar, 341, 35, 117, 135);
|
||||
ctx.drawImage(avatar, 343, 301, 117, 135);
|
||||
};
|
||||
base.src = await fs.readFileAsync(path.join(__dirname, '..', '..', 'assets', 'images', 'beautiful.png'));
|
||||
const { body } = await snekfetch.get(avatarURL);
|
||||
avatar.src = body;
|
||||
generate();
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'beautiful.png' }] });
|
||||
} catch (err) {
|
||||
return msg.say(`Oh no, the image generation failed: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1,61 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const Canvas = require('canvas');
|
||||
const snekfetch = require('snekfetch');
|
||||
const { promisifyAll } = require('tsubaki');
|
||||
const fs = promisifyAll(require('fs'));
|
||||
const path = require('path');
|
||||
|
||||
module.exports = class BobRossCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'bob-ross',
|
||||
aliases: ['ross'],
|
||||
group: 'avatar-edit',
|
||||
memberName: 'bob-ross',
|
||||
description: 'Draws a user\'s avatar over Bob Ross\' canvas.',
|
||||
throttling: {
|
||||
usages: 1,
|
||||
duration: 30
|
||||
},
|
||||
clientPermissions: ['ATTACH_FILES'],
|
||||
args: [
|
||||
{
|
||||
key: 'user',
|
||||
prompt: 'Which user would you like to edit the avatar of?',
|
||||
type: 'user',
|
||||
default: ''
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const user = args.user || msg.author;
|
||||
const avatarURL = user.displayAvatarURL({
|
||||
format: 'png',
|
||||
size: 256
|
||||
});
|
||||
try {
|
||||
const Image = Canvas.Image;
|
||||
const canvas = new Canvas(600, 775);
|
||||
const ctx = canvas.getContext('2d');
|
||||
const base = new Image();
|
||||
const avatar = new Image();
|
||||
const generate = () => {
|
||||
ctx.fillStyle = 'white';
|
||||
ctx.fillRect(0, 0, 600, 775);
|
||||
ctx.rotate(3 * Math.PI / 180);
|
||||
ctx.drawImage(avatar, 69, 102, 256, 256);
|
||||
ctx.rotate(-3 * Math.PI / 180);
|
||||
ctx.drawImage(base, 0, 0);
|
||||
};
|
||||
base.src = await fs.readFileAsync(path.join(__dirname, '..', '..', 'assets', 'images', 'bob-ross.png'));
|
||||
const { body } = await snekfetch.get(avatarURL);
|
||||
avatar.src = body;
|
||||
generate();
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'bob-ross.png' }] });
|
||||
} catch (err) {
|
||||
return msg.say(`Oh no, the image generation failed: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1,82 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const Canvas = require('canvas');
|
||||
const snekfetch = require('snekfetch');
|
||||
const moment = require('moment');
|
||||
const { promisifyAll } = require('tsubaki');
|
||||
const fs = promisifyAll(require('fs'));
|
||||
const path = require('path');
|
||||
const { version } = require('../../package');
|
||||
|
||||
module.exports = class CardCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'card',
|
||||
aliases: ['discord-card'],
|
||||
group: 'avatar-edit',
|
||||
memberName: 'card',
|
||||
description: 'Creates a trading card of random rarity based on a user\'s profile.',
|
||||
guildOnly: true,
|
||||
throttling: {
|
||||
usages: 1,
|
||||
duration: 30
|
||||
},
|
||||
clientPermissions: ['ATTACH_FILES'],
|
||||
args: [
|
||||
{
|
||||
key: 'member',
|
||||
prompt: 'Which user would you like to edit the avatar of?',
|
||||
type: 'member',
|
||||
default: ''
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const member = args.member || msg.member;
|
||||
const avatarURL = member.user.displayAvatarURL({
|
||||
format: 'png',
|
||||
size: 256
|
||||
});
|
||||
try {
|
||||
const cardID = Math.floor(Math.random() * (9999 - 1000 + 1)) + 1000;
|
||||
let rarity;
|
||||
if (cardID < 5000) rarity = 'C';
|
||||
else if (cardID < 8000) rarity = 'U';
|
||||
else rarity = 'R';
|
||||
const Image = Canvas.Image;
|
||||
Canvas.registerFont(path.join(__dirname, '..', '..', 'assets', 'fonts', 'Roboto.ttf'), { family: 'Roboto' }); // eslint-disable-line max-len
|
||||
Canvas.registerFont(path.join(__dirname, '..', '..', 'assets', 'fonts', 'NotoEmoji-Regular.ttf'), { family: 'Roboto' }); // eslint-disable-line max-len
|
||||
const canvas = new Canvas(390, 544);
|
||||
const ctx = canvas.getContext('2d');
|
||||
const base = new Image();
|
||||
const avatar = new Image();
|
||||
const generate = () => {
|
||||
ctx.fillStyle = 'white';
|
||||
ctx.fillRect(0, 0, 390, 544);
|
||||
ctx.drawImage(avatar, 11, 11, 370, 370);
|
||||
ctx.drawImage(base, 0, 0);
|
||||
ctx.font = '18px Roboto';
|
||||
ctx.fillStyle = 'black';
|
||||
ctx.fillText(member.displayName, 30, 62);
|
||||
ctx.fillText('Discord Join Date:', 148, 400);
|
||||
ctx.fillText(moment(member.user.createdTimestamp).format('MMMM Do YYYY'), 148, 420);
|
||||
ctx.fillText('Role:', 148, 457);
|
||||
ctx.fillText(member.highestRole.name, 148, 477);
|
||||
ctx.fillText(rarity, 73, 411);
|
||||
ctx.fillText(cardID, 60, 457);
|
||||
ctx.fillText(version.split('.')[0], 68, 502);
|
||||
ctx.font = '14px Roboto';
|
||||
ctx.fillText(member.id, 30, 355);
|
||||
ctx.fillText(`#${member.user.discriminator}`, 313, 355);
|
||||
};
|
||||
base.src = await fs.readFileAsync(path.join(__dirname, '..', '..', 'assets', 'images', 'card.png'));
|
||||
const { body } = await snekfetch.get(avatarURL);
|
||||
avatar.src = body;
|
||||
generate();
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'card.png' }] });
|
||||
} catch (err) {
|
||||
return msg.say(`Oh no, the image generation failed: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1,58 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const Canvas = require('canvas');
|
||||
const snekfetch = require('snekfetch');
|
||||
const { promisifyAll } = require('tsubaki');
|
||||
const fs = promisifyAll(require('fs'));
|
||||
const path = require('path');
|
||||
|
||||
module.exports = class ChallengerCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'challenger',
|
||||
group: 'avatar-edit',
|
||||
memberName: 'challenger',
|
||||
description: 'Draws a user\'s avatar over Super Smash Bros.\'s "Challenger Approaching" screen.',
|
||||
throttling: {
|
||||
usages: 1,
|
||||
duration: 30
|
||||
},
|
||||
clientPermissions: ['ATTACH_FILES'],
|
||||
args: [
|
||||
{
|
||||
key: 'user',
|
||||
prompt: 'Which user would you like to edit the avatar of?',
|
||||
type: 'user',
|
||||
default: ''
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const user = args.user || msg.author;
|
||||
const avatarURL = user.displayAvatarURL({
|
||||
format: 'png',
|
||||
size: 256
|
||||
});
|
||||
try {
|
||||
const Image = Canvas.Image;
|
||||
const canvas = new Canvas(500, 500);
|
||||
const ctx = canvas.getContext('2d');
|
||||
const base = new Image();
|
||||
const avatar = new Image();
|
||||
const generate = () => {
|
||||
ctx.fillStyle = '#ff0028';
|
||||
ctx.fillRect(0, 0, 500, 500);
|
||||
ctx.drawImage(avatar, 226, 155, 200, 200);
|
||||
ctx.drawImage(base, 0, 0);
|
||||
};
|
||||
base.src = await fs.readFileAsync(path.join(__dirname, '..', '..', 'assets', 'images', 'challenger.png'));
|
||||
const { body } = await snekfetch.get(avatarURL);
|
||||
avatar.src = body;
|
||||
generate();
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'challenger.png' }] });
|
||||
} catch (err) {
|
||||
return msg.say(`Oh no, the image generation failed: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1,58 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const Canvas = require('canvas');
|
||||
const snekfetch = require('snekfetch');
|
||||
const { promisifyAll } = require('tsubaki');
|
||||
const fs = promisifyAll(require('fs'));
|
||||
const path = require('path');
|
||||
|
||||
module.exports = class DexterCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'dexter',
|
||||
group: 'avatar-edit',
|
||||
memberName: 'dexter',
|
||||
description: 'Draws a user\'s avatar over Dexter from Pokémon\'s screen.',
|
||||
throttling: {
|
||||
usages: 1,
|
||||
duration: 30
|
||||
},
|
||||
clientPermissions: ['ATTACH_FILES'],
|
||||
args: [
|
||||
{
|
||||
key: 'user',
|
||||
prompt: 'Which user would you like to edit the avatar of?',
|
||||
type: 'user',
|
||||
default: ''
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const user = args.user || msg.author;
|
||||
const avatarURL = user.displayAvatarURL({
|
||||
format: 'png',
|
||||
size: 256
|
||||
});
|
||||
try {
|
||||
const Image = Canvas.Image;
|
||||
const canvas = new Canvas(744, 554);
|
||||
const ctx = canvas.getContext('2d');
|
||||
const base = new Image();
|
||||
const avatar = new Image();
|
||||
const generate = () => {
|
||||
ctx.drawImage(base, 0, 0);
|
||||
ctx.rotate(-11 * Math.PI / 180);
|
||||
ctx.drawImage(avatar, 234, 274, 225, 225);
|
||||
ctx.rotate(11 * Math.PI / 180);
|
||||
};
|
||||
base.src = await fs.readFileAsync(path.join(__dirname, '..', '..', 'assets', 'images', 'dexter.png'));
|
||||
const { body } = await snekfetch.get(avatarURL);
|
||||
avatar.src = body;
|
||||
generate();
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'dexter.png' }] });
|
||||
} catch (err) {
|
||||
return msg.say(`Oh no, the image generation failed: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1,60 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const Canvas = require('canvas');
|
||||
const snekfetch = require('snekfetch');
|
||||
|
||||
module.exports = class GreyscaleCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'greyscale',
|
||||
aliases: ['grayscale'],
|
||||
group: 'avatar-edit',
|
||||
memberName: 'greyscale',
|
||||
description: 'Draws a user\'s avatar in greyscale.',
|
||||
throttling: {
|
||||
usages: 1,
|
||||
duration: 30
|
||||
},
|
||||
clientPermissions: ['ATTACH_FILES'],
|
||||
args: [
|
||||
{
|
||||
key: 'user',
|
||||
prompt: 'Which user would you like to edit the avatar of?',
|
||||
type: 'user',
|
||||
default: ''
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const user = args.user || msg.author;
|
||||
const avatarURL = user.displayAvatarURL({
|
||||
format: 'png',
|
||||
size: 256
|
||||
});
|
||||
try {
|
||||
const Image = Canvas.Image;
|
||||
const canvas = new Canvas(256, 256);
|
||||
const ctx = canvas.getContext('2d');
|
||||
const avatar = new Image();
|
||||
const generate = () => {
|
||||
ctx.drawImage(avatar, 0, 0, 256, 256);
|
||||
const imgData = ctx.getImageData(0, 0, 256, 256);
|
||||
const { data } = imgData;
|
||||
for (let i = 0; i < data.length; i += 4) {
|
||||
const brightness = 0.34 * data[i] + 0.5 * data[i + 1] + 0.16 * data[i + 2];
|
||||
data[i] = brightness;
|
||||
data[i + 1] = brightness;
|
||||
data[i + 2] = brightness;
|
||||
}
|
||||
ctx.putImageData(imgData, 0, 0);
|
||||
};
|
||||
const { body } = await snekfetch.get(avatarURL);
|
||||
avatar.src = body;
|
||||
generate();
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'greyscale.png' }] });
|
||||
} catch (err) {
|
||||
return msg.say(`Oh no, the image generation failed: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1,58 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const Canvas = require('canvas');
|
||||
const snekfetch = require('snekfetch');
|
||||
|
||||
module.exports = class InvertCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'invert',
|
||||
group: 'avatar-edit',
|
||||
memberName: 'invert',
|
||||
description: 'Draws a user\'s avatar inverted.',
|
||||
throttling: {
|
||||
usages: 1,
|
||||
duration: 30
|
||||
},
|
||||
clientPermissions: ['ATTACH_FILES'],
|
||||
args: [
|
||||
{
|
||||
key: 'user',
|
||||
prompt: 'Which user would you like to edit the avatar of?',
|
||||
type: 'user',
|
||||
default: ''
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const user = args.user || msg.author;
|
||||
const avatarURL = user.displayAvatarURL({
|
||||
format: 'png',
|
||||
size: 256
|
||||
});
|
||||
try {
|
||||
const Image = Canvas.Image;
|
||||
const canvas = new Canvas(256, 256);
|
||||
const ctx = canvas.getContext('2d');
|
||||
const avatar = new Image();
|
||||
const generate = () => {
|
||||
ctx.drawImage(avatar, 0, 0, 256, 256);
|
||||
const imgData = ctx.getImageData(0, 0, 256, 256);
|
||||
const { data } = imgData;
|
||||
for (let i = 0; i < data.length; i += 4) {
|
||||
data[i] = 255 - data[i];
|
||||
data[i + 1] = 255 - data[i + 1];
|
||||
data[i + 2] = 255 - data[i + 2];
|
||||
}
|
||||
ctx.putImageData(imgData, 0, 0);
|
||||
};
|
||||
const { body } = await snekfetch.get(avatarURL);
|
||||
avatar.src = body;
|
||||
generate();
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'invert.png' }] });
|
||||
} catch (err) {
|
||||
return msg.say(`Oh no, the image generation failed: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1,66 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const Canvas = require('canvas');
|
||||
const snekfetch = require('snekfetch');
|
||||
const { promisifyAll } = require('tsubaki');
|
||||
const fs = promisifyAll(require('fs'));
|
||||
const path = require('path');
|
||||
|
||||
module.exports = class RIPCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'rip',
|
||||
aliases: ['grave', 'grave-stone'],
|
||||
group: 'avatar-edit',
|
||||
memberName: 'rip',
|
||||
description: 'Draws a user\'s avatar over a gravestone.',
|
||||
throttling: {
|
||||
usages: 1,
|
||||
duration: 30
|
||||
},
|
||||
clientPermissions: ['ATTACH_FILES'],
|
||||
args: [
|
||||
{
|
||||
key: 'user',
|
||||
prompt: 'Which user would you like to edit the avatar of?',
|
||||
type: 'user',
|
||||
default: ''
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const user = args.user || msg.author;
|
||||
const avatarURL = user.displayAvatarURL({
|
||||
format: 'png',
|
||||
size: 256
|
||||
});
|
||||
try {
|
||||
const Image = Canvas.Image;
|
||||
const canvas = new Canvas(507, 338);
|
||||
const ctx = canvas.getContext('2d');
|
||||
const base = new Image();
|
||||
const avatar = new Image();
|
||||
const generate = () => {
|
||||
ctx.drawImage(base, 0, 0);
|
||||
ctx.drawImage(avatar, 158, 51, 200, 200);
|
||||
const imgData = ctx.getImageData(158, 51, 200, 200);
|
||||
const { data } = imgData;
|
||||
for (let i = 0; i < data.length; i += 4) {
|
||||
const brightness = 0.34 * data[i] + 0.5 * data[i + 1] + 0.16 * data[i + 2];
|
||||
data[i] = brightness;
|
||||
data[i + 1] = brightness;
|
||||
data[i + 2] = brightness;
|
||||
}
|
||||
ctx.putImageData(imgData, 158, 51);
|
||||
};
|
||||
base.src = await fs.readFileAsync(path.join(__dirname, '..', '..', 'assets', 'images', 'rip.png'));
|
||||
const { body } = await snekfetch.get(avatarURL);
|
||||
avatar.src = body;
|
||||
generate();
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'rip.png' }] });
|
||||
} catch (err) {
|
||||
return msg.say(`Oh no, the image generation failed: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1,58 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const Canvas = require('canvas');
|
||||
const snekfetch = require('snekfetch');
|
||||
const { promisifyAll } = require('tsubaki');
|
||||
const fs = promisifyAll(require('fs'));
|
||||
const path = require('path');
|
||||
|
||||
module.exports = class SimbaCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'simba',
|
||||
group: 'avatar-edit',
|
||||
memberName: 'simba',
|
||||
description: 'Draws a user\'s avatar over Simba from The Lion King\'s reflection.',
|
||||
throttling: {
|
||||
usages: 1,
|
||||
duration: 30
|
||||
},
|
||||
clientPermissions: ['ATTACH_FILES'],
|
||||
args: [
|
||||
{
|
||||
key: 'user',
|
||||
prompt: 'Which user would you like to edit the avatar of?',
|
||||
type: 'user',
|
||||
default: ''
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const user = args.user || msg.author;
|
||||
const avatarURL = user.displayAvatarURL({
|
||||
format: 'png',
|
||||
size: 256
|
||||
});
|
||||
try {
|
||||
const Image = Canvas.Image;
|
||||
const canvas = new Canvas(500, 281);
|
||||
const ctx = canvas.getContext('2d');
|
||||
const base = new Image();
|
||||
const avatar = new Image();
|
||||
const generate = () => {
|
||||
ctx.drawImage(base, 0, 0);
|
||||
ctx.rotate(-24 * Math.PI / 180);
|
||||
ctx.drawImage(avatar, 75, 160, 130, 150);
|
||||
ctx.rotate(24 * Math.PI / 180);
|
||||
};
|
||||
base.src = await fs.readFileAsync(path.join(__dirname, '..', '..', 'assets', 'images', 'simba.png'));
|
||||
const { body } = await snekfetch.get(avatarURL);
|
||||
avatar.src = body;
|
||||
generate();
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'simba.png' }] });
|
||||
} catch (err) {
|
||||
return msg.say(`Oh no, the image generation failed: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1,62 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const Canvas = require('canvas');
|
||||
const snekfetch = require('snekfetch');
|
||||
const { promisifyAll } = require('tsubaki');
|
||||
const fs = promisifyAll(require('fs'));
|
||||
const path = require('path');
|
||||
|
||||
module.exports = class SteamCardCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'steam-card',
|
||||
group: 'avatar-edit',
|
||||
memberName: 'steam-card',
|
||||
description: 'Draws a user\'s avatar over a Steam card.',
|
||||
throttling: {
|
||||
usages: 1,
|
||||
duration: 30
|
||||
},
|
||||
clientPermissions: ['ATTACH_FILES'],
|
||||
args: [
|
||||
{
|
||||
key: 'user',
|
||||
prompt: 'Which user would you like to edit the avatar of?',
|
||||
type: 'user',
|
||||
default: ''
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const user = args.user || msg.author;
|
||||
const avatarURL = user.displayAvatarURL({
|
||||
format: 'png',
|
||||
size: 512
|
||||
});
|
||||
try {
|
||||
const Image = Canvas.Image;
|
||||
Canvas.registerFont(path.join(__dirname, '..', '..', 'assets', 'fonts', 'Roboto.ttf'), { family: 'Roboto' }); // eslint-disable-line max-len
|
||||
Canvas.registerFont(path.join(__dirname, '..', '..', 'assets', 'fonts', 'NotoEmoji-Regular.ttf'), { family: 'Roboto' }); // eslint-disable-line max-len
|
||||
const canvas = new Canvas(494, 568);
|
||||
const ctx = canvas.getContext('2d');
|
||||
const base = new Image();
|
||||
const avatar = new Image();
|
||||
const generate = () => {
|
||||
ctx.fillStyle = 'white';
|
||||
ctx.fillRect(0, 0, 494, 568);
|
||||
ctx.drawImage(avatar, 25, 25, 450, 450);
|
||||
ctx.drawImage(base, 0, 0);
|
||||
ctx.font = '30px Roboto';
|
||||
ctx.fillText(user.username, 35, 48);
|
||||
};
|
||||
base.src = await fs.readFileAsync(path.join(__dirname, '..', '..', 'assets', 'images', 'steam-card.png'));
|
||||
const { body } = await snekfetch.get(avatarURL);
|
||||
avatar.src = body;
|
||||
generate();
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'steam-card.png' }] });
|
||||
} catch (err) {
|
||||
return msg.say(`Oh no, the image generation failed: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1,62 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const Canvas = require('canvas');
|
||||
const snekfetch = require('snekfetch');
|
||||
const { promisifyAll } = require('tsubaki');
|
||||
const fs = promisifyAll(require('fs'));
|
||||
const path = require('path');
|
||||
|
||||
module.exports = class TriggeredCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'triggered',
|
||||
group: 'avatar-edit',
|
||||
memberName: 'triggered',
|
||||
description: 'Draws a user\'s avatar over a Triggered meme.',
|
||||
throttling: {
|
||||
usages: 1,
|
||||
duration: 30
|
||||
},
|
||||
clientPermissions: ['ATTACH_FILES'],
|
||||
args: [
|
||||
{
|
||||
key: 'user',
|
||||
prompt: 'Which user would you like to edit the avatar of?',
|
||||
type: 'user',
|
||||
default: ''
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const user = args.user || msg.author;
|
||||
const avatarURL = user.displayAvatarURL({
|
||||
format: 'png',
|
||||
size: 512
|
||||
});
|
||||
try {
|
||||
const Image = Canvas.Image;
|
||||
const canvas = new Canvas(320, 371);
|
||||
const ctx = canvas.getContext('2d');
|
||||
const base = new Image();
|
||||
const avatar = new Image();
|
||||
const generate = () => {
|
||||
ctx.fillStyle = 'white';
|
||||
ctx.fillRect(0, 0, 320, 371);
|
||||
ctx.drawImage(avatar, 0, 0, 320, 320);
|
||||
const imgData = ctx.getImageData(0, 0, 320, 320);
|
||||
const { data } = imgData;
|
||||
for (let i = 0; i < data.length; i += 4) data[i] = Math.max(255, data[i]);
|
||||
ctx.putImageData(imgData, 0, 0);
|
||||
ctx.drawImage(base, 0, 0);
|
||||
};
|
||||
base.src = await fs.readFileAsync(path.join(__dirname, '..', '..', 'assets', 'images', 'triggered.png'));
|
||||
const { body } = await snekfetch.get(avatarURL);
|
||||
avatar.src = body;
|
||||
generate();
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'triggered.png' }] });
|
||||
} catch (err) {
|
||||
return msg.say(`Oh no, the image generation failed: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1,56 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const Canvas = require('canvas');
|
||||
const snekfetch = require('snekfetch');
|
||||
const { promisifyAll } = require('tsubaki');
|
||||
const fs = promisifyAll(require('fs'));
|
||||
const path = require('path');
|
||||
|
||||
module.exports = class WantedCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'wanted',
|
||||
group: 'avatar-edit',
|
||||
memberName: 'wanted',
|
||||
description: 'Draws a user\'s avatar over a wanted poster.',
|
||||
throttling: {
|
||||
usages: 1,
|
||||
duration: 30
|
||||
},
|
||||
clientPermissions: ['ATTACH_FILES'],
|
||||
args: [
|
||||
{
|
||||
key: 'user',
|
||||
prompt: 'Which user would you like to edit the avatar of?',
|
||||
type: 'user',
|
||||
default: ''
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const user = args.user || msg.author;
|
||||
const avatarURL = user.displayAvatarURL({
|
||||
format: 'png',
|
||||
size: 512
|
||||
});
|
||||
try {
|
||||
const Image = Canvas.Image;
|
||||
const canvas = new Canvas(741, 1000);
|
||||
const ctx = canvas.getContext('2d');
|
||||
const base = new Image();
|
||||
const avatar = new Image();
|
||||
const generate = () => {
|
||||
ctx.drawImage(base, 0, 0);
|
||||
ctx.drawImage(avatar, 150, 360, 430, 430);
|
||||
};
|
||||
base.src = await fs.readFileAsync(path.join(__dirname, '..', '..', 'assets', 'images', 'wanted.png'));
|
||||
const { body } = await snekfetch.get(avatarURL);
|
||||
avatar.src = body;
|
||||
generate();
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'wanted.png' }] });
|
||||
} catch (err) {
|
||||
return msg.say(`Oh no, the image generation failed: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1,124 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { stripIndents } = require('common-tags');
|
||||
|
||||
module.exports = class BattleCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'battle',
|
||||
aliases: ['fight', 'death-battle'],
|
||||
group: 'games',
|
||||
memberName: 'battle',
|
||||
description: 'Engage in a turn-based battle against another user or the AI.',
|
||||
guildOnly: true,
|
||||
args: [
|
||||
{
|
||||
key: 'opponent',
|
||||
prompt: 'Who would you like to battle?',
|
||||
type: 'user',
|
||||
default: 'AI'
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
this.fighting = new Set();
|
||||
}
|
||||
|
||||
async run(msg, args) { // eslint-disable-line complexity
|
||||
const opponent = args.opponent;
|
||||
if (opponent.bot) return msg.say('Bots may not be fought.');
|
||||
if (opponent.id === msg.author.id) return msg.say('You may not fight yourself.');
|
||||
if (this.fighting.has(msg.guild.id)) return msg.say('Only one fight may be occurring per server.');
|
||||
this.fighting.add(msg.guild.id);
|
||||
try {
|
||||
if (opponent !== 'AI') {
|
||||
await msg.say(`${opponent}, do you accept this challenge? **__Y__es** or **No**?`);
|
||||
const verify = await msg.channel.awaitMessages((res) => res.author.id === opponent.id, {
|
||||
max: 1,
|
||||
time: 30000
|
||||
});
|
||||
if (!verify.size || !['yes', 'y'].includes(verify.first().content.toLowerCase())) {
|
||||
this.fighting.delete(msg.guild.id);
|
||||
return msg.say('Looks like they declined...');
|
||||
}
|
||||
}
|
||||
let userHP = 500;
|
||||
let oppoHP = 500;
|
||||
let userTurn = false;
|
||||
let guard = false;
|
||||
const reset = (changeGuard = true) => {
|
||||
if (userTurn) userTurn = false;
|
||||
else userTurn = true;
|
||||
if (changeGuard && guard) guard = false;
|
||||
};
|
||||
const dealDamage = (damage) => {
|
||||
if (userTurn) oppoHP -= damage;
|
||||
else userHP -= damage;
|
||||
};
|
||||
const forfeit = () => {
|
||||
if (userTurn) userHP = 0;
|
||||
else oppoHP = 0;
|
||||
};
|
||||
while (userHP > 0 && oppoHP > 0) { // eslint-disable-line no-unmodified-loop-condition
|
||||
const user = userTurn ? msg.author : opponent;
|
||||
let choice;
|
||||
if (opponent !== 'AI' || (opponent === 'AI' && userTurn)) {
|
||||
const id = userTurn ? msg.author.id : opponent.id;
|
||||
await msg.say(stripIndents`
|
||||
${user}, do you **fight**, **guard**, **special**, or **run**?
|
||||
**${msg.author.username}**: ${userHP}HP
|
||||
**${opponent === 'AI' ? 'AI' : opponent.username}**: ${oppoHP}HP
|
||||
`);
|
||||
const turn = await msg.channel.awaitMessages((res) => res.author.id === id, {
|
||||
max: 1,
|
||||
time: 30000
|
||||
});
|
||||
if (!turn.size) {
|
||||
await msg.say('Time!');
|
||||
forfeit();
|
||||
break;
|
||||
}
|
||||
choice = turn.first().content.toLowerCase();
|
||||
} else {
|
||||
const choices = ['fight', 'guard', 'special'];
|
||||
choice = choices[Math.floor(Math.random() * choices.length)];
|
||||
}
|
||||
if (choice === 'fight') {
|
||||
const damage = Math.floor(Math.random() * (guard ? 10 : 100)) + 1;
|
||||
await msg.say(`${user} deals **${damage}** damage!`);
|
||||
dealDamage(damage);
|
||||
reset();
|
||||
} else if (choice === 'guard') {
|
||||
await msg.say(`${user} guards!`);
|
||||
guard = true;
|
||||
reset(false);
|
||||
} else if (choice === 'special') {
|
||||
const hit = Math.floor(Math.random() * 4) + 1;
|
||||
if (hit === 1) {
|
||||
const damage = Math.floor(Math.random() * ((guard ? 300 : 150) - 100 + 1) + 100);
|
||||
await msg.say(`${user} deals **${damage}** damage!`);
|
||||
dealDamage(damage);
|
||||
reset();
|
||||
} else {
|
||||
await msg.say(`${user}'s attack missed!`);
|
||||
reset();
|
||||
}
|
||||
} else if (choice === 'run') {
|
||||
await msg.say(`${user} flees!`);
|
||||
forfeit();
|
||||
break;
|
||||
} else {
|
||||
await msg.say(`${user}, I do not understand what you want to do.`);
|
||||
}
|
||||
}
|
||||
this.fighting.delete(msg.guild.id);
|
||||
return msg.say(stripIndents`
|
||||
The match is over!
|
||||
**Winner:** ${userHP > oppoHP ? `${msg.author} (${userHP}HP)` : `${opponent} (${oppoHP}HP)`}
|
||||
**Loser:** ${userHP > oppoHP ? `${opponent} (${oppoHP}HP)` : `${msg.author} (${userHP}HP)`}
|
||||
`);
|
||||
} catch (err) {
|
||||
this.fighting.delete(msg.guild.id);
|
||||
return msg.say(`Oh no, an Error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1,83 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const snekfetch = require('snekfetch');
|
||||
const { stripIndents } = require('common-tags');
|
||||
const { wordnikKey } = require('../../config');
|
||||
|
||||
module.exports = class HangmanCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'hangman',
|
||||
group: 'games',
|
||||
memberName: 'hangman',
|
||||
description: 'Play a game of hangman.',
|
||||
guildOnly: true
|
||||
});
|
||||
|
||||
this.playing = new Set();
|
||||
}
|
||||
|
||||
async run(msg) {
|
||||
if (this.playing.has(msg.guild.id)) return msg.say('Only one game may be occurring per server.');
|
||||
this.playing.add(msg.guild.id);
|
||||
try {
|
||||
const { body } = await snekfetch
|
||||
.get('http://api.wordnik.com:80/v4/words.json/randomWord')
|
||||
.query({
|
||||
hasDictionaryDef: true,
|
||||
minCorpusCount: 0,
|
||||
maxCorpusCount: -1,
|
||||
minDictionaryCount: 1,
|
||||
maxDictionaryCount: -1,
|
||||
minLength: -1,
|
||||
maxLength: -1,
|
||||
api_key: wordnikKey
|
||||
});
|
||||
const word = body.word.toLowerCase().replace(/[ ]/g, '-');
|
||||
let points = 0;
|
||||
const confirmation = [];
|
||||
const incorrect = [];
|
||||
const display = '_'.repeat(word.length).split('');
|
||||
while (word.length !== confirmation.length && points < 7) {
|
||||
await msg.code(null, stripIndents`
|
||||
___________
|
||||
| |
|
||||
| ${points > 0 ? 'O' : ''}
|
||||
| ${points > 2 ? '—' : ' '}${points > 1 ? '|' : ''}${points > 3 ? '—' : ''}
|
||||
| ${points > 4 ? '/' : ''} ${points > 5 ? '\\' : ''}
|
||||
===========
|
||||
The word is: ${display.join(' ')}. Which letter do you choose?
|
||||
`);
|
||||
const guess = await msg.channel.awaitMessages((res) => res.author.id === msg.author.id, {
|
||||
max: 1,
|
||||
time: 30000
|
||||
});
|
||||
if (!guess.size) {
|
||||
await msg.say('Time!');
|
||||
break;
|
||||
}
|
||||
const choice = guess.first().content.toLowerCase();
|
||||
if (confirmation.includes(choice) || incorrect.includes(choice)) {
|
||||
await msg.say('You have already picked that letter!');
|
||||
} else if (word.includes(choice)) {
|
||||
await msg.say('Nice job!');
|
||||
for (let i = 0; i < word.length; i++) {
|
||||
if (word[i] === choice) {
|
||||
confirmation.push(word[i]);
|
||||
display[i] = word[i];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
await msg.say('Nope!');
|
||||
incorrect.push(choice);
|
||||
points++;
|
||||
}
|
||||
}
|
||||
this.playing.delete(msg.guild.id);
|
||||
if (word.length === confirmation.length) return msg.say(`You won, it was ${word}!`);
|
||||
else return msg.say(`Too bad... It was ${word}...`);
|
||||
} catch (err) {
|
||||
this.playing.delete(msg.guild.id);
|
||||
return msg.say(`Oh no, an Error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1,18 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
|
||||
module.exports = class LotteryCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'lottery',
|
||||
group: 'games',
|
||||
memberName: 'lottery',
|
||||
description: 'Attempt to win the lottery, with a 1 in 100 chance of winning.'
|
||||
});
|
||||
}
|
||||
|
||||
run(msg) {
|
||||
const lottery = Math.floor(Math.random() * 100) + 1;
|
||||
if (lottery === 1) return msg.reply(`Wow! You actually won! Great job!`);
|
||||
else return msg.reply(`Nope, sorry, you lost.`);
|
||||
}
|
||||
};
|
||||
@@ -1,48 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const math = require('mathjs');
|
||||
const { operations, difficulties, maxValues } = require('../../assets/json/math-game');
|
||||
|
||||
module.exports = class MathGameCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'math-game',
|
||||
group: 'games',
|
||||
memberName: 'math-game',
|
||||
description: 'See how fast you can answer a math problem in a given time limit.',
|
||||
clientPermissions: ['EMBED_LINKS'],
|
||||
args: [
|
||||
{
|
||||
key: 'difficulty',
|
||||
prompt: `What should the difficulty of the game be? One of: ${difficulties.join(', ')}`,
|
||||
type: 'string',
|
||||
validate: (difficulty) => {
|
||||
if (difficulties.includes(difficulty.toLowerCase())) return true;
|
||||
else return `The difficulty must be one of: ${difficulties.join(', ')}`;
|
||||
},
|
||||
parse: (difficulty) => difficulty.toLowerCase()
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { difficulty } = args;
|
||||
const operation = operations[Math.floor(Math.random() * operations.length)];
|
||||
const value1 = Math.floor(Math.random() * maxValues[difficulty]) + 1;
|
||||
const value2 = Math.floor(Math.random() * maxValues[difficulty]) + 1;
|
||||
const expression = `${value1} ${operation} ${value2}`;
|
||||
const answer = math.eval(expression).toString();
|
||||
const embed = new MessageEmbed()
|
||||
.setTitle('You have 10 seconds to answer:')
|
||||
.setDescription(expression);
|
||||
await msg.embed(embed);
|
||||
const msgs = await msg.channel.awaitMessages((res) => res.author.id === msg.author.id, {
|
||||
max: 1,
|
||||
time: 10000
|
||||
});
|
||||
if (!msgs.size) return msg.say(`Time! It was ${answer}, sorry!`);
|
||||
if (msgs.first().content !== answer) return msg.say(`Nope, sorry, it's ${answer}.`);
|
||||
else return msg.say('Nice job! 10/10! You deserve some cake!');
|
||||
}
|
||||
};
|
||||
@@ -1,42 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const { stripIndents } = require('common-tags');
|
||||
const snekfetch = require('snekfetch');
|
||||
|
||||
module.exports = class QuizCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'quiz',
|
||||
aliases: ['jeopardy'],
|
||||
group: 'games',
|
||||
memberName: 'quiz',
|
||||
description: 'Answer a true/false quiz question.',
|
||||
clientPermissions: ['EMBED_LINKS']
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg) {
|
||||
const { body } = await snekfetch
|
||||
.get('https://opentdb.com/api.php')
|
||||
.query({
|
||||
amount: 1,
|
||||
type: 'boolean',
|
||||
encode: 'url3986'
|
||||
});
|
||||
const answer = body.results[0].correct_answer.toLowerCase();
|
||||
const embed = new MessageEmbed()
|
||||
.setTitle('You have 15 seconds to answer this question:')
|
||||
.setDescription(stripIndents`
|
||||
**${decodeURIComponent(body.results[0].category)}**
|
||||
True or False: ${decodeURIComponent(body.results[0].question)}
|
||||
`);
|
||||
await msg.embed(embed);
|
||||
const msgs = await msg.channel.awaitMessages((res) => res.author.id === msg.author.id, {
|
||||
max: 1,
|
||||
time: 15000
|
||||
});
|
||||
if (!msgs.size) return msg.say(`Time! It was ${answer}, sorry!`);
|
||||
if (msgs.first().content.toLowerCase() !== answer) return msg.say(`Nope, sorry, it's ${answer}.`);
|
||||
else return msg.say('Nice job! 10/10! You deserve some cake!');
|
||||
}
|
||||
};
|
||||
@@ -1,42 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const choices = ['paper', 'rock', 'scissors'];
|
||||
|
||||
module.exports = class RockPaperScissorsCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'rock-paper-scissors',
|
||||
aliases: ['rps'],
|
||||
group: 'games',
|
||||
memberName: 'rock-paper-scissors',
|
||||
description: 'Play Rock-Paper-Scissors.',
|
||||
args: [
|
||||
{
|
||||
key: 'choice',
|
||||
prompt: 'Rock, Paper, or Scissors?',
|
||||
type: 'string',
|
||||
parse: (choice) => choice.toLowerCase()
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) { // eslint-disable-line consistent-return
|
||||
const { choice } = args;
|
||||
const response = choices[Math.floor(Math.random() * choices.length)];
|
||||
if (choice === 'rock') {
|
||||
if (response === 'rock') return msg.say('Rock! Aw... A tie...');
|
||||
else if (response === 'paper') return msg.say('Paper! Yes! I win!');
|
||||
else if (response === 'scissors') return msg.say('Scissors! Aw... I lose...');
|
||||
} else if (choice === 'paper') {
|
||||
if (response === 'rock') return msg.say('Rock! Aw... I lose...');
|
||||
else if (response === 'paper') return msg.say('Paper! Aw... A tie...');
|
||||
else if (response === 'scissors') return msg.say('Scissors! Yes! I win!');
|
||||
} else if (choice === 'scissors') {
|
||||
if (response === 'rock') return msg.say('Rock! Yes! I win!');
|
||||
else if (response === 'paper') return msg.say('Paper! Aw... I lose...');
|
||||
else if (response === 'scissors') return msg.say('Scissors! Aw... A tie...');
|
||||
} else {
|
||||
return msg.say('I win by default, you little cheater.');
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1,31 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { stripIndents } = require('common-tags');
|
||||
const slots = [':grapes:', ':tangerine:', ':pear:', ':cherries:', ':lemon:'];
|
||||
|
||||
module.exports = class SlotsCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'slots',
|
||||
group: 'games',
|
||||
memberName: 'slots',
|
||||
description: 'Play a game of slots.'
|
||||
});
|
||||
}
|
||||
|
||||
run(msg) {
|
||||
const slotOne = slots[Math.floor(Math.random() * slots.length)];
|
||||
const slotTwo = slots[Math.floor(Math.random() * slots.length)];
|
||||
const slotThree = slots[Math.floor(Math.random() * slots.length)];
|
||||
if (slotOne === slotTwo && slotOne === slotThree) {
|
||||
return msg.say(stripIndents`
|
||||
${slotOne}|${slotTwo}|${slotThree}
|
||||
Wow! You won! Great job... er... luck!
|
||||
`);
|
||||
} else {
|
||||
return msg.say(stripIndents`
|
||||
${slotOne}|${slotTwo}|${slotThree}
|
||||
Aww... You lost... Guess it's just bad luck, huh?
|
||||
`);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1,43 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const { sentences, difficulties, times } = require('../../assets/json/typing-game');
|
||||
|
||||
module.exports = class TypingGameCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'typing-game',
|
||||
group: 'games',
|
||||
memberName: 'typing-game',
|
||||
description: 'See how fast you can type a sentence in a given time limit.',
|
||||
clientPermissions: ['EMBED_LINKS'],
|
||||
args: [
|
||||
{
|
||||
key: 'difficulty',
|
||||
prompt: `What should the difficulty of the game be? One of: ${difficulties.join(', ')}`,
|
||||
type: 'string',
|
||||
validate: (difficulty) => {
|
||||
if (difficulties.includes(difficulty.toLowerCase())) return true;
|
||||
else return `The difficulty must be one of: ${difficulties.join(', ')}`;
|
||||
},
|
||||
parse: (difficulty) => difficulty.toLowerCase()
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { difficulty } = args;
|
||||
const sentence = sentences[Math.floor(Math.random() * sentences.length)];
|
||||
const time = times[difficulty];
|
||||
const embed = new MessageEmbed()
|
||||
.setTitle(`You have ${time / 1000} seconds to type:`)
|
||||
.setDescription(sentence);
|
||||
await msg.embed(embed);
|
||||
const msgs = await msg.channel.awaitMessages((res) => res.author.id === msg.author.id, {
|
||||
max: 1,
|
||||
time
|
||||
});
|
||||
if (!msgs.size || msgs.first().content !== sentence) return msg.say('Sorry! You lose!');
|
||||
else return msg.say('Nice job! 10/10! You deserve some cake!');
|
||||
}
|
||||
};
|
||||
@@ -1,19 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
|
||||
module.exports = class EmojiCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'emoji',
|
||||
group: 'guild-info',
|
||||
memberName: 'emoji',
|
||||
description: 'Responds with a list of the server\'s custom emoji.',
|
||||
guildOnly: true
|
||||
});
|
||||
}
|
||||
|
||||
run(msg) {
|
||||
const emoji = msg.guild.emojis;
|
||||
if (!emoji.size) return msg.say('You have no custom emoji.');
|
||||
return msg.say(emoji.map((e) => e).join(''));
|
||||
}
|
||||
};
|
||||
@@ -1,41 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const moment = require('moment');
|
||||
const filterLevels = ['Off', 'No Role', 'Everyone'];
|
||||
|
||||
module.exports = class GuildInfoCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'server-info',
|
||||
aliases: ['guild', 'server', 'guild-info'],
|
||||
group: 'guild-info',
|
||||
memberName: 'server-info',
|
||||
description: 'Responds with detailed information on the server.',
|
||||
guildOnly: true,
|
||||
clientPermissions: ['EMBED_LINKS']
|
||||
});
|
||||
}
|
||||
|
||||
run(msg) {
|
||||
const embed = new MessageEmbed()
|
||||
.setColor(0x00AE86)
|
||||
.setThumbnail(msg.guild.iconURL())
|
||||
.addField('❯ Name',
|
||||
msg.guild.name, true)
|
||||
.addField('❯ ID',
|
||||
msg.guild.id, true)
|
||||
.addField('❯ Creation Date',
|
||||
moment(msg.guild.createdAt).format('MMMM Do YYYY'), true)
|
||||
.addField('❯ Default Channel',
|
||||
msg.guild.defaultChannel, true)
|
||||
.addField('❯ Region',
|
||||
msg.guild.region, true)
|
||||
.addField('❯ Explicit Filter',
|
||||
filterLevels[msg.guild.explicitContentFilter], true)
|
||||
.addField('❯ Owner',
|
||||
msg.guild.owner ? msg.guild.owner.user.username : 'None', true)
|
||||
.addField('❯ Members',
|
||||
msg.guild.memberCount, true);
|
||||
return msg.embed(embed);
|
||||
}
|
||||
};
|
||||
@@ -1,38 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const snekfetch = require('snekfetch');
|
||||
|
||||
module.exports = class AchievementCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'achievement',
|
||||
group: 'image-edit',
|
||||
memberName: 'achievement',
|
||||
description: 'Sends a Minecraft achievement with the text of your choice.',
|
||||
clientPermissions: ['ATTACH_FILES'],
|
||||
args: [
|
||||
{
|
||||
key: 'text',
|
||||
prompt: 'What should the text of the achievement be?',
|
||||
type: 'string',
|
||||
validate: (text) => {
|
||||
if (text.length < 25) return true;
|
||||
else return 'Text must be under 25 characters.';
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { text } = args;
|
||||
const { body } = await snekfetch
|
||||
.get('https://www.minecraftskinstealer.com/achievement/a.php')
|
||||
.query({
|
||||
i: 1,
|
||||
h: 'Achievement Get!',
|
||||
t: text
|
||||
});
|
||||
return msg.say({ files: [{ attachment: body, name: 'achievement.png' }] });
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const codes = require('../../assets/json/meme');
|
||||
|
||||
module.exports = class MemeCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'meme',
|
||||
group: 'image-edit',
|
||||
memberName: 'meme',
|
||||
description: 'Sends a meme with text of your choice, and a background of your choice.',
|
||||
clientPermissions: ['ATTACH_FILES'],
|
||||
details: `**Codes:** ${codes.join(', ')}`,
|
||||
args: [
|
||||
{
|
||||
key: 'type',
|
||||
prompt: 'What meme type do you want to use?',
|
||||
type: 'string',
|
||||
validate: (type) => {
|
||||
if (codes.includes(type.toLowerCase())) return true;
|
||||
else return 'Invalid meme type. Use `help meme` to view a list of meme types.';
|
||||
},
|
||||
parse: (type) => type.toLowerCase()
|
||||
},
|
||||
{
|
||||
key: 'top',
|
||||
prompt: 'What should the top row of the meme to be?',
|
||||
type: 'string',
|
||||
parse: (top) => encodeURIComponent(top.replace(/[ ]/g, '-'))
|
||||
},
|
||||
{
|
||||
key: 'bottom',
|
||||
prompt: 'What should the bottom row of the meme to be?',
|
||||
type: 'string',
|
||||
parse: (bottom) => encodeURIComponent(bottom.replace(/[ ]/g, '-'))
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { type, top, bottom } = args;
|
||||
return msg.say({ files: [`https://memegen.link/${type}/${top}/${bottom}.jpg`] });
|
||||
}
|
||||
};
|
||||
@@ -1,41 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const pokemon = require('../../assets/json/pokemon-fusion');
|
||||
|
||||
module.exports = class PokemonFusionCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'pokemon-fusion',
|
||||
aliases: ['poke-fusion', 'poke-fuse'],
|
||||
group: 'image-edit',
|
||||
memberName: 'pokemon-fusion',
|
||||
description: 'Fuses two Generation I Pokémon together.',
|
||||
args: [
|
||||
{
|
||||
key: 'source1',
|
||||
prompt: 'What Pokémon should be fused?',
|
||||
type: 'string',
|
||||
validate: (source1) => {
|
||||
if (pokemon[source1.toLowerCase()]) return true;
|
||||
else return 'Only Pokémon from Generation I may be used.';
|
||||
},
|
||||
parse: (source1) => pokemon[source1.toLowerCase()]
|
||||
},
|
||||
{
|
||||
key: 'source2',
|
||||
prompt: 'What Pokémon should be fused?',
|
||||
type: 'string',
|
||||
validate: (source2) => {
|
||||
if (pokemon[source2.toLowerCase()]) return true;
|
||||
else return 'Only Pokémon from Generation I may be used.';
|
||||
},
|
||||
parse: (source2) => pokemon[source2.toLowerCase()]
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { source1, source2 } = args;
|
||||
return msg.say(`http://images.alexonsager.net/pokemon/fused/${source1}/${source1}.${source2}.png`);
|
||||
}
|
||||
};
|
||||
@@ -1,84 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const { stripIndents } = require('common-tags');
|
||||
|
||||
module.exports = class BanCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'ban',
|
||||
aliases: ['banne'],
|
||||
group: 'moderation',
|
||||
memberName: 'ban',
|
||||
description: 'Bans a user and logs the ban to the mod logs.',
|
||||
guildOnly: true,
|
||||
clientPermissions: ['BAN_MEMBERS'],
|
||||
userPermissions: ['BAN_MEMBERS'],
|
||||
args: [
|
||||
{
|
||||
key: 'member',
|
||||
prompt: 'What member do you want to ban?',
|
||||
type: 'member'
|
||||
},
|
||||
{
|
||||
key: 'reason',
|
||||
prompt: 'What do you want to set the reason as?',
|
||||
type: 'string',
|
||||
validate: (reason) => {
|
||||
if (reason.length < 140) return true;
|
||||
else return 'Reason must be under 140 characters.';
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const modlogs = msg.guild.channels.filter((c) => {
|
||||
const topic = c.topic || '';
|
||||
if (topic.includes('<modlog>')) return true;
|
||||
else return false;
|
||||
}).first() || msg.guild.channels.find('name', 'mod-log');
|
||||
const { member, reason } = args;
|
||||
if (!member.bannable) return msg.say('This member is not bannable. Perhaps they have a higher role than me?');
|
||||
await msg.say(`Are you sure you want to ban ${member.user.tag} (${member.id})?`);
|
||||
const msgs = await msg.channel.awaitMessages((res) => res.author.id === msg.author.id, {
|
||||
max: 1,
|
||||
time: 30000
|
||||
});
|
||||
if (!msgs.size || !['y', 'yes'].includes(msgs.first().content.toLowerCase())) return msg.say('Aborting.');
|
||||
try {
|
||||
await member.send(stripIndents`
|
||||
You were banned from ${msg.guild.name}!
|
||||
Reason: ${reason}
|
||||
`);
|
||||
} catch (err) {
|
||||
await msg.say('Failed to Send DM.');
|
||||
}
|
||||
await member.ban({
|
||||
days: 7,
|
||||
reason: `${msg.author.tag}: ${reason}`
|
||||
});
|
||||
await msg.say(`Successfully banned ${member.user.tag}.`);
|
||||
if (!modlogs || !modlogs.permissionsFor(this.client.user).has('SEND_MESSAGES')) {
|
||||
return msg.say('Could not log the ban to the mod logs.');
|
||||
} else if (modlogs.permissionsFor(this.client.user).has('EMBED_LINKS')) {
|
||||
const embed = new MessageEmbed()
|
||||
.setAuthor(msg.author.tag, msg.author.displayAvatarURL())
|
||||
.setColor(0xFF0000)
|
||||
.setTimestamp()
|
||||
.setDescription(stripIndents`
|
||||
**Member:** ${member.user.tag} (${member.id})
|
||||
**Action:** Ban
|
||||
**Reason:** ${reason}
|
||||
`);
|
||||
return modlogs.send({ embed });
|
||||
} else {
|
||||
return modlogs.send(stripIndents`
|
||||
**Member:** ${member.user.tag} (${member.id})
|
||||
**Action:** Ban
|
||||
**Reason:** ${reason}
|
||||
**Moderator:** ${msg.author.tag}
|
||||
`);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1,81 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const { stripIndents } = require('common-tags');
|
||||
|
||||
module.exports = class KickCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'kick',
|
||||
aliases: ['kickke'],
|
||||
group: 'moderation',
|
||||
memberName: 'kick',
|
||||
description: 'Kicks a user and logs the kick to the mod logs.',
|
||||
guildOnly: true,
|
||||
clientPermissions: ['KICK_MEMBERS'],
|
||||
userPermissions: ['KICK_MEMBERS'],
|
||||
args: [
|
||||
{
|
||||
key: 'member',
|
||||
prompt: 'What member do you want to kick?',
|
||||
type: 'member'
|
||||
},
|
||||
{
|
||||
key: 'reason',
|
||||
prompt: 'What do you want to set the reason as?',
|
||||
type: 'string',
|
||||
validate: (reason) => {
|
||||
if (reason.length < 140) return true;
|
||||
else return 'Reason must be under 140 characters.';
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const modlogs = msg.guild.channels.filter((c) => {
|
||||
const topic = c.topic || '';
|
||||
if (topic.includes('<modlog>')) return true;
|
||||
else return false;
|
||||
}).first() || msg.guild.channels.find('name', 'mod-log');
|
||||
const { member, reason } = args;
|
||||
if (!member.kickable) return msg.say('This member is not kickable. Perhaps they have a higher role than me?');
|
||||
await msg.say(`Are you sure you want to kick ${member.user.tag} (${member.id})?`);
|
||||
const msgs = await msg.channel.awaitMessages((res) => res.author.id === msg.author.id, {
|
||||
max: 1,
|
||||
time: 30000
|
||||
});
|
||||
if (!msgs.size || !['y', 'yes'].includes(msgs.first().content.toLowerCase())) return msg.say('Aborting.');
|
||||
try {
|
||||
await member.send(stripIndents`
|
||||
You were kicked from ${msg.guild.name}!
|
||||
Reason: ${reason}
|
||||
`);
|
||||
} catch (err) {
|
||||
await msg.say('Failed to Send DM.');
|
||||
}
|
||||
await member.kick({ reason: `${msg.author.tag}: ${reason}` });
|
||||
await msg.say(`Successfully kicked ${member.user.tag}.`);
|
||||
if (!modlogs || !modlogs.permissionsFor(this.client.user).has('SEND_MESSAGES')) {
|
||||
return msg.say('Could not log the kick to the mod logs.');
|
||||
} else if (modlogs.permissionsFor(this.client.user).has('EMBED_LINKS')) {
|
||||
const embed = new MessageEmbed()
|
||||
.setAuthor(msg.author.tag, msg.author.displayAvatarURL())
|
||||
.setColor(0xFFA500)
|
||||
.setTimestamp()
|
||||
.setDescription(stripIndents`
|
||||
**Member:** ${member.user.tag} (${member.id})
|
||||
**Action:** Kick
|
||||
**Reason:** ${reason}
|
||||
`);
|
||||
return modlogs.send({ embed });
|
||||
} else {
|
||||
return modlogs.send(stripIndents`
|
||||
**Member:** ${member.user.tag} (${member.id})
|
||||
**Action:** Kick
|
||||
**Reason:** ${reason}
|
||||
**Moderator:** ${msg.author.tag}
|
||||
`);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1,43 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { stripIndents } = require('common-tags');
|
||||
|
||||
module.exports = class LockdownCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'lockdown',
|
||||
group: 'moderation',
|
||||
memberName: 'lockdown',
|
||||
description: 'Prevents users from posting in the current channel, or removes a lockdown.',
|
||||
guildOnly: true,
|
||||
clientPermissions: ['ADMINISTRATOR'],
|
||||
userPermissions: ['ADMINISTRATOR'],
|
||||
args: [
|
||||
{
|
||||
key: 'type',
|
||||
prompt: 'Please enter either start or stop.',
|
||||
type: 'string',
|
||||
default: 'start',
|
||||
validate: (type) => {
|
||||
if (['start', 'stop'].includes(type.toLowerCase())) return true;
|
||||
else return 'Please enter either start or stop.';
|
||||
},
|
||||
parse: (type) => type.toLowerCase()
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { type } = args;
|
||||
if (type === 'start') {
|
||||
await msg.channel.overwritePermissions(msg.guild.defaultRole, { SEND_MESSAGES: false });
|
||||
return msg.say(stripIndents`
|
||||
Lockdown Started, users without Administrator can no longer post messages.
|
||||
Please use \`lockdown stop\` to end the lockdown.
|
||||
`);
|
||||
} else {
|
||||
await msg.channel.overwritePermissions(msg.guild.defaultRole, { SEND_MESSAGES: null });
|
||||
return msg.say('Lockdown Ended.');
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1,42 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
|
||||
module.exports = class PruneCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'prune',
|
||||
group: 'moderation',
|
||||
memberName: 'prune',
|
||||
description: 'Deletes up to 99 messages from the current channel.',
|
||||
guildOnly: true,
|
||||
throttling: {
|
||||
usages: 1,
|
||||
duration: 15
|
||||
},
|
||||
clientPermissions: ['READ_MESSAGE_HISTORY', 'MANAGE_MESSAGES'],
|
||||
userPermissions: ['MANAGE_MESSAGES'],
|
||||
args: [
|
||||
{
|
||||
key: 'count',
|
||||
label: 'amount of messages',
|
||||
prompt: 'How many messages do you want to delete? Limit of up to 99.',
|
||||
type: 'integer',
|
||||
validate: (count) => {
|
||||
if (count < 100 && count > 0) return true;
|
||||
else return 'Count must be from 1-99.';
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { count } = args;
|
||||
try {
|
||||
const messages = await msg.channel.fetchMessages({ limit: count + 1 });
|
||||
await msg.channel.bulkDelete(messages, true);
|
||||
return null;
|
||||
} catch (err) {
|
||||
return msg.say('There are no messages younger than two weeks that can be deleted.');
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1,85 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const { stripIndents } = require('common-tags');
|
||||
|
||||
module.exports = class SoftbanCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'softban',
|
||||
aliases: ['softbanne'],
|
||||
group: 'moderation',
|
||||
memberName: 'softban',
|
||||
description: 'Kicks a user and deletes their messages, and logs the softban to the mod logs.',
|
||||
guildOnly: true,
|
||||
clientPermissions: ['BAN_MEMBERS'],
|
||||
userPermissions: ['KICK_MEMBERS'],
|
||||
args: [
|
||||
{
|
||||
key: 'member',
|
||||
prompt: 'What member do you want to softban?',
|
||||
type: 'member'
|
||||
},
|
||||
{
|
||||
key: 'reason',
|
||||
prompt: 'What do you want to set the reason as?',
|
||||
type: 'string',
|
||||
validate: (reason) => {
|
||||
if (reason.length < 140) return true;
|
||||
else return 'Reason must be under 140 characters.';
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const modlogs = msg.guild.channels.filter((c) => {
|
||||
const topic = c.topic || '';
|
||||
if (topic.includes('<modlog>')) return true;
|
||||
else return false;
|
||||
}).first() || msg.guild.channels.find('name', 'mod-log');
|
||||
const { member, reason } = args;
|
||||
if (!member.bannable) return msg.say('This member is not bannable. Perhaps they have a higher role than me?');
|
||||
await msg.say(`Are you sure you want to softban ${member.user.tag} (${member.id})?`);
|
||||
const msgs = await msg.channel.awaitMessages((res) => res.author.id === msg.author.id, {
|
||||
max: 1,
|
||||
time: 30000
|
||||
});
|
||||
if (!msgs.size || !['y', 'yes'].includes(msgs.first().content.toLowerCase())) return msg.say('Aborting.');
|
||||
try {
|
||||
await member.send(stripIndents`
|
||||
You were softbanned from ${msg.guild.name}!
|
||||
Reason: ${reason}
|
||||
`);
|
||||
} catch (err) {
|
||||
await msg.say('Failed to Send DM.');
|
||||
}
|
||||
await member.ban({
|
||||
days: 7,
|
||||
reason: `${msg.author.tag}: ${reason} (Softban)`
|
||||
});
|
||||
await msg.guild.unban(member.user, 'Softban');
|
||||
await msg.say(`Successfully softbanned ${member.user.tag}.`);
|
||||
if (!modlogs || !modlogs.permissionsFor(this.client.user).has('SEND_MESSAGES')) {
|
||||
return msg.say('Could not log the softban to the mod logs.');
|
||||
} else if (modlogs.permissionsFor(this.client.user).has('EMBED_LINKS')) {
|
||||
const embed = new MessageEmbed()
|
||||
.setAuthor(msg.author.tag, msg.author.displayAvatarURL())
|
||||
.setColor(0xFF4500)
|
||||
.setTimestamp()
|
||||
.setDescription(stripIndents`
|
||||
**Member:** ${member.user.tag} (${member.id})
|
||||
**Action:** Softban
|
||||
**Reason:** ${reason}
|
||||
`);
|
||||
return modlogs.send({ embed });
|
||||
} else {
|
||||
return modlogs.send(stripIndents`
|
||||
**Member:** ${member.user.tag} (${member.id})
|
||||
**Action:** Softban
|
||||
**Reason:** ${reason}
|
||||
**Moderator:** ${msg.author.tag}
|
||||
`);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1,75 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const { stripIndents } = require('common-tags');
|
||||
|
||||
module.exports = class UnbanCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'unban',
|
||||
aliases: ['unbanne'],
|
||||
group: 'moderation',
|
||||
memberName: 'unban',
|
||||
description: 'Unbans a user and logs the unban to the mod logs.',
|
||||
guildOnly: true,
|
||||
clientPermissions: ['BAN_MEMBERS'],
|
||||
userPermissions: ['BAN_MEMBERS'],
|
||||
args: [
|
||||
{
|
||||
key: 'id',
|
||||
prompt: 'What is the id of the member you want to unban?',
|
||||
type: 'string'
|
||||
},
|
||||
{
|
||||
key: 'reason',
|
||||
prompt: 'What do you want to set the reason as?',
|
||||
type: 'string',
|
||||
validate: (reason) => {
|
||||
if (reason.length < 140) return true;
|
||||
else return 'Reason must be under 140 characters.';
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const modlogs = msg.guild.channels.filter((c) => {
|
||||
const topic = c.topic || '';
|
||||
if (topic.includes('<modlog>')) return true;
|
||||
else return false;
|
||||
}).first() || msg.guild.channels.find('name', 'mod-log');
|
||||
const { id, reason } = args;
|
||||
const bans = await msg.guild.fetchBans();
|
||||
if (!bans.has(id)) return msg.say('This ID is not in the Guild Banlist.');
|
||||
const member = bans.get(id).user;
|
||||
await msg.say(`Are you sure you want to unban ${member.tag} (${member.id})?`);
|
||||
const msgs = await msg.channel.awaitMessages((res) => res.author.id === msg.author.id, {
|
||||
max: 1,
|
||||
time: 30000
|
||||
});
|
||||
if (!msgs.size || !['y', 'yes'].includes(msgs.first().content.toLowerCase())) return msg.say('Aborting.');
|
||||
await msg.guild.unban(member, `${msg.author.tag}: ${reason}`);
|
||||
await msg.say(`Successfully unbanned ${member.user.tag}.`);
|
||||
if (!modlogs || !modlogs.permissionsFor(this.client.user).has('SEND_MESSAGES')) {
|
||||
return msg.say('Could not log the unban to the mod logs.');
|
||||
} else if (modlogs.permissionsFor(this.client.user).has('EMBED_LINKS')) {
|
||||
const embed = new MessageEmbed()
|
||||
.setAuthor(msg.author.tag, msg.author.displayAvatarURL())
|
||||
.setColor(0x00AE86)
|
||||
.setTimestamp()
|
||||
.setDescription(stripIndents`
|
||||
**Member:** ${member.user.tag} (${member.id})
|
||||
**Action:** Unban
|
||||
**Reason:** ${reason}
|
||||
`);
|
||||
return modlogs.send({ embed });
|
||||
} else {
|
||||
return modlogs.send(stripIndents`
|
||||
**Member:** ${member.user.tag} (${member.id})
|
||||
**Action:** Unban
|
||||
**Reason:** ${reason}
|
||||
**Moderator:** ${msg.author.tag}
|
||||
`);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1,78 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const { stripIndents } = require('common-tags');
|
||||
|
||||
module.exports = class WarnCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'warn',
|
||||
aliases: ['warnne'],
|
||||
group: 'moderation',
|
||||
memberName: 'warn',
|
||||
description: 'Warns a user and logs the warn to the mod logs.',
|
||||
guildOnly: true,
|
||||
userPermissions: ['KICK_MEMBERS'],
|
||||
args: [
|
||||
{
|
||||
key: 'member',
|
||||
prompt: 'What member do you want to warn?',
|
||||
type: 'member'
|
||||
},
|
||||
{
|
||||
key: 'reason',
|
||||
prompt: 'What do you want to set the reason as?',
|
||||
type: 'string',
|
||||
validate: (reason) => {
|
||||
if (reason.length < 140) return true;
|
||||
else return 'Invalid Reason. Reason must be under 140 characters.';
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const modlogs = msg.guild.channels.filter((c) => {
|
||||
const topic = c.topic || '';
|
||||
if (topic.includes('<modlog>')) return true;
|
||||
else return false;
|
||||
}).first() || msg.guild.channels.find('name', 'mod-log');
|
||||
const { member, reason } = args;
|
||||
await msg.say(`Are you sure you want to warn ${member.user.tag} (${member.id})?`);
|
||||
const msgs = await msg.channel.awaitMessages((res) => res.author.id === msg.author.id, {
|
||||
max: 1,
|
||||
time: 30000
|
||||
});
|
||||
if (!msgs.size || !['y', 'yes'].includes(msgs.first().content.toLowerCase())) return msg.say('Aborting.');
|
||||
try {
|
||||
await member.user.send(stripIndents`
|
||||
You were warned in ${msg.guild.name}!
|
||||
Reason: ${reason}
|
||||
`);
|
||||
} catch (err) {
|
||||
await msg.say('Failed to Send DM.');
|
||||
}
|
||||
await msg.say(`Successfully warned ${member.user.tag}.`);
|
||||
if (!modlogs || !modlogs.permissionsFor(this.client.user).has('SEND_MESSAGES')) {
|
||||
return msg.say('Could not log the warn to the mod logs.');
|
||||
} else if (modlogs.permissionsFor(this.client.user).has('EMBED_LINKS')) {
|
||||
const embed = new MessageEmbed()
|
||||
.setAuthor(msg.author.tag, msg.author.displayAvatarURL())
|
||||
.setColor(0xFFFF00)
|
||||
.setTimestamp()
|
||||
.setDescription(stripIndents`
|
||||
**Member:** ${member.user.tag} (${member.id})
|
||||
**Action:** Warn
|
||||
**Reason:** ${reason}
|
||||
`);
|
||||
return modlogs.send({ embed });
|
||||
} else {
|
||||
return modlogs.send(stripIndents`
|
||||
**Member:** ${member.user.tag} (${member.id})
|
||||
**Action:** Warn
|
||||
**Reason:** ${reason}
|
||||
**Moderator:** ${msg.author.tag}
|
||||
`);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1,54 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const snekfetch = require('snekfetch');
|
||||
const codes = require('../../assets/json/currency');
|
||||
|
||||
module.exports = class CurrencyCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'currency',
|
||||
group: 'num-edit',
|
||||
memberName: 'currency',
|
||||
description: 'Converts a number from one currency to another.',
|
||||
details: `**Codes:** ${codes.join(', ')}`,
|
||||
args: [
|
||||
{
|
||||
key: 'base',
|
||||
prompt: 'What currency code do you want to use as the base?',
|
||||
type: 'string',
|
||||
validate: (base) => {
|
||||
if (codes.includes(base.toUpperCase())) return true;
|
||||
else return 'Invalid Currency Code. Use `help currency` to view a list of currency codes.';
|
||||
},
|
||||
parse: (base) => base.toUpperCase()
|
||||
},
|
||||
{
|
||||
key: 'to',
|
||||
prompt: 'What currency code do you want to convert to?',
|
||||
type: 'string',
|
||||
validate: (to) => {
|
||||
if (codes.includes(to.toUpperCase())) return true;
|
||||
else return 'Invalid Currency Code. Use `help currency` to view a list of currency codes.';
|
||||
},
|
||||
parse: (to) => to.toUpperCase()
|
||||
},
|
||||
{
|
||||
key: 'amount',
|
||||
prompt: 'How much money should be converted? Do not use symbols.',
|
||||
type: 'integer'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { base, to, amount } = args;
|
||||
if (base === to) return msg.say(`Converting ${base} to ${to} is the same value, dummy.`);
|
||||
const { body } = await snekfetch
|
||||
.get('http://api.fixer.io/latest')
|
||||
.query({
|
||||
base,
|
||||
symbols: to
|
||||
});
|
||||
return msg.say(`${amount} ${base} is ${amount * body.rates[to]} ${to}.`);
|
||||
}
|
||||
};
|
||||
@@ -1,30 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const math = require('mathjs');
|
||||
|
||||
module.exports = class MathCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'math',
|
||||
group: 'num-edit',
|
||||
memberName: 'math',
|
||||
description: 'Evaluates math expressions.',
|
||||
args: [
|
||||
{
|
||||
key: 'expression',
|
||||
prompt: 'What do you want to answer?',
|
||||
type: 'string'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { expression } = args;
|
||||
try {
|
||||
const solved = math.eval(expression).toString();
|
||||
return msg.say(solved).catch(() => msg.say('Invalid Statement'));
|
||||
} catch (err) {
|
||||
return msg.say('Invalid Statement');
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1,55 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
|
||||
module.exports = class TemperatureCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'temperature',
|
||||
group: 'num-edit',
|
||||
memberName: 'temperature',
|
||||
description: 'Converts temperatures to/from Celsius, Fahrenheit, or Kelvin.',
|
||||
args: [
|
||||
{
|
||||
key: 'base',
|
||||
prompt: 'What temperature unit do you want to use as the base?',
|
||||
type: 'string',
|
||||
validate: (base) => {
|
||||
if (['celsius', 'fahrenheit', 'kelvin'].includes(base.toLowerCase())) return true;
|
||||
else return 'Please enter either celsius, fahrenheit, or kelvin.';
|
||||
},
|
||||
parse: (base) => base.toLowerCase()
|
||||
},
|
||||
{
|
||||
key: 'to',
|
||||
prompt: 'What temperature unit do you want to convert to?',
|
||||
type: 'string',
|
||||
validate: (to) => {
|
||||
if (['celsius', 'fahrenheit', 'kelvin'].includes(to.toLowerCase())) return true;
|
||||
else return 'Please enter either celsius, fahrenheit, or kelvin.';
|
||||
},
|
||||
parse: (to) => to.toLowerCase()
|
||||
},
|
||||
{
|
||||
key: 'amount',
|
||||
prompt: 'What temperature should be converted?',
|
||||
type: 'integer'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) { // eslint-disable-line consistent-return
|
||||
const { base, to, amount } = args;
|
||||
if (base === to) {
|
||||
return msg.say(`Converting ${base} to ${to} is the same value, dummy.`);
|
||||
} else if (base === 'celsius') {
|
||||
if (to === 'fahrenheit') return msg.say(`${amount}°C is ${(amount * 1.8) + 32}°F.`);
|
||||
else if (to === 'kelvin') return msg.say(`${amount}°C is ${amount + 273.15}°K.`);
|
||||
} else if (base === 'fahrenheit') {
|
||||
if (to === 'celsius') return msg.say(`${amount}°F is ${(amount - 32) / 1.8}°C.`);
|
||||
else if (to === 'kelvin') return msg.say(`${amount}°F is ${(amount + 459.67) * (5 / 9)}°K.`);
|
||||
} else if (base === 'kelvin') {
|
||||
if (to === 'celsius') return msg.say(`${amount}°K is ${amount - 273.15}°C.`);
|
||||
else if (to === 'fahrenheit') return msg.say(`${amount}°K is ${(amount * 1.8) - 459.67}°F.`);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1,20 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const snekfetch = require('snekfetch');
|
||||
|
||||
module.exports = class CatCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'cat',
|
||||
aliases: ['neko'],
|
||||
group: 'random-img',
|
||||
memberName: 'cat',
|
||||
description: 'Responds with a random cat image.'
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg) {
|
||||
const { body } = await snekfetch
|
||||
.get('http://random.cat/meow');
|
||||
return msg.say(body.file);
|
||||
}
|
||||
};
|
||||
@@ -1,19 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const snekfetch = require('snekfetch');
|
||||
|
||||
module.exports = class DogCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'dog',
|
||||
group: 'random-img',
|
||||
memberName: 'dog',
|
||||
description: 'Responds with a random dog image.'
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg) {
|
||||
const { body } = await snekfetch
|
||||
.get('https://random.dog/woof.json');
|
||||
return msg.say(body.url);
|
||||
}
|
||||
};
|
||||
@@ -1,18 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const songs = require('../../assets/json/vocaloid');
|
||||
|
||||
module.exports = class VocaloidCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'vocaloid',
|
||||
group: 'random-img',
|
||||
memberName: 'vocaloid',
|
||||
description: 'Responds with a random VOCALOID song.'
|
||||
});
|
||||
}
|
||||
|
||||
run(msg) {
|
||||
const song = songs[Math.floor(Math.random() * songs.length)];
|
||||
return msg.say(song);
|
||||
}
|
||||
};
|
||||
@@ -1,20 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const xiaos = require('../../assets/json/xiao');
|
||||
|
||||
module.exports = class XiaoCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'xiao',
|
||||
aliases: ['xiao-pai'],
|
||||
group: 'random-img',
|
||||
memberName: 'xiao',
|
||||
description: 'Responds with a random image of Xiao Pai.',
|
||||
clientPermissions: ['ATTACH_FILES']
|
||||
});
|
||||
}
|
||||
|
||||
run(msg) {
|
||||
const xiao = xiaos[Math.floor(Math.random() * xiaos.length)];
|
||||
return msg.say({ files: [xiao] });
|
||||
}
|
||||
};
|
||||
@@ -1,30 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { stripIndents } = require('common-tags');
|
||||
const answers = require('../../assets/json/8-ball');
|
||||
|
||||
module.exports = class MagicBallCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: '8-ball',
|
||||
group: 'random-res',
|
||||
memberName: '8-ball',
|
||||
description: 'Asks your question to the Magic 8 Ball.',
|
||||
args: [
|
||||
{
|
||||
key: 'question',
|
||||
prompt: 'What do you want to ask the 8 ball?',
|
||||
type: 'string'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { question } = args;
|
||||
const answer = answers[Math.floor(Math.random() * answers.length)];
|
||||
return msg.say(stripIndents`
|
||||
Question: ${question}
|
||||
:8ball: ${answer} :8ball:
|
||||
`);
|
||||
}
|
||||
};
|
||||
@@ -1,26 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
|
||||
module.exports = class ChooseCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'choose',
|
||||
group: 'random-res',
|
||||
memberName: 'choose',
|
||||
description: 'Chooses between options you provide.',
|
||||
args: [
|
||||
{
|
||||
key: 'choices',
|
||||
prompt: 'What choices do you want me pick from?',
|
||||
type: 'string',
|
||||
infinite: true
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { choices } = args;
|
||||
const choice = choices[Math.floor(Math.random() * choices.length)];
|
||||
return msg.say(`I choose ${choice}!`);
|
||||
}
|
||||
};
|
||||
@@ -1,19 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const sides = ['heads', 'tails'];
|
||||
|
||||
module.exports = class CoinFlipCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'coin',
|
||||
aliases: ['coin-flip', 'flip'],
|
||||
group: 'random-res',
|
||||
memberName: 'coin',
|
||||
description: 'Flips a coin.'
|
||||
});
|
||||
}
|
||||
|
||||
run(msg) {
|
||||
const side = sides[Math.floor(Math.random() * sides.length)];
|
||||
return msg.say(`It landed on ${side}!`);
|
||||
}
|
||||
};
|
||||
@@ -1,27 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const compliments = require('../../assets/json/compliment');
|
||||
|
||||
module.exports = class ComplimentCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'compliment',
|
||||
group: 'random-res',
|
||||
memberName: 'compliment',
|
||||
description: 'Compliments a user.',
|
||||
args: [
|
||||
{
|
||||
key: 'user',
|
||||
prompt: 'What user do you want to compliment?',
|
||||
type: 'user',
|
||||
default: ''
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const user = args.user || msg.author;
|
||||
const compliment = compliments[Math.floor(Math.random() * compliments.length)];
|
||||
return msg.say(`${user.username}, ${compliment}`);
|
||||
}
|
||||
};
|
||||
@@ -1,18 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const facts = require('../../assets/json/fact-core');
|
||||
|
||||
module.exports = class FactCoreCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'fact-core',
|
||||
group: 'random-res',
|
||||
memberName: 'fact-core',
|
||||
description: 'Responds with a random Fact Core quote.'
|
||||
});
|
||||
}
|
||||
|
||||
run(msg) {
|
||||
const fact = facts[Math.floor(Math.random() * facts.length)];
|
||||
return msg.say(fact);
|
||||
}
|
||||
};
|
||||
@@ -1,18 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const fishes = [':fish:', ':tropical_fish:', ':blowfish:', ':wrench:'];
|
||||
|
||||
module.exports = class FishyCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'fishy',
|
||||
group: 'random-res',
|
||||
memberName: 'fishy',
|
||||
description: 'Catches a fish.'
|
||||
});
|
||||
}
|
||||
|
||||
run(msg) {
|
||||
const fish = fishes[Math.floor(Math.random() * fishes.length)];
|
||||
return msg.say(`You caught a: ${fish}`);
|
||||
}
|
||||
};
|
||||
@@ -1,19 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const fortunes = require('../../assets/json/fortune');
|
||||
|
||||
module.exports = class FortuneCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'fortune',
|
||||
aliases: ['fortune-cookie'],
|
||||
group: 'random-res',
|
||||
memberName: 'fortune',
|
||||
description: 'Responds with a random fortune.'
|
||||
});
|
||||
}
|
||||
|
||||
run(msg) {
|
||||
const fortune = fortunes[Math.floor(Math.random() * fortunes.length)];
|
||||
return msg.say(fortune);
|
||||
}
|
||||
};
|
||||
@@ -1,30 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { stripIndents } = require('common-tags');
|
||||
const answers = require('../../assets/json/magic-conch');
|
||||
|
||||
module.exports = class MagicConchCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'magic-conch',
|
||||
group: 'random-res',
|
||||
memberName: 'magic-conch',
|
||||
description: 'Asks your question to the Magic Conch.',
|
||||
args: [
|
||||
{
|
||||
key: 'question',
|
||||
prompt: 'What do you want to ask the magic conch?',
|
||||
type: 'string'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { question } = args;
|
||||
const answer = answers[Math.floor(Math.random() * answers.length)];
|
||||
return msg.say(stripIndents`
|
||||
Question: ${question}
|
||||
:shell: ${answer} :shell:
|
||||
`);
|
||||
}
|
||||
};
|
||||
@@ -1,48 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { lastNames, maleNames, femaleNames } = require('../../assets/json/name');
|
||||
|
||||
module.exports = class RandomNameCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'name',
|
||||
group: 'random-res',
|
||||
memberName: 'name',
|
||||
description: 'Responds with a random name, with the gender of your choice.',
|
||||
args: [
|
||||
{
|
||||
key: 'gender',
|
||||
prompt: 'Which gender do you want to generate a name for?',
|
||||
type: 'string',
|
||||
default: 'both',
|
||||
validate: (gender) => {
|
||||
if (['male', 'female', 'both'].includes(gender.toLowerCase())) return true;
|
||||
else return 'Please enter either male, female, or both.';
|
||||
},
|
||||
parse: (gender) => gender.toLowerCase()
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) { // eslint-disable-line consistent-return
|
||||
const { gender } = args;
|
||||
const lastName = lastNames[Math.floor(Math.random() * lastNames.length)];
|
||||
if (gender === 'male') {
|
||||
const name = maleNames[Math.floor(Math.random() * maleNames.length)];
|
||||
return msg.say(`${name} ${lastName}`);
|
||||
} else if (gender === 'female') {
|
||||
const name = femaleNames[Math.floor(Math.random() * femaleNames.length)];
|
||||
return msg.say(`${name} ${lastName}`);
|
||||
} else if (gender === 'both') {
|
||||
const genders = ['male', 'female'];
|
||||
const randomGender = genders[Math.floor(Math.random() * genders.length)];
|
||||
if (randomGender === 'male') {
|
||||
const name = maleNames[Math.floor(Math.random() * maleNames.length)];
|
||||
return msg.say(`${name} ${lastName}`);
|
||||
} else if (randomGender === 'female') {
|
||||
const name = femaleNames[Math.floor(Math.random() * femaleNames.length)];
|
||||
return msg.say(`${name} ${lastName}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1,18 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const genders = ['boy', 'girl'];
|
||||
|
||||
module.exports = class OffspringCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'offspring',
|
||||
group: 'random-res',
|
||||
memberName: 'offspring',
|
||||
description: 'Decides if your new child will be a boy or a girl.'
|
||||
});
|
||||
}
|
||||
|
||||
run(msg) {
|
||||
const gender = genders[Math.floor(Math.random() * genders.length)];
|
||||
return msg.say(`It's a ${gender}!`);
|
||||
}
|
||||
};
|
||||
@@ -1,19 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const sides = ['on nothing', 'on NaN', 'on 0', 'in the air', 'on null'];
|
||||
|
||||
module.exports = class QuantumCoinCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'quantum-coin',
|
||||
aliases: ['q-coin'],
|
||||
group: 'random-res',
|
||||
memberName: 'quantum-coin',
|
||||
description: 'Flips a coin that lands on some form of nothing.'
|
||||
});
|
||||
}
|
||||
|
||||
run(msg) {
|
||||
const side = sides[Math.floor(Math.random() * sides.length)];
|
||||
return msg.say(`It landed ${side}.`);
|
||||
}
|
||||
};
|
||||
@@ -1,26 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
|
||||
module.exports = class RateWaifuCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'rate-waifu',
|
||||
aliases: ['waifu'],
|
||||
group: 'random-res',
|
||||
memberName: 'rate-waifu',
|
||||
description: 'Rates your waifu.',
|
||||
args: [
|
||||
{
|
||||
key: 'waifu',
|
||||
prompt: 'Who do you want to rate?',
|
||||
type: 'string'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { waifu } = args;
|
||||
const rating = Math.floor(Math.random() * 10) + 1;
|
||||
return msg.say(`I'd give ${waifu} a ${rating}/10!`);
|
||||
}
|
||||
};
|
||||
@@ -1,27 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const roasts = require('../../assets/json/roast');
|
||||
|
||||
module.exports = class RoastCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'roast',
|
||||
group: 'random-res',
|
||||
memberName: 'roast',
|
||||
description: 'Roasts a user.',
|
||||
args: [
|
||||
{
|
||||
key: 'user',
|
||||
prompt: 'What user do you want to roast?',
|
||||
type: 'user',
|
||||
default: ''
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const user = args.user || msg.author;
|
||||
const roast = roasts[Math.floor(Math.random() * roasts.length)];
|
||||
return msg.say(`${user.username}, ${roast}`);
|
||||
}
|
||||
};
|
||||
@@ -1,28 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
|
||||
module.exports = class RollCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'roll',
|
||||
aliases: ['dice'],
|
||||
group: 'random-res',
|
||||
memberName: 'roll',
|
||||
description: 'Rolls a dice with a maximum value of your choice.',
|
||||
args: [
|
||||
{
|
||||
key: 'value',
|
||||
label: 'maximum number',
|
||||
prompt: 'What is the maximum number you wish to appear?',
|
||||
type: 'integer',
|
||||
default: 6
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { value } = args;
|
||||
const roll = Math.floor(Math.random() * value) + 1;
|
||||
return msg.say(`You rolled a ${roll}.`);
|
||||
}
|
||||
};
|
||||
@@ -1,17 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
|
||||
module.exports = class RouletteCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'roulette',
|
||||
group: 'random-res',
|
||||
memberName: 'roulette',
|
||||
description: 'Chooses a random member of the server.',
|
||||
guildOnly: true
|
||||
});
|
||||
}
|
||||
|
||||
run(msg) {
|
||||
return msg.say(`I choose ${msg.guild.members.random().displayName}!`);
|
||||
}
|
||||
};
|
||||
@@ -1,27 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
|
||||
module.exports = class ShipCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'ship',
|
||||
group: 'random-res',
|
||||
memberName: 'ship',
|
||||
description: 'Ships things/people together.',
|
||||
args: [
|
||||
{
|
||||
key: 'things',
|
||||
prompt: 'What do you want to ship together?',
|
||||
type: 'string',
|
||||
infinite: true
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { things } = args;
|
||||
const rating = Math.floor(Math.random() * 100) + 1;
|
||||
const list = `${things.slice(0, -1).join(', ')}${things.length > 1 ? ' and ' : ''}${things.slice(-1)}`;
|
||||
return msg.say(`I'd give ${list} a ${rating}%!`);
|
||||
}
|
||||
};
|
||||
@@ -1,31 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const eastereggs = require('../../assets/json/easter-egg');
|
||||
|
||||
module.exports = class EasterEggCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'easter-egg',
|
||||
aliases: ['tag'],
|
||||
group: 'random',
|
||||
memberName: 'easter-egg',
|
||||
description: 'Can you discover all the easter eggs?',
|
||||
args: [
|
||||
{
|
||||
key: 'tag',
|
||||
prompt: 'What easter egg do you want to view?',
|
||||
type: 'string',
|
||||
validate: (tag) => {
|
||||
if (eastereggs[tag.toLowerCase()]) return true;
|
||||
else return 'Nope, that\'s not a valid easter egg. Try again!';
|
||||
},
|
||||
parse: (tag) => tag.toLowerCase()
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { tag } = args;
|
||||
return msg.say(eastereggs[tag]);
|
||||
}
|
||||
};
|
||||
@@ -1,16 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
|
||||
module.exports = class GiveFlowerCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'give-flower',
|
||||
group: 'random',
|
||||
memberName: 'give-flower',
|
||||
description: 'Gives Xiao Pai a flower.'
|
||||
});
|
||||
}
|
||||
|
||||
run(msg) {
|
||||
return msg.say('Ooh, what a pretty flower. What, I may have it? Thanks! I like flowers, yes? ♪');
|
||||
}
|
||||
};
|
||||
@@ -1,48 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const snekfetch = require('snekfetch');
|
||||
const signs = require('../../assets/json/horoscope');
|
||||
|
||||
module.exports = class HoroscopeCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'horoscope',
|
||||
group: 'random',
|
||||
memberName: 'horoscope',
|
||||
description: 'Responds with today\'s horoscope for a particular sign.',
|
||||
details: `**Signs:** ${signs.join(', ')}`,
|
||||
clientPermissions: ['EMBED_LINKS'],
|
||||
args: [
|
||||
{
|
||||
key: 'sign',
|
||||
prompt: 'Which sign would you like to get the horoscope for?',
|
||||
type: 'string',
|
||||
validate: (sign) => {
|
||||
if (signs.includes(sign.toLowerCase())) return true;
|
||||
else return 'Invalid sign. Use `help horoscope` for a list of signs.';
|
||||
},
|
||||
parse: (sign) => sign.toLowerCase()
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { sign } = args;
|
||||
const { text } = await snekfetch
|
||||
.get(`http://sandipbgt.com/theastrologer/api/horoscope/${sign}/today`);
|
||||
const body = JSON.parse(text);
|
||||
const embed = new MessageEmbed()
|
||||
.setColor(0x9797FF)
|
||||
.setTitle(`Horoscope for ${body.sunsign}...`)
|
||||
.setTimestamp()
|
||||
.setDescription(body.horoscope)
|
||||
.addField('Mood',
|
||||
body.meta.mood, true)
|
||||
.addField('Intensity',
|
||||
body.meta.intensity, true)
|
||||
.addField('Date',
|
||||
body.date, true);
|
||||
return msg.embed(embed);
|
||||
}
|
||||
};
|
||||
@@ -1,16 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
|
||||
module.exports = class LennyCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'lenny',
|
||||
group: 'random',
|
||||
memberName: 'lenny',
|
||||
description: 'Responds with the lenny face.'
|
||||
});
|
||||
}
|
||||
|
||||
run(msg) {
|
||||
return msg.say('( ͡° ͜ʖ ͡°)');
|
||||
}
|
||||
};
|
||||
@@ -1,25 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
|
||||
module.exports = class LMGTFYCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'lmgtfy',
|
||||
group: 'random',
|
||||
memberName: 'lmgtfy',
|
||||
description: 'Creates a LMGTFY link with the query you provide.',
|
||||
args: [
|
||||
{
|
||||
key: 'query',
|
||||
prompt: 'What would you like the link to search for?',
|
||||
type: 'string',
|
||||
parse: (query) => encodeURIComponent(query)
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { query } = args;
|
||||
return msg.say(`http://lmgtfy.com/?iie=1&q=${query}`);
|
||||
}
|
||||
};
|
||||
@@ -1,41 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
|
||||
module.exports = class PortalSendCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'portal-send',
|
||||
group: 'random',
|
||||
memberName: 'portal-send',
|
||||
description: 'Send a message to a random channel that has a portal open.',
|
||||
guildOnly: true,
|
||||
args: [
|
||||
{
|
||||
key: 'message',
|
||||
prompt: 'What message do you want to send?',
|
||||
type: 'string',
|
||||
validate: (message) => {
|
||||
if (message.length > 1500) return 'Message must be under 1500 characters.';
|
||||
else if (!/(discord(\.gg\/|app\.com\/invite\/|\.me\/))/gi.test(message)) return true;
|
||||
else return 'Please do not send invites.';
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { message } = args;
|
||||
const channel = this.client.channels.filter((c) => {
|
||||
if (c.type !== 'text' || !c.topic || msg.guild.id === c.guild.id) return false;
|
||||
else if (c.topic.includes('<portal>')) return true;
|
||||
else return false;
|
||||
}).random();
|
||||
if (!channel) return msg.say('Aww... No channel has an open portal...');
|
||||
try {
|
||||
await channel.send(`**${msg.author.tag} (${msg.guild.name}):** ${message}`);
|
||||
return msg.say(`Message sent to **${channel.guild.name}**!`);
|
||||
} catch (err) {
|
||||
return msg.say('Failed to send message...');
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1,17 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
|
||||
module.exports = class SpamCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'spam',
|
||||
group: 'random',
|
||||
memberName: 'spam',
|
||||
description: 'Responds with a picture of Spam.',
|
||||
clientPermissions: ['ATTACH_FILES']
|
||||
});
|
||||
}
|
||||
|
||||
run(msg) {
|
||||
return msg.say({ files: ['https://i.imgur.com/arx7GJV.jpg'] });
|
||||
}
|
||||
};
|
||||
@@ -1,48 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { stripIndents } = require('common-tags');
|
||||
const snekfetch = require('snekfetch');
|
||||
|
||||
module.exports = class StrawpollCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'strawpoll',
|
||||
group: 'random',
|
||||
memberName: 'strawpoll',
|
||||
description: 'Creates a Strawpoll from the options you provide.',
|
||||
args: [
|
||||
{
|
||||
key: 'title',
|
||||
prompt: 'What would you like the title of the Strawpoll to be?',
|
||||
type: 'string',
|
||||
validate: (title) => {
|
||||
if (title.length < 200) return true;
|
||||
else return 'Title must be under 200 characters.';
|
||||
}
|
||||
},
|
||||
{
|
||||
key: 'options',
|
||||
prompt: 'What options do you want to be able to pick from? Maximum of 30.',
|
||||
type: 'string',
|
||||
infinite: true,
|
||||
validate: (choice) => {
|
||||
if (choice.length < 140) return true;
|
||||
else return 'Choices must be under 140 characters each.';
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { title, options } = args;
|
||||
if (options.length < 2) return msg.say('You provided less than two choices.');
|
||||
if (options.length > 31) return msg.say('You provided more than thirty choices.');
|
||||
const { body } = await snekfetch
|
||||
.post('https://strawpoll.me/api/v2/polls')
|
||||
.send({ title, options });
|
||||
return msg.say(stripIndents`
|
||||
${body.title}
|
||||
http://strawpoll.me/${body.id}
|
||||
`);
|
||||
}
|
||||
};
|
||||
@@ -1,30 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const snekfetch = require('snekfetch');
|
||||
|
||||
module.exports = class TodayCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'today',
|
||||
group: 'random',
|
||||
memberName: 'today',
|
||||
description: 'Responds with a random event that occurred today sometime in history.',
|
||||
clientPermissions: ['EMBED_LINKS']
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg) {
|
||||
const { text } = await snekfetch
|
||||
.get('http://history.muffinlabs.com/date');
|
||||
const body = JSON.parse(text);
|
||||
const events = body.data.Events;
|
||||
const event = events[Math.floor(Math.random() * events.length)];
|
||||
const embed = new MessageEmbed()
|
||||
.setColor(0x9797FF)
|
||||
.setURL(body.url)
|
||||
.setTitle(`On this day (${body.date})...`)
|
||||
.setTimestamp()
|
||||
.setDescription(`${event.year}: ${event.text}`);
|
||||
return msg.embed(embed);
|
||||
}
|
||||
};
|
||||
@@ -1,27 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const snekfetch = require('snekfetch');
|
||||
|
||||
module.exports = class WouldYouRatherCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'would-you-rather',
|
||||
aliases: ['wy-rather'],
|
||||
group: 'random',
|
||||
memberName: 'would-you-rather',
|
||||
description: 'Responds with a random would you rather question.',
|
||||
clientPermissions: ['EMBED_LINKS']
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg) {
|
||||
const { body } = await snekfetch
|
||||
.get('http://www.rrrather.com/botapi');
|
||||
const embed = new MessageEmbed()
|
||||
.setTitle(`${body.title}...`)
|
||||
.setURL(body.link)
|
||||
.setColor(0x9797FF)
|
||||
.setDescription(`${body.choicea} OR ${body.choiceb}?`);
|
||||
return msg.embed(embed);
|
||||
}
|
||||
};
|
||||
@@ -1,28 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { stripIndents } = require('common-tags');
|
||||
|
||||
module.exports = class CuddleCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'cuddle',
|
||||
group: 'roleplay',
|
||||
memberName: 'cuddle',
|
||||
description: 'Cuddles a user.',
|
||||
args: [
|
||||
{
|
||||
key: 'user',
|
||||
prompt: 'What user do you want to roleplay with?',
|
||||
type: 'user'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { user } = args;
|
||||
return msg.say(stripIndents`
|
||||
**${msg.author.username}** *cuddles* **${user.username}**
|
||||
https://i.imgur.com/0yAIWbg.gif
|
||||
`);
|
||||
}
|
||||
};
|
||||
@@ -1,28 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { stripIndents } = require('common-tags');
|
||||
|
||||
module.exports = class DivorceCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'divorce',
|
||||
group: 'roleplay',
|
||||
memberName: 'divorce',
|
||||
description: 'Divorces a user.',
|
||||
args: [
|
||||
{
|
||||
key: 'user',
|
||||
prompt: 'What user do you want to roleplay with?',
|
||||
type: 'user'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { user } = args;
|
||||
return msg.say(stripIndents`
|
||||
**${msg.author.username}** *divorces* **${user.username}**
|
||||
https://i.imgur.com/IgvLWaa.gif
|
||||
`);
|
||||
}
|
||||
};
|
||||
@@ -1,28 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { stripIndents } = require('common-tags');
|
||||
|
||||
module.exports = class EatCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'eat',
|
||||
group: 'roleplay',
|
||||
memberName: 'eat',
|
||||
description: 'Eats a user.',
|
||||
args: [
|
||||
{
|
||||
key: 'user',
|
||||
prompt: 'What user do you want to roleplay with?',
|
||||
type: 'user'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { user } = args;
|
||||
return msg.say(stripIndents`
|
||||
**${msg.author.username}** *eats* **${user.username}**
|
||||
https://i.imgur.com/O7FQ5kz.gif
|
||||
`);
|
||||
}
|
||||
};
|
||||
@@ -1,28 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { stripIndents } = require('common-tags');
|
||||
|
||||
module.exports = class FalconPunchCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'falcon-punch',
|
||||
group: 'roleplay',
|
||||
memberName: 'falcon-punch',
|
||||
description: 'Falcon Punches a user.',
|
||||
args: [
|
||||
{
|
||||
key: 'user',
|
||||
prompt: 'What user do you want to roleplay with?',
|
||||
type: 'user'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { user } = args;
|
||||
return msg.say(stripIndents`
|
||||
**${msg.author.username}** *falcon punches* **${user.username}**
|
||||
https://i.imgur.com/LOuK637.gif
|
||||
`);
|
||||
}
|
||||
};
|
||||
@@ -1,28 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { stripIndents } = require('common-tags');
|
||||
|
||||
module.exports = class FistBumpCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'fist-bump',
|
||||
group: 'roleplay',
|
||||
memberName: 'fist-bump',
|
||||
description: 'Fistbumps a user.',
|
||||
args: [
|
||||
{
|
||||
key: 'user',
|
||||
prompt: 'What user do you want to roleplay with?',
|
||||
type: 'user'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { user } = args;
|
||||
return msg.say(stripIndents`
|
||||
**${msg.author.username}** *fist-bumps* **${user.username}**
|
||||
*badalalala* https://i.imgur.com/lO2xZHC.gif
|
||||
`);
|
||||
}
|
||||
};
|
||||
@@ -1,28 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { stripIndents } = require('common-tags');
|
||||
|
||||
module.exports = class HighFivesCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'high-five',
|
||||
group: 'roleplay',
|
||||
memberName: 'high-five',
|
||||
description: 'High Fives a user.',
|
||||
args: [
|
||||
{
|
||||
key: 'user',
|
||||
prompt: 'What user do you want to roleplay with?',
|
||||
type: 'user'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { user } = args;
|
||||
return msg.say(stripIndents`
|
||||
**${msg.author.username}** *high-fives* **${user.username}**
|
||||
https://media.giphy.com/media/x58AS8I9DBRgA/giphy.gif
|
||||
`);
|
||||
}
|
||||
};
|
||||
@@ -1,28 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { stripIndents } = require('common-tags');
|
||||
|
||||
module.exports = class HitwithShovelCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'hit-with-shovel',
|
||||
group: 'roleplay',
|
||||
memberName: 'hit-with-shovel',
|
||||
description: 'Hits a user with a shovel.',
|
||||
args: [
|
||||
{
|
||||
key: 'user',
|
||||
prompt: 'What user do you want to roleplay with?',
|
||||
type: 'user'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { user } = args;
|
||||
return msg.say(stripIndents`
|
||||
**${msg.author.username}** *hits* **${user.username}** *with a shovel*
|
||||
https://i.imgur.com/4yvqw81.gif
|
||||
`);
|
||||
}
|
||||
};
|
||||
@@ -1,28 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { stripIndents } = require('common-tags');
|
||||
|
||||
module.exports = class HugCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'hug',
|
||||
group: 'roleplay',
|
||||
memberName: 'hug',
|
||||
description: 'Hugs a user.',
|
||||
args: [
|
||||
{
|
||||
key: 'user',
|
||||
prompt: 'What user do you want to roleplay with?',
|
||||
type: 'user'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { user } = args;
|
||||
return msg.say(stripIndents`
|
||||
**${msg.author.username}** *hugs* **${user.username}**
|
||||
https://i.imgur.com/q9Wkhz4.gif
|
||||
`);
|
||||
}
|
||||
};
|
||||
@@ -1,28 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { stripIndents } = require('common-tags');
|
||||
|
||||
module.exports = class InhaleCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'inhale',
|
||||
group: 'roleplay',
|
||||
memberName: 'inhale',
|
||||
description: 'Inhales a user.',
|
||||
args: [
|
||||
{
|
||||
key: 'user',
|
||||
prompt: 'What user do you want to roleplay with?',
|
||||
type: 'user'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { user } = args;
|
||||
return msg.say(stripIndents`
|
||||
**${msg.author.username}** *inhales* **${user.username}** *but gained no ability...*
|
||||
https://i.imgur.com/b4NeOXj.gif
|
||||
`);
|
||||
}
|
||||
};
|
||||
@@ -1,28 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { stripIndents } = require('common-tags');
|
||||
|
||||
module.exports = class KillCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'kill',
|
||||
group: 'roleplay',
|
||||
memberName: 'kill',
|
||||
description: 'Kills a user.',
|
||||
args: [
|
||||
{
|
||||
key: 'user',
|
||||
prompt: 'What user do you want to roleplay with?',
|
||||
type: 'user'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { user } = args;
|
||||
return msg.say(stripIndents`
|
||||
**${msg.author.username}** *kills* **${user.username}**
|
||||
https://i.imgur.com/WxD4XMe.gif
|
||||
`);
|
||||
}
|
||||
};
|
||||
@@ -1,28 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { stripIndents } = require('common-tags');
|
||||
|
||||
module.exports = class KissCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'kiss',
|
||||
group: 'roleplay',
|
||||
memberName: 'kiss',
|
||||
description: 'Kisses a user.',
|
||||
args: [
|
||||
{
|
||||
key: 'user',
|
||||
prompt: 'What user do you want to roleplay with?',
|
||||
type: 'user'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { user } = args;
|
||||
return msg.say(stripIndents`
|
||||
**${msg.author.username}** *kisses* **${user.username}**
|
||||
https://i.imgur.com/S7mwPfE.gif
|
||||
`);
|
||||
}
|
||||
};
|
||||
@@ -1,28 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { stripIndents } = require('common-tags');
|
||||
|
||||
module.exports = class MarryCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'marry',
|
||||
group: 'roleplay',
|
||||
memberName: 'marry',
|
||||
description: 'Marries a user.',
|
||||
args: [
|
||||
{
|
||||
key: 'user',
|
||||
prompt: 'What user do you want to roleplay with?',
|
||||
type: 'user'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { user } = args;
|
||||
return msg.say(stripIndents`
|
||||
**${msg.author.username}** *marries* **${user.username}**
|
||||
https://i.imgur.com/u67QLhB.gif
|
||||
`);
|
||||
}
|
||||
};
|
||||
@@ -1,28 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { stripIndents } = require('common-tags');
|
||||
|
||||
module.exports = class PatCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'pat',
|
||||
group: 'roleplay',
|
||||
memberName: 'pat',
|
||||
description: 'Pats a user.',
|
||||
args: [
|
||||
{
|
||||
key: 'user',
|
||||
prompt: 'What user do you want to roleplay with?',
|
||||
type: 'user'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { user } = args;
|
||||
return msg.say(stripIndents`
|
||||
**${msg.author.username}** *pats* **${user.username}**
|
||||
https://i.imgur.com/oynHZmT.gif
|
||||
`);
|
||||
}
|
||||
};
|
||||
@@ -1,28 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { stripIndents } = require('common-tags');
|
||||
|
||||
module.exports = class PokeCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'poke',
|
||||
group: 'roleplay',
|
||||
memberName: 'poke',
|
||||
description: 'Pokes a user.',
|
||||
args: [
|
||||
{
|
||||
key: 'user',
|
||||
prompt: 'What user do you want to roleplay with?',
|
||||
type: 'user'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { user } = args;
|
||||
return msg.say(stripIndents`
|
||||
**${msg.author.username}** *pokes* **${user.username}**
|
||||
https://i.imgur.com/XMuJ7K8.gif
|
||||
`);
|
||||
}
|
||||
};
|
||||
@@ -1,28 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { stripIndents } = require('common-tags');
|
||||
|
||||
module.exports = class PunchCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'punch',
|
||||
group: 'roleplay',
|
||||
memberName: 'punch',
|
||||
description: 'Punches a user.',
|
||||
args: [
|
||||
{
|
||||
key: 'user',
|
||||
prompt: 'What user do you want to roleplay with?',
|
||||
type: 'user'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { user } = args;
|
||||
return msg.say(stripIndents`
|
||||
**${msg.author.username}** *punches* **${user.username}**
|
||||
https://i.imgur.com/WKj10Dc.gif
|
||||
`);
|
||||
}
|
||||
};
|
||||
@@ -1,28 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { stripIndents } = require('common-tags');
|
||||
|
||||
module.exports = class SlapCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'slap',
|
||||
group: 'roleplay',
|
||||
memberName: 'slap',
|
||||
description: 'Slaps a user.',
|
||||
args: [
|
||||
{
|
||||
key: 'user',
|
||||
prompt: 'What user do you want to roleplay with?',
|
||||
type: 'user'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { user } = args;
|
||||
return msg.say(stripIndents`
|
||||
**${msg.author.username}** *slaps* **${user.username}**
|
||||
https://i.imgur.com/rfy8z2K.gif
|
||||
`);
|
||||
}
|
||||
};
|
||||
@@ -1,56 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const snekfetch = require('snekfetch');
|
||||
const { cleanXML } = require('../../structures/Util');
|
||||
const { promisifyAll } = require('tsubaki');
|
||||
const xml = promisifyAll(require('xml2js'));
|
||||
const { animelistLogin } = require('../../config');
|
||||
|
||||
module.exports = class AnimeCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'anime',
|
||||
group: 'search',
|
||||
memberName: 'anime',
|
||||
description: 'Searches My Anime List for your query, getting anime results.',
|
||||
clientPermissions: ['EMBED_LINKS'],
|
||||
args: [
|
||||
{
|
||||
key: 'query',
|
||||
prompt: 'What anime would you like to search for?',
|
||||
type: 'string'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { query } = args;
|
||||
try {
|
||||
const { text } = await snekfetch
|
||||
.get(`https://${animelistLogin}@myanimelist.net/api/anime/search.xml`)
|
||||
.query({ q: query });
|
||||
const { anime } = await xml.parseStringAsync(text);
|
||||
const synopsis = cleanXML(anime.entry[0].synopsis[0].substr(0, 2000));
|
||||
const embed = new MessageEmbed()
|
||||
.setColor(0x2D54A2)
|
||||
.setAuthor('My Anime List', 'https://i.imgur.com/R4bmNFz.png')
|
||||
.setURL(`https://myanimelist.net/anime/${anime.entry[0].id[0]}`)
|
||||
.setThumbnail(anime.entry[0].image[0])
|
||||
.setTitle(`${anime.entry[0].title[0]} (English: ${anime.entry[0].english[0] || 'N/A'})`)
|
||||
.setDescription(synopsis)
|
||||
.addField('❯ Type',
|
||||
`${anime.entry[0].type[0]} - ${anime.entry[0].status[0]}`, true)
|
||||
.addField('❯ Episodes',
|
||||
anime.entry[0].episodes[0], true)
|
||||
.addField('❯ Start Date',
|
||||
anime.entry[0].start_date[0], true)
|
||||
.addField('❯ End Date',
|
||||
anime.entry[0].end_date[0], true);
|
||||
return msg.embed(embed);
|
||||
} catch (err) {
|
||||
if (err.message === 'Parse Error') return msg.say('No Results.');
|
||||
else throw err;
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1,48 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const snekfetch = require('snekfetch');
|
||||
const { dbotsKey } = require('../../config');
|
||||
|
||||
module.exports = class BotSearchCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'bot-info',
|
||||
group: 'search',
|
||||
memberName: 'bot-info',
|
||||
description: 'Searches Discord Bots for info on a bot.',
|
||||
clientPermissions: ['EMBED_LINKS'],
|
||||
args: [
|
||||
{
|
||||
key: 'bot',
|
||||
prompt: 'Which bot do you want to get information for?',
|
||||
type: 'user'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { bot } = args;
|
||||
try {
|
||||
const { body } = await snekfetch
|
||||
.get(`https://bots.discord.pw/api/bots/${bot.id}`)
|
||||
.set({ Authorization: dbotsKey });
|
||||
const embed = new MessageEmbed()
|
||||
.setColor(0x9797FF)
|
||||
.setAuthor('Discord Bots', 'https://i.imgur.com/lrKYBQi.jpg')
|
||||
.setTitle(body.name)
|
||||
.setURL(`https://bots.discord.pw/bots/${bot.id}`)
|
||||
.setDescription(body.description)
|
||||
.addField('❯ Library',
|
||||
body.library, true)
|
||||
.addField('❯ Invite',
|
||||
`[Here](${body.invite_url})`, true)
|
||||
.addField('❯ Prefix',
|
||||
body.prefix, true);
|
||||
return msg.embed(embed);
|
||||
} catch (err) {
|
||||
if (err.message === '404 Not Found') return msg.say('Bot Not Found.');
|
||||
else throw err;
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1,46 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const snekfetch = require('snekfetch');
|
||||
|
||||
module.exports = class BulbapediaCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'bulbapedia',
|
||||
aliases: ['bulbagarden'],
|
||||
group: 'search',
|
||||
memberName: 'bulbapedia',
|
||||
description: 'Searches Bulbapedia for your query.',
|
||||
clientPermissions: ['EMBED_LINKS'],
|
||||
args: [
|
||||
{
|
||||
key: 'query',
|
||||
prompt: 'What would you like to search for?',
|
||||
type: 'string'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { query } = args;
|
||||
const { body } = await snekfetch
|
||||
.get('http://bulbapedia.bulbagarden.net/w/api.php')
|
||||
.query({
|
||||
action: 'query',
|
||||
prop: 'extracts',
|
||||
format: 'json',
|
||||
titles: query,
|
||||
exintro: '',
|
||||
explaintext: '',
|
||||
redirects: '',
|
||||
formatversion: 2
|
||||
});
|
||||
if (body.query.pages[0].missing) return msg.say('No Results.');
|
||||
const embed = new MessageEmbed()
|
||||
.setColor(0x3E7614)
|
||||
.setTitle(body.query.pages[0].title)
|
||||
.setAuthor('Bulbapedia', 'https://i.imgur.com/09eYo5T.png')
|
||||
.setDescription(body.query.pages[0].extract.substr(0, 2000).replace(/[\n]/g, '\n\n'));
|
||||
return msg.embed(embed);
|
||||
}
|
||||
};
|
||||
@@ -1,38 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { stripIndents } = require('common-tags');
|
||||
const snekfetch = require('snekfetch');
|
||||
|
||||
module.exports = class DanbooruCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'danbooru',
|
||||
group: 'search',
|
||||
memberName: 'danbooru',
|
||||
description: 'Searches Danbooru with optional query.',
|
||||
nsfw: true,
|
||||
args: [
|
||||
{
|
||||
key: 'query',
|
||||
prompt: 'What would you like to search for?',
|
||||
type: 'string',
|
||||
default: ''
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { query } = args;
|
||||
const { body } = await snekfetch
|
||||
.get('https://danbooru.donmai.us/posts.json')
|
||||
.query({
|
||||
tags: `${query ? `${query} ` : ''}order:random`,
|
||||
limit: 1
|
||||
});
|
||||
if (!body.length || !body[0].file_url) return msg.say('No Results');
|
||||
return msg.say(stripIndents`
|
||||
${query ? `Result for ${query}:` : 'Random Image:'}
|
||||
https://danbooru.donmai.us${body[0].file_url}
|
||||
`);
|
||||
}
|
||||
};
|
||||
@@ -1,42 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const snekfetch = require('snekfetch');
|
||||
const { wordnikKey } = require('../../config');
|
||||
|
||||
module.exports = class DefineCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'define',
|
||||
group: 'search',
|
||||
memberName: 'define',
|
||||
description: 'Defines a word.',
|
||||
clientPermissions: ['EMBED_LINKS'],
|
||||
args: [
|
||||
{
|
||||
key: 'query',
|
||||
prompt: 'What would you like to define?',
|
||||
type: 'string',
|
||||
parse: (query) => encodeURIComponent(query)
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { query } = args;
|
||||
const { body } = await snekfetch
|
||||
.get(`http://api.wordnik.com:80/v4/word.json/${query}/definitions`)
|
||||
.query({
|
||||
limit: 1,
|
||||
includeRelated: false,
|
||||
useCanonical: false,
|
||||
api_key: wordnikKey
|
||||
});
|
||||
if (!body.length) return msg.say('No Results.');
|
||||
const embed = new MessageEmbed()
|
||||
.setColor(0x9797FF)
|
||||
.setTitle(body[0].word)
|
||||
.setDescription(body[0].text);
|
||||
return msg.embed(embed);
|
||||
}
|
||||
};
|
||||
@@ -1,36 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
|
||||
module.exports = class DiscrimCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'discrim',
|
||||
aliases: ['discriminator', 'search-discrim'],
|
||||
group: 'search',
|
||||
memberName: 'discrim',
|
||||
description: 'Searches for other users with a certain discriminator.',
|
||||
clientPermissions: ['EMBED_LINKS'],
|
||||
args: [
|
||||
{
|
||||
key: 'discrim',
|
||||
prompt: 'Which discriminator would you like to search for?',
|
||||
type: 'string',
|
||||
default: '',
|
||||
validate: (discrim) => {
|
||||
if (/[0-9]+$/g.test(discrim) && discrim.length === 4) return true;
|
||||
else return 'Invalid Discriminator.';
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const discrim = args.discrim || msg.author.discriminator;
|
||||
const users = this.client.users.filter((user) => user.discriminator === discrim).map((user) => user.username);
|
||||
const embed = new MessageEmbed()
|
||||
.setTitle(`${users.length} Users with the discriminator: ${discrim}`)
|
||||
.setDescription(users.join(', '));
|
||||
return msg.embed(embed);
|
||||
}
|
||||
};
|
||||
@@ -1,83 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { stripIndents } = require('common-tags');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const snekfetch = require('snekfetch');
|
||||
|
||||
module.exports = class ForecastCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'forecast',
|
||||
group: 'search',
|
||||
memberName: 'forecast',
|
||||
description: 'Responds with the seven-day forecast for a specified location.',
|
||||
clientPermissions: ['EMBED_LINKS'],
|
||||
args: [
|
||||
{
|
||||
key: 'query',
|
||||
prompt: 'What location would you like to get the forecast for?',
|
||||
type: 'string'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { query } = args;
|
||||
const { body } = await snekfetch
|
||||
.get('https://query.yahooapis.com/v1/public/yql')
|
||||
.query({
|
||||
q: `select * from weather.forecast where u='f' AND woeid in (select woeid from geo.places(1) where text="${query}")`, // eslint-disable-line max-len
|
||||
format: 'json'
|
||||
});
|
||||
if (!body.query.count) return msg.say('Location Not Found.');
|
||||
const forecasts = body.query.results.channel.item.forecast;
|
||||
const embed = new MessageEmbed()
|
||||
.setColor(0x0000FF)
|
||||
.setAuthor(body.query.results.channel.title, 'https://i.imgur.com/2MT0ViC.png')
|
||||
.setURL(body.query.results.channel.link)
|
||||
.setTimestamp()
|
||||
.addField(`❯ ${forecasts[0].day} - ${forecasts[0].date}`,
|
||||
stripIndents`
|
||||
**High:** ${forecasts[0].high}°F
|
||||
**Low:** ${forecasts[0].low}°F
|
||||
**Condition:** ${forecasts[0].text}
|
||||
`)
|
||||
.addField(`❯ ${forecasts[1].day} - ${forecasts[1].date}`,
|
||||
stripIndents`
|
||||
**High:** ${forecasts[1].high}°F
|
||||
**Low:** ${forecasts[1].low}°F
|
||||
**Condition:** ${forecasts[1].text}
|
||||
`)
|
||||
.addField(`❯ ${forecasts[2].day} - ${forecasts[2].date}`,
|
||||
stripIndents`
|
||||
**High:** ${forecasts[2].high}°F
|
||||
**Low:** ${forecasts[2].low}°F
|
||||
**Condition:** ${forecasts[2].text}
|
||||
`)
|
||||
.addField(`❯ ${forecasts[3].day} - ${forecasts[3].date}`,
|
||||
stripIndents`
|
||||
**High:** ${forecasts[3].high}°F
|
||||
**Low:** ${forecasts[3].low}°F
|
||||
**Condition:** ${forecasts[3].text}
|
||||
`)
|
||||
.addField(`❯ ${forecasts[4].day} - ${forecasts[4].date}`,
|
||||
stripIndents`
|
||||
**High:** ${forecasts[4].high}°F
|
||||
**Low:** ${forecasts[4].low}°F
|
||||
**Condition:** ${forecasts[4].text}
|
||||
`)
|
||||
.addField(`❯ ${forecasts[5].day} - ${forecasts[5].date}`,
|
||||
stripIndents`
|
||||
**High:** ${forecasts[5].high}°F
|
||||
**Low:** ${forecasts[5].low}°F
|
||||
**Condition:** ${forecasts[5].text}
|
||||
`)
|
||||
.addField(`❯ ${forecasts[6].day} - ${forecasts[6].date}`,
|
||||
stripIndents`
|
||||
**High:** ${forecasts[6].high}°F
|
||||
**Low:** ${forecasts[6].low}°F
|
||||
**Condition:** ${forecasts[6].text}
|
||||
`);
|
||||
return msg.embed(embed);
|
||||
}
|
||||
};
|
||||
@@ -1,43 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { stripIndents } = require('common-tags');
|
||||
const snekfetch = require('snekfetch');
|
||||
const { promisifyAll } = require('tsubaki');
|
||||
const xml = promisifyAll(require('xml2js'));
|
||||
|
||||
module.exports = class GelbooruCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'gelbooru',
|
||||
group: 'search',
|
||||
memberName: 'gelbooru',
|
||||
description: 'Searches Gelbooru for your query.',
|
||||
nsfw: true,
|
||||
args: [
|
||||
{
|
||||
key: 'query',
|
||||
prompt: 'What would you like to search for?',
|
||||
type: 'string'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { query } = args;
|
||||
const { text } = await snekfetch
|
||||
.get('https://gelbooru.com/index.php')
|
||||
.query({
|
||||
page: 'dapi',
|
||||
s: 'post',
|
||||
q: 'index',
|
||||
tags: query,
|
||||
limit: 1
|
||||
});
|
||||
const { posts } = await xml.parseStringAsync(text);
|
||||
if (posts.$.count === '0') return msg.say('No Results.');
|
||||
return msg.say(stripIndents`
|
||||
Result for ${query}:
|
||||
https:${posts.post[0].$.file_url}
|
||||
`);
|
||||
}
|
||||
};
|
||||
@@ -1,35 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const snekfetch = require('snekfetch');
|
||||
const { giphyKey } = require('../../config');
|
||||
|
||||
module.exports = class GiphyCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'giphy',
|
||||
group: 'search',
|
||||
memberName: 'giphy',
|
||||
description: 'Searches Giphy for your query.',
|
||||
args: [
|
||||
{
|
||||
key: 'query',
|
||||
prompt: 'What would you like to search for?',
|
||||
type: 'string'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { query } = args;
|
||||
const { body } = await snekfetch
|
||||
.get('http://api.giphy.com/v1/gifs/search')
|
||||
.query({
|
||||
q: query,
|
||||
api_key: giphyKey,
|
||||
rating: msg.channel.nsfw ? 'r' : 'pg'
|
||||
});
|
||||
if (!body.data.length) return msg.say('No Results.');
|
||||
const random = Math.floor(Math.random() * body.data.length);
|
||||
return msg.say(body.data[random].images.original.url);
|
||||
}
|
||||
};
|
||||
@@ -1,38 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { stripIndents } = require('common-tags');
|
||||
const snekfetch = require('snekfetch');
|
||||
|
||||
module.exports = class KonachanCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'konachan',
|
||||
group: 'search',
|
||||
memberName: 'konachan',
|
||||
description: 'Searches Konachan with optional query.',
|
||||
nsfw: true,
|
||||
args: [
|
||||
{
|
||||
key: 'query',
|
||||
prompt: 'What would you like to search for?',
|
||||
type: 'string',
|
||||
default: ''
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { query } = args;
|
||||
const { body } = await snekfetch
|
||||
.get('https://konachan.net/post.json')
|
||||
.query({
|
||||
tags: `${query ? `${query} ` : ''}order:random`,
|
||||
limit: 1
|
||||
});
|
||||
if (!body.length) return msg.say('No Results.');
|
||||
return msg.say(stripIndents`
|
||||
${query ? `Result for ${query}:` : 'Random Image:'}
|
||||
https:${body[0].file_url}
|
||||
`);
|
||||
}
|
||||
};
|
||||
@@ -1,56 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const snekfetch = require('snekfetch');
|
||||
const { cleanXML } = require('../../structures/Util');
|
||||
const { promisifyAll } = require('tsubaki');
|
||||
const xml = promisifyAll(require('xml2js'));
|
||||
const { animelistLogin } = require('../../config');
|
||||
|
||||
module.exports = class MangaCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'manga',
|
||||
group: 'search',
|
||||
memberName: 'manga',
|
||||
description: 'Searches My Anime List for your query, getting manga results.',
|
||||
clientPermissions: ['EMBED_LINKS'],
|
||||
args: [
|
||||
{
|
||||
key: 'query',
|
||||
prompt: 'What manga would you like to search for?',
|
||||
type: 'string'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { query } = args;
|
||||
try {
|
||||
const { text } = await snekfetch
|
||||
.get(`https://${animelistLogin}@myanimelist.net/api/manga/search.xml`)
|
||||
.query({ q: query });
|
||||
const { manga } = await xml.parseStringAsync(text);
|
||||
const synopsis = cleanXML(manga.entry[0].synopsis[0].substr(0, 2000));
|
||||
const embed = new MessageEmbed()
|
||||
.setColor(0x2D54A2)
|
||||
.setAuthor('My Anime List', 'https://i.imgur.com/R4bmNFz.png')
|
||||
.setURL(`https://myanimelist.net/manga/${manga.entry[0].id[0]}`)
|
||||
.setThumbnail(manga.entry[0].image[0])
|
||||
.setTitle(`${manga.entry[0].title[0]} (English: ${manga.entry[0].english[0] || 'N/A'})`)
|
||||
.setDescription(synopsis)
|
||||
.addField('❯ Type',
|
||||
`${manga.entry[0].type[0]} - ${manga.entry[0].status[0]}`, true)
|
||||
.addField('❯ Volumes / Chapters',
|
||||
`${manga.entry[0].volumes[0]} / ${manga.entry[0].chapters[0]}`, true)
|
||||
.addField('❯ Start Date',
|
||||
manga.entry[0].start_date[0], true)
|
||||
.addField('❯ End Date',
|
||||
manga.entry[0].end_date[0], true);
|
||||
return msg.embed(embed);
|
||||
} catch (err) {
|
||||
if (err.message === 'Parse Error') return msg.say('No Results.');
|
||||
else throw err;
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1,45 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const snekfetch = require('snekfetch');
|
||||
const { googleKey } = require('../../config');
|
||||
|
||||
module.exports = class MapCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'map',
|
||||
group: 'search',
|
||||
memberName: 'map',
|
||||
description: 'Responds with a map based upon your query.',
|
||||
clientPermissions: ['ATTACH_FILES'],
|
||||
args: [
|
||||
{
|
||||
key: 'zoom',
|
||||
label: 'zoom level',
|
||||
prompt: 'What would you like the zoom level for the map to be? Limit 1-20.',
|
||||
type: 'integer',
|
||||
validate: (zoom) => {
|
||||
if (zoom < 21 && zoom > 0) return true;
|
||||
else return 'Please enter a zoom value from 1-20';
|
||||
}
|
||||
},
|
||||
{
|
||||
key: 'query',
|
||||
prompt: 'What location you like to get a map image for?',
|
||||
type: 'string'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { zoom, query } = args;
|
||||
const { body } = await snekfetch
|
||||
.get('https://maps.googleapis.com/maps/api/staticmap')
|
||||
.query({
|
||||
center: query,
|
||||
zoom,
|
||||
size: '500x500',
|
||||
key: googleKey
|
||||
});
|
||||
return msg.say({ files: [{ attachment: body, name: 'map.png' }] });
|
||||
}
|
||||
};
|
||||
@@ -1,36 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const snekfetch = require('snekfetch');
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
module.exports = class NeopetCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'neopet',
|
||||
group: 'search',
|
||||
memberName: 'neopet',
|
||||
description: 'Searches for Neopets with the username of your query.',
|
||||
args: [
|
||||
{
|
||||
key: 'query',
|
||||
prompt: 'What pet would you like to get the image of?',
|
||||
type: 'string'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { query } = args;
|
||||
const { text } = await snekfetch
|
||||
.get('http://www.sunnyneo.com/petimagefinder.php')
|
||||
.query({
|
||||
name: query,
|
||||
size: 5,
|
||||
mood: 1
|
||||
});
|
||||
const $ = cheerio.load(text);
|
||||
const link = $('textarea').first().text();
|
||||
if (!link.includes('cp')) return msg.say('Invalid Pet Name.');
|
||||
return msg.say(link);
|
||||
}
|
||||
};
|
||||
@@ -1,64 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const snekfetch = require('snekfetch');
|
||||
const { osuKey } = require('../../config');
|
||||
|
||||
module.exports = class OsuCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'osu',
|
||||
group: 'search',
|
||||
memberName: 'osu',
|
||||
description: 'Searches osu! usernames for your query.',
|
||||
clientPermissions: ['EMBED_LINKS'],
|
||||
args: [
|
||||
{
|
||||
key: 'query',
|
||||
prompt: 'What osu username would you like to search for?',
|
||||
type: 'string'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { query } = args;
|
||||
const { body } = await snekfetch
|
||||
.get('https://osu.ppy.sh/api/get_user')
|
||||
.query({
|
||||
k: osuKey,
|
||||
u: query,
|
||||
type: 'string'
|
||||
});
|
||||
if (!body.length) return msg.say('No Results.');
|
||||
const embed = new MessageEmbed()
|
||||
.setColor(0xFF66AA)
|
||||
.setAuthor('osu!', 'https://i.imgur.com/EmnUp00.png')
|
||||
.setURL('https://osu.ppy.sh/')
|
||||
.addField('❯ Username',
|
||||
body[0].username, true)
|
||||
.addField('❯ ID',
|
||||
body[0].user_id, true)
|
||||
.addField('❯ Level',
|
||||
body[0].level, true)
|
||||
.addField('❯ Accuracy',
|
||||
body[0].accuracy, true)
|
||||
.addField('❯ Rank',
|
||||
body[0].pp_rank, true)
|
||||
.addField('❯ Play Count',
|
||||
body[0].playcount, true)
|
||||
.addField('❯ Country',
|
||||
body[0].country, true)
|
||||
.addField('❯ Ranked Score',
|
||||
body[0].ranked_score, true)
|
||||
.addField('❯ Total Score',
|
||||
body[0].total_score, true)
|
||||
.addField('❯ SS',
|
||||
body[0].count_rank_ss, true)
|
||||
.addField('❯ S',
|
||||
body[0].count_rank_s, true)
|
||||
.addField('❯ A',
|
||||
body[0].count_rank_a, true);
|
||||
return msg.embed(embed);
|
||||
}
|
||||
};
|
||||
@@ -1,43 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const snekfetch = require('snekfetch');
|
||||
|
||||
module.exports = class RecipeCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'recipe',
|
||||
group: 'search',
|
||||
memberName: 'recipe',
|
||||
description: 'Searches for recipes that include your query.',
|
||||
clientPermissions: ['EMBED_LINKS'],
|
||||
args: [
|
||||
{
|
||||
key: 'query',
|
||||
prompt: 'What would you like to search for?',
|
||||
type: 'string'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
try {
|
||||
const { query } = args;
|
||||
const { text } = await snekfetch
|
||||
.get('http://www.recipepuppy.com/api/')
|
||||
.query({ q: query });
|
||||
const body = JSON.parse(text);
|
||||
if (!body.results.length) return msg.say('No Results.');
|
||||
const recipe = body.results[Math.floor(Math.random() * body.results.length)];
|
||||
const embed = new MessageEmbed()
|
||||
.setColor(0xC20000)
|
||||
.setURL(recipe.href)
|
||||
.setTitle(recipe.title)
|
||||
.setDescription(`**Ingredients:** ${recipe.ingredients}`)
|
||||
.setThumbnail(recipe.thumbnail);
|
||||
return msg.embed(embed);
|
||||
} catch (err) {
|
||||
return msg.say('No Results.');
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1,43 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { stripIndents } = require('common-tags');
|
||||
const snekfetch = require('snekfetch');
|
||||
const { promisifyAll } = require('tsubaki');
|
||||
const xml = promisifyAll(require('xml2js'));
|
||||
|
||||
module.exports = class Rule34Command extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'rule34',
|
||||
group: 'search',
|
||||
memberName: 'rule34',
|
||||
description: 'Searches Rule34 for your query.',
|
||||
nsfw: true,
|
||||
args: [
|
||||
{
|
||||
key: 'query',
|
||||
prompt: 'What would you like to search for?',
|
||||
type: 'string'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { query } = args;
|
||||
const { text } = await snekfetch
|
||||
.get('https://rule34.xxx/index.php')
|
||||
.query({
|
||||
page: 'dapi',
|
||||
s: 'post',
|
||||
q: 'index',
|
||||
tags: query,
|
||||
limit: 1
|
||||
});
|
||||
const { posts } = await xml.parseStringAsync(text);
|
||||
if (posts.$.count === '0') return msg.say('No Results.');
|
||||
return msg.say(stripIndents`
|
||||
Result for ${query}:
|
||||
https:${posts.post[0].$.file_url}
|
||||
`);
|
||||
}
|
||||
};
|
||||
@@ -1,51 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const snekfetch = require('snekfetch');
|
||||
const { soundcloudKey } = require('../../config');
|
||||
|
||||
module.exports = class SoundCloudCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'soundcloud',
|
||||
group: 'search',
|
||||
memberName: 'soundcloud',
|
||||
description: 'Searches SoundCloud for your query.',
|
||||
clientPermissions: ['EMBED_LINKS'],
|
||||
args: [
|
||||
{
|
||||
key: 'query',
|
||||
prompt: 'What do you want to search SoundCloud for?',
|
||||
type: 'string'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { query } = args;
|
||||
const { body } = await snekfetch
|
||||
.get('https://api.soundcloud.com/tracks')
|
||||
.query({
|
||||
q: query,
|
||||
client_id: soundcloudKey
|
||||
});
|
||||
if (!body.length) return msg.say('No Results.');
|
||||
const embed = new MessageEmbed()
|
||||
.setColor(0xF15A22)
|
||||
.setAuthor('SoundCloud', 'https://i.imgur.com/lFIz7RU.png')
|
||||
.setTitle(body[0].title)
|
||||
.setURL(body[0].permalink_url)
|
||||
.setThumbnail(body[0].artwork_url)
|
||||
.addField('❯ Artist',
|
||||
body[0].user.username)
|
||||
.addField('❯ Download Count',
|
||||
body[0].download_count, true)
|
||||
.addField('❯ Comment Count',
|
||||
body[0].comment_count, true)
|
||||
.addField('❯ Playback Count',
|
||||
body[0].playback_count, true)
|
||||
.addField('❯ Favorited Count',
|
||||
body[0].favoritings_count, true);
|
||||
return msg.embed(embed);
|
||||
}
|
||||
};
|
||||
@@ -1,39 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const snekfetch = require('snekfetch');
|
||||
|
||||
module.exports = class UrbanCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'urban',
|
||||
group: 'search',
|
||||
memberName: 'urban',
|
||||
description: 'Searches Urban Dictionary for your query.',
|
||||
clientPermissions: ['EMBED_LINKS'],
|
||||
args: [
|
||||
{
|
||||
key: 'query',
|
||||
prompt: 'What would you like to define?',
|
||||
type: 'string'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { query } = args;
|
||||
const { body } = await snekfetch
|
||||
.get('http://api.urbandictionary.com/v0/define')
|
||||
.query({ term: query });
|
||||
if (!body.list.length) return msg.say('No Results.');
|
||||
const embed = new MessageEmbed()
|
||||
.setColor(0x32A8F0)
|
||||
.setAuthor('Urban Dictionary', 'https://i.imgur.com/fzFuuL7.png')
|
||||
.setURL(body.list[0].permalink)
|
||||
.setTitle(body.list[0].word)
|
||||
.setDescription(body.list[0].definition.substr(0, 2000))
|
||||
.addField('❯ Example',
|
||||
body.list[0].example.substr(0, 1024) || 'None');
|
||||
return msg.embed(embed);
|
||||
}
|
||||
};
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user