mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Clean-Ups
This commit is contained in:
+4
-7
@@ -65,7 +65,7 @@ client.dispatcher.addInhibitor(msg => {
|
||||
return ['singleRole', msg.reply(`Only the ${msg.guild.roles.get(role).name} role may use commands.`)];
|
||||
});
|
||||
|
||||
client.on('message', async (msg) => {
|
||||
client.on('message', (msg) => {
|
||||
if (msg.guild && msg.guild.settings.get('inviteGuard') && /(discord(\.gg\/|app\.com\/invite\/|\.me\/))/gi.test(msg.content)) {
|
||||
if (msg.author.bot ||
|
||||
msg.member.hasPermission('ADMINISTRATOR') ||
|
||||
@@ -73,9 +73,8 @@ client.on('message', async (msg) => {
|
||||
msg.member.roles.has(msg.guild.settings.get('staffRole')) ||
|
||||
!msg.channel.permissionsFor(client.user).has('SEND_MESSAGES')) return;
|
||||
if (msg.channel.permissionsFor(client.user).has('MANAGE_MESSAGES')) msg.delete();
|
||||
else msg.channel.send('Message could not be deleted, missing the `Manage Messages` permission.');
|
||||
return msg.reply('Invites are prohibited from being posted here.');
|
||||
} else return;
|
||||
}
|
||||
});
|
||||
|
||||
client.on('messageReactionAdd', (reaction, user) => {
|
||||
@@ -84,8 +83,7 @@ client.on('messageReactionAdd', (reaction, user) => {
|
||||
const channel = msg.guild.channels.get(msg.guild.settings.get('starboard'));
|
||||
if (!channel) return;
|
||||
if (user.id === msg.author.id) {
|
||||
if (msg.channel.permissionsFor(client.user).has('MANAGE_MESSAGES'))
|
||||
reaction.remove(user);
|
||||
if (msg.channel.permissionsFor(client.user).has('MANAGE_MESSAGES')) reaction.remove(user);
|
||||
return msg.reply('You cannot star your own messages, baka.');
|
||||
}
|
||||
client.registry.resolveCommand('random:star').run(msg, { id: msg.id }, true);
|
||||
@@ -93,8 +91,7 @@ client.on('messageReactionAdd', (reaction, user) => {
|
||||
|
||||
client.on('guildMemberAdd', (member) => {
|
||||
const role = member.guild.roles.get(member.guild.settings.get('joinRole'));
|
||||
if (member.guild.me.hasPermission('MANAGE_ROLES') && role)
|
||||
member.addRole(role).catch(() => null);
|
||||
if (role && member.guild.me.hasPermission('MANAGE_ROLES')) member.addRole(role).catch(() => null);
|
||||
const channel = member.guild.channels.get(member.guild.settings.get('memberLog'));
|
||||
if (!channel) return;
|
||||
if (!channel.permissionsFor(client.user).has('SEND_MESSAGES')) return;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const Canvas = require('canvas');
|
||||
const snekfetch = require('snekfetch');
|
||||
const { promisifyAll } = require('tsubaki');
|
||||
@@ -11,12 +11,13 @@ module.exports = class YearsCommand extends Command {
|
||||
name: '3000-years',
|
||||
aliases: ['az'],
|
||||
group: 'avataredit',
|
||||
memberName: '3000years',
|
||||
memberName: '3000-years',
|
||||
description: 'It\'s been 3000 years...',
|
||||
throttling: {
|
||||
usages: 1,
|
||||
duration: 15
|
||||
},
|
||||
clientPermissions: ['ATTACH_FILES'],
|
||||
args: [
|
||||
{
|
||||
key: 'user',
|
||||
@@ -28,9 +29,6 @@ module.exports = class YearsCommand extends Command {
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
||||
return msg.say('This Command requires the `Attach Files` Permission.');
|
||||
const { user } = args;
|
||||
const avatarURL = user.avatarURL('png', 256);
|
||||
if (!avatarURL) return msg.say('This user has no avatar.');
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const Canvas = require('canvas');
|
||||
const snekfetch = require('snekfetch');
|
||||
const { promisifyAll } = require('tsubaki');
|
||||
@@ -17,6 +17,7 @@ module.exports = class BeautifulCommand extends Command {
|
||||
usages: 1,
|
||||
duration: 15
|
||||
},
|
||||
clientPermissions: ['ATTACH_FILES'],
|
||||
args: [
|
||||
{
|
||||
key: 'user',
|
||||
@@ -28,9 +29,6 @@ module.exports = class BeautifulCommand extends Command {
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
||||
return msg.say('This Command requires the `Attach Files` Permission.');
|
||||
const { user } = args;
|
||||
const avatarURL = user.avatarURL('png', 256);
|
||||
if (!avatarURL) return msg.say('This user has no avatar.');
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const Canvas = require('canvas');
|
||||
const snekfetch = require('snekfetch');
|
||||
const { promisifyAll } = require('tsubaki');
|
||||
@@ -17,6 +17,7 @@ module.exports = class BobRossCommand extends Command {
|
||||
usages: 1,
|
||||
duration: 15
|
||||
},
|
||||
clientPermissions: ['ATTACH_FILES'],
|
||||
args: [
|
||||
{
|
||||
key: 'user',
|
||||
@@ -28,9 +29,6 @@ module.exports = class BobRossCommand extends Command {
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
||||
return msg.say('This Command requires the `Attach Files` Permission.');
|
||||
const { user } = args;
|
||||
const avatarURL = user.avatarURL('png', 256);
|
||||
if (!avatarURL) return msg.say('This user has no avatar.');
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const Canvas = require('canvas');
|
||||
const snekfetch = require('snekfetch');
|
||||
const moment = require('moment');
|
||||
@@ -20,6 +20,7 @@ module.exports = class CardCommand extends Command {
|
||||
usages: 1,
|
||||
duration: 15
|
||||
},
|
||||
clientPermissions: ['ATTACH_FILES'],
|
||||
args: [
|
||||
{
|
||||
key: 'member',
|
||||
@@ -31,16 +32,14 @@ module.exports = class CardCommand extends Command {
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
||||
return msg.say('This Command requires the `Attach Files` Permission.');
|
||||
const { member } = args;
|
||||
const avatarURL = member.user.avatarURL('png', 512);
|
||||
if (!avatarURL) return msg.say('This user has no avatar.');
|
||||
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 avatarURL = member.user.avatarURL('png', 512);
|
||||
if (!avatarURL) return msg.say('This user has no avatar.');
|
||||
try {
|
||||
const Image = Canvas.Image;
|
||||
Canvas.registerFont(path.join(__dirname, '..', '..', 'assets', 'fonts', 'OpenSans.ttf'), { family: 'Open Sans' });
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const Canvas = require('canvas');
|
||||
const snekfetch = require('snekfetch');
|
||||
const { promisifyAll } = require('tsubaki');
|
||||
@@ -16,6 +16,7 @@ module.exports = class ChallengerCommand extends Command {
|
||||
usages: 1,
|
||||
duration: 15
|
||||
},
|
||||
clientPermissions: ['ATTACH_FILES'],
|
||||
args: [
|
||||
{
|
||||
key: 'user',
|
||||
@@ -27,9 +28,6 @@ module.exports = class ChallengerCommand extends Command {
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
||||
return msg.say('This Command requires the `Attach Files` Permission.');
|
||||
const { user } = args;
|
||||
const avatarURL = user.avatarURL('png', 256);
|
||||
if (!avatarURL) return msg.say('This user has no avatar.');
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const Canvas = require('canvas');
|
||||
const snekfetch = require('snekfetch');
|
||||
const { promisifyAll } = require('tsubaki');
|
||||
@@ -16,6 +16,7 @@ module.exports = class DexterCommand extends Command {
|
||||
usages: 1,
|
||||
duration: 15
|
||||
},
|
||||
clientPermissions: ['ATTACH_FILES'],
|
||||
args: [
|
||||
{
|
||||
key: 'user',
|
||||
@@ -27,9 +28,6 @@ module.exports = class DexterCommand extends Command {
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
||||
return msg.say('This Command requires the `Attach Files` Permission.');
|
||||
const { user } = args;
|
||||
const avatarURL = user.avatarURL('png', 256);
|
||||
if (!avatarURL) return msg.say('This user has no avatar.');
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const Canvas = require('canvas');
|
||||
const snekfetch = require('snekfetch');
|
||||
|
||||
@@ -14,6 +14,7 @@ module.exports = class GreyscaleCommand extends Command {
|
||||
usages: 1,
|
||||
duration: 15
|
||||
},
|
||||
clientPermissions: ['ATTACH_FILES'],
|
||||
args: [
|
||||
{
|
||||
key: 'user',
|
||||
@@ -25,9 +26,6 @@ module.exports = class GreyscaleCommand extends Command {
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
||||
return msg.say('This Command requires the `Attach Files` Permission.');
|
||||
const { user } = args;
|
||||
const avatarURL = user.avatarURL('png', 256);
|
||||
if (!avatarURL) return msg.say('This user has no avatar.');
|
||||
@@ -39,7 +37,7 @@ module.exports = class GreyscaleCommand extends Command {
|
||||
const generate = () => {
|
||||
ctx.drawImage(avatar, 0, 0, 256, 256);
|
||||
const imgData = ctx.getImageData(0, 0, 256, 256);
|
||||
const data = imgData.data;
|
||||
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;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const Canvas = require('canvas');
|
||||
const snekfetch = require('snekfetch');
|
||||
|
||||
@@ -13,6 +13,7 @@ module.exports = class InvertCommand extends Command {
|
||||
usages: 1,
|
||||
duration: 15
|
||||
},
|
||||
clientPermissions: ['ATTACH_FILES'],
|
||||
args: [
|
||||
{
|
||||
key: 'user',
|
||||
@@ -24,9 +25,6 @@ module.exports = class InvertCommand extends Command {
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
||||
return msg.say('This Command requires the `Attach Files` Permission.');
|
||||
const { user } = args;
|
||||
const avatarURL = user.avatarURL('png', 256);
|
||||
if (!avatarURL) return msg.say('This user has no avatar.');
|
||||
@@ -38,7 +36,7 @@ module.exports = class InvertCommand extends Command {
|
||||
const generate = () => {
|
||||
ctx.drawImage(avatar, 0, 0, 256, 256);
|
||||
const imgData = ctx.getImageData(0, 0, 256, 256);
|
||||
const data = imgData.data;
|
||||
const { data } = imgData;
|
||||
for (let i = 0; i < data.length; i += 4) {
|
||||
data[i] = 255 - data[i];
|
||||
data[i + 1] = 255 - data[i + 1];
|
||||
@@ -46,8 +44,8 @@ module.exports = class InvertCommand extends Command {
|
||||
}
|
||||
ctx.putImageData(imgData, 0, 0);
|
||||
};
|
||||
const avatarImg = await snekfetch.get(avatarURL);
|
||||
avatar.src = avatarImg.body;
|
||||
const { body } = await snekfetch.get(avatarURL);
|
||||
avatar.src = body;
|
||||
generate();
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'invert.png' }] })
|
||||
.catch(err => msg.say(`${err.name}: ${err.message}`));
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const Canvas = require('canvas');
|
||||
const snekfetch = require('snekfetch');
|
||||
const { promisifyAll } = require('tsubaki');
|
||||
@@ -17,6 +17,7 @@ module.exports = class RIPCommand extends Command {
|
||||
usages: 1,
|
||||
duration: 15
|
||||
},
|
||||
clientPermissions: ['ATTACH_FILES'],
|
||||
args: [
|
||||
{
|
||||
key: 'user',
|
||||
@@ -28,9 +29,6 @@ module.exports = class RIPCommand extends Command {
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
||||
return msg.say('This Command requires the `Attach Files` Permission.');
|
||||
const { user } = args;
|
||||
const avatarURL = user.avatarURL('png', 256);
|
||||
if (!avatarURL) return msg.say('This User has no Avatar.');
|
||||
@@ -44,7 +42,7 @@ module.exports = class RIPCommand extends Command {
|
||||
ctx.drawImage(base, 0, 0);
|
||||
ctx.drawImage(avatar, 158, 51, 200, 200);
|
||||
const imgData = ctx.getImageData(158, 51, 200, 200);
|
||||
const data = imgData.data;
|
||||
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;
|
||||
@@ -54,8 +52,8 @@ module.exports = class RIPCommand extends Command {
|
||||
ctx.putImageData(imgData, 158, 51);
|
||||
};
|
||||
base.src = await fs.readFileAsync(path.join(__dirname, '..', '..', 'assets', 'images', 'rip.png'));
|
||||
const avatarImg = await snekfetch.get(avatarURL);
|
||||
avatar.src = avatarImg.body;
|
||||
const { body } = await snekfetch.get(avatarURL);
|
||||
avatar.src = body;
|
||||
generate();
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'rip.png' }] })
|
||||
.catch(err => msg.say(`${err.name}: ${err.message}`));
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const Canvas = require('canvas');
|
||||
const snekfetch = require('snekfetch');
|
||||
const { promisifyAll } = require('tsubaki');
|
||||
@@ -16,6 +16,7 @@ module.exports = class SimbaCommand extends Command {
|
||||
usages: 1,
|
||||
duration: 15
|
||||
},
|
||||
clientPermissions: ['ATTACH_FILES'],
|
||||
args: [
|
||||
{
|
||||
key: 'user',
|
||||
@@ -27,9 +28,6 @@ module.exports = class SimbaCommand extends Command {
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
||||
return msg.say('This Command requires the `Attach Files` Permission.');
|
||||
const { user } = args;
|
||||
const avatarURL = user.avatarURL('png', 256);
|
||||
if (!avatarURL) return msg.say('This user has no avatar.');
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const Canvas = require('canvas');
|
||||
const snekfetch = require('snekfetch');
|
||||
const { promisifyAll } = require('tsubaki');
|
||||
@@ -16,6 +16,7 @@ module.exports = class SteamCardCommand extends Command {
|
||||
usages: 1,
|
||||
duration: 15
|
||||
},
|
||||
clientPermissions: ['ATTACH_FILES'],
|
||||
args: [
|
||||
{
|
||||
key: 'user',
|
||||
@@ -27,11 +28,7 @@ module.exports = class SteamCardCommand extends Command {
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
||||
return msg.say('This Command requires the `Attach Files` Permission.');
|
||||
const { user } = args;
|
||||
const username = msg.guild ? (msg.guild.member(user) ? msg.guild.member(user).displayName : user.username) : user.username;
|
||||
const avatarURL = user.avatarURL('png', 512);
|
||||
if (!avatarURL) return msg.say('This user has no avatar.');
|
||||
try {
|
||||
@@ -47,13 +44,13 @@ module.exports = class SteamCardCommand extends Command {
|
||||
ctx.drawImage(avatar, 25, 25, 450, 450);
|
||||
ctx.drawImage(base, 0, 0);
|
||||
ctx.font = '30px Open Sans';
|
||||
ctx.fillText(username, 35, 48);
|
||||
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: 'card.png' }] })
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'steam.png' }] })
|
||||
.catch(err => msg.say(`${err.name}: ${err.message}`));
|
||||
} catch (err) {
|
||||
return msg.say(`${err.name}: ${err.message}`);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const Canvas = require('canvas');
|
||||
const snekfetch = require('snekfetch');
|
||||
const { promisifyAll } = require('tsubaki');
|
||||
@@ -16,6 +16,7 @@ module.exports = class TriggeredCommand extends Command {
|
||||
usages: 1,
|
||||
duration: 15
|
||||
},
|
||||
clientPermissions: ['ATTACH_FILES'],
|
||||
args: [
|
||||
{
|
||||
key: 'user',
|
||||
@@ -27,9 +28,6 @@ module.exports = class TriggeredCommand extends Command {
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
||||
return msg.say('This Command requires the `Attach Files` Permission.');
|
||||
const { user } = args;
|
||||
const avatarURL = user.avatarURL('png', 512);
|
||||
if (!avatarURL) return msg.say('This user has no avatar.');
|
||||
@@ -44,7 +42,7 @@ module.exports = class TriggeredCommand extends Command {
|
||||
ctx.fillRect(0, 0, 320, 371);
|
||||
ctx.drawImage(avatar, 0, 0, 320, 320);
|
||||
const imgData = ctx.getImageData(0, 0, 320, 320);
|
||||
const data = imgData.data;
|
||||
const { data } = imgData;
|
||||
for (let i = 0; i < data.length; i += 4) {
|
||||
data[i] = Math.max(255, data[i]);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const Canvas = require('canvas');
|
||||
const snekfetch = require('snekfetch');
|
||||
const { promisifyAll } = require('tsubaki');
|
||||
@@ -16,6 +16,7 @@ module.exports = class WantedCommand extends Command {
|
||||
usages: 1,
|
||||
duration: 15
|
||||
},
|
||||
clientPermissions: ['ATTACH_FILES'],
|
||||
args: [
|
||||
{
|
||||
key: 'user',
|
||||
@@ -27,9 +28,6 @@ module.exports = class WantedCommand extends Command {
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
||||
return msg.say('This Command requires the `Attach Files` Permission.');
|
||||
const { user } = args;
|
||||
const avatarURL = user.avatarURL('png', 512);
|
||||
if (!avatarURL) return msg.say('This user has no avatar.');
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const { stripIndents } = require('common-tags');
|
||||
|
||||
module.exports = class BattleCommand extends Command {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
|
||||
module.exports = class LotteryCommand extends Command {
|
||||
constructor(client) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const { RichEmbed } = require('discord.js');
|
||||
const math = require('mathjs');
|
||||
const operations = ['+', '-', '*'];
|
||||
@@ -10,6 +10,7 @@ module.exports = class MathGameCommand extends Command {
|
||||
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',
|
||||
@@ -26,9 +27,6 @@ module.exports = class MathGameCommand extends Command {
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
const { difficulty } = args;
|
||||
const operation = operations[Math.floor(Math.random() * operations.length)];
|
||||
let value;
|
||||
@@ -50,22 +48,21 @@ module.exports = class MathGameCommand extends Command {
|
||||
break;
|
||||
}
|
||||
const expression = `${Math.floor(Math.random() * value) + 1} ${operation} ${Math.floor(Math.random() * value) + 1}`;
|
||||
const solved = math.eval(expression).toString();
|
||||
const answer = math.eval(expression).toString();
|
||||
const embed = new RichEmbed()
|
||||
.setTitle('You have **10** seconds to answer:')
|
||||
.setDescription(expression);
|
||||
msg.embed(embed);
|
||||
await msg.embed(embed);
|
||||
try {
|
||||
const collected = await msg.channel.awaitMessages(res => res.author.id === msg.author.id, {
|
||||
max: 1,
|
||||
time: 10000,
|
||||
errors: ['time']
|
||||
});
|
||||
if (collected.first().content !== solved)
|
||||
return msg.say(`Nope! The correct answer is: ${solved}.`);
|
||||
return msg.say(`Perfect! ${solved} is the correct answer!`);
|
||||
if (collected.first().content !== answer) return msg.say(`Nope, sorry, it's ${answer}.`);
|
||||
return msg.say('Nice job! 10/10! You deserve some cake!');
|
||||
} catch (err) {
|
||||
return msg.say(`Time! The correct answer is ${solved}.`);
|
||||
return msg.say(`Time! It was ${answer}, sorry!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const { RichEmbed } = require('discord.js');
|
||||
const { stripIndents } = require('common-tags');
|
||||
const snekfetch = require('snekfetch');
|
||||
@@ -10,14 +10,12 @@ module.exports = class QuizCommand extends Command {
|
||||
aliases: ['jeopardy'],
|
||||
group: 'games',
|
||||
memberName: 'quiz',
|
||||
description: 'Answer a quiz question.'
|
||||
description: 'Answer a quiz question.',
|
||||
clientPermissions: ['EMBED_LINKS']
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
try {
|
||||
const { body } = await snekfetch
|
||||
.get('https://opentdb.com/api.php')
|
||||
@@ -33,15 +31,14 @@ module.exports = class QuizCommand extends Command {
|
||||
**${decodeURIComponent(body.results[0].category)}**
|
||||
True or False: ${decodeURIComponent(body.results[0].question)}
|
||||
`);
|
||||
msg.embed(embed);
|
||||
await msg.embed(embed);
|
||||
try {
|
||||
const collected = await msg.channel.awaitMessages(res => res.author.id === msg.author.id, {
|
||||
max: 1,
|
||||
time: 15000,
|
||||
errors: ['time']
|
||||
});
|
||||
if (collected.first().content.toLowerCase() !== answer)
|
||||
return msg.say(`Nope, sorry, it\'s ${answer}.`);
|
||||
if (collected.first().content.toLowerCase() !== answer) return msg.say(`Nope, sorry, it's ${answer}.`);
|
||||
return msg.say('Nice job! 10/10! You deserve some cake!');
|
||||
} catch (err) {
|
||||
return msg.say(`Time! It was ${answer}, sorry!`);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const responses = ['Paper', 'Rock', 'Scissors'];
|
||||
|
||||
module.exports = class RockPaperScissorsCommand extends Command {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const { stripIndents } = require('common-tags');
|
||||
const slotThing = [':grapes:', ':tangerine:', ':pear:', ':cherries:'];
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const { RichEmbed } = require('discord.js');
|
||||
const sentences = require('../../assets/json/typing-game');
|
||||
|
||||
@@ -9,6 +9,7 @@ module.exports = class TypingGameCommand extends Command {
|
||||
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',
|
||||
@@ -25,9 +26,6 @@ module.exports = class TypingGameCommand extends Command {
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
const { difficulty } = args;
|
||||
const sentence = sentences[Math.floor(Math.random() * sentences.length)];
|
||||
let time;
|
||||
@@ -51,18 +49,17 @@ module.exports = class TypingGameCommand extends Command {
|
||||
const embed = new RichEmbed()
|
||||
.setTitle(`You have **${time / 1000}** seconds to type:`)
|
||||
.setDescription(sentence);
|
||||
msg.embed(embed);
|
||||
await msg.embed(embed);
|
||||
try {
|
||||
const collected = await msg.channel.awaitMessages(res => res.author.id === msg.author.id, {
|
||||
max: 1,
|
||||
time: time,
|
||||
errors: ['time']
|
||||
});
|
||||
if (collected.first().content !== sentence)
|
||||
return msg.say('Nope, your sentence does not match the original. Try again next time!');
|
||||
if (collected.first().content !== sentence) return msg.say('Nope, sorry!');
|
||||
return msg.say(`Good Job! You won!`);
|
||||
} catch (err) {
|
||||
return msg.say('Time! Try again next time!');
|
||||
return msg.say('Time! Sorry!');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
|
||||
module.exports = class EmojiCommand extends Command {
|
||||
constructor(client) {
|
||||
@@ -6,13 +6,13 @@ module.exports = class EmojiCommand extends Command {
|
||||
name: 'emoji',
|
||||
group: 'guildinfo',
|
||||
memberName: 'emoji',
|
||||
description: 'Gives a list of the current server\'s custom emoji.',
|
||||
description: 'Gives a list of the server\'s custom emoji.',
|
||||
guildOnly: true
|
||||
});
|
||||
}
|
||||
|
||||
run(msg) {
|
||||
return msg.say(msg.guild.emojis.map(e => e).join(''))
|
||||
.catch(() => msg.say('There was an error sending the emoji. Perhaps you have no custom emoji?'));
|
||||
.catch(() => msg.say('There was an error sending the emoji.'));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const { RichEmbed } = require('discord.js');
|
||||
const { stripIndents } = require('common-tags');
|
||||
const moment = require('moment');
|
||||
@@ -11,14 +11,13 @@ module.exports = class GuildInfoCommand extends Command {
|
||||
aliases: ['guild', 'server', 'guild-info'],
|
||||
group: 'guildinfo',
|
||||
memberName: 'server-info',
|
||||
description: 'Gives some info on the current server.',
|
||||
guildOnly: true
|
||||
description: 'Gives some info on the server.',
|
||||
guildOnly: true,
|
||||
clientPermissions: ['EMBED_LINKS']
|
||||
});
|
||||
}
|
||||
|
||||
run(msg) {
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
const embed = new RichEmbed()
|
||||
.setColor(0x00AE86)
|
||||
.setThumbnail(msg.guild.iconURL())
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const { RichEmbed } = require('discord.js');
|
||||
const { stripIndents } = require('common-tags');
|
||||
|
||||
@@ -11,6 +11,9 @@ module.exports = class BanCommand extends Command {
|
||||
memberName: 'ban',
|
||||
description: 'Bans a user and logs the ban to the mod logs.',
|
||||
guildOnly: true,
|
||||
clientPermissions: ['BAN_MEMBERS'],
|
||||
userPermissions: ['BAN_MEMBERS'],
|
||||
allowStaff: true,
|
||||
args: [
|
||||
{
|
||||
key: 'member',
|
||||
@@ -30,22 +33,13 @@ module.exports = class BanCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
hasPermission(msg) {
|
||||
const staffRole = msg.guild.roles.get(msg.guild.settings.get('staffRole'));
|
||||
if (staffRole && !msg.member.roles.has(staffRole.id)) return `You do not have the ${staffRole.name} role.`;
|
||||
else if (!msg.member.hasPermission('BAN_MEMBERS')) return 'You do not have the `Ban Members` Permission.';
|
||||
else return true;
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('BAN_MEMBERS'))
|
||||
return msg.say('This Command requires the `Ban Members` Permission.');
|
||||
const modlogs = msg.guild.channels.get(msg.guild.settings.get('modLog'));
|
||||
if (!modlogs) return msg.say('This Command requires a channel set with the `modchannel` command.');
|
||||
if (!modlogs) return msg.say('This Command requires a channel set with the `mod-channel` command.');
|
||||
if (!modlogs.permissionsFor(this.client.user).has('SEND_MESSAGES'))
|
||||
return msg.say('This Command requires the `Send Messages` Permission for the Mod Log Channel.');
|
||||
return msg.say('This Command requires the `SEND_MESSAGES` Permission for the Mod Log Channel.');
|
||||
if (!modlogs.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
return msg.say('This Command requires the `EMBED_LINKS` Permission for the Mod Log Channel.');
|
||||
const { member, reason } = args;
|
||||
if (!member.bannable) return msg.say('This member is not bannable. Perhaps they have a higher role than me?');
|
||||
try {
|
||||
@@ -68,7 +62,7 @@ module.exports = class BanCommand extends Command {
|
||||
**Action:** Ban
|
||||
**Reason:** ${reason}
|
||||
`);
|
||||
await modlogs.send({ embed });
|
||||
modlogs.send({ embed });
|
||||
return null;
|
||||
} catch (err) {
|
||||
return msg.say(`${err.name}: ${err.message}`);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const { RichEmbed } = require('discord.js');
|
||||
const { stripIndents } = require('common-tags');
|
||||
|
||||
@@ -10,6 +10,9 @@ module.exports = class KickCommand extends Command {
|
||||
memberName: 'kick',
|
||||
description: 'Kicks a user and logs the kick to the mod logs.',
|
||||
guildOnly: true,
|
||||
clientPermissions: ['KICK_MEMBERS'],
|
||||
userPermissions: ['KICK_MEMBERS'],
|
||||
allowStaff: true,
|
||||
args: [
|
||||
{
|
||||
key: 'member',
|
||||
@@ -29,22 +32,13 @@ module.exports = class KickCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
hasPermission(msg) {
|
||||
const staffRole = msg.guild.roles.get(msg.guild.settings.get('staffRole'));
|
||||
if (staffRole && !msg.member.roles.has(staffRole.id)) return `You do not have the ${staffRole.name} role.`;
|
||||
else if (!msg.member.hasPermission('KICK_MEMBERS')) return 'You do not have the `Kick Members` Permission.';
|
||||
else return true;
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('KICK_MEMBERS'))
|
||||
return msg.say('This Command requires the `Kick Members` Permission.');
|
||||
const modlogs = msg.guild.channels.get(msg.guild.settings.get('modLog'));
|
||||
if (!modlogs) return msg.say('This Command requires a channel set with the `modchannel` command.');
|
||||
if (!modlogs) return msg.say('This Command requires a channel set with the `mod-channel` command.');
|
||||
if (!modlogs.permissionsFor(this.client.user).has('SEND_MESSAGES'))
|
||||
return msg.say('This Command requires the `Send Messages` Permission for the Mod Log Channel.');
|
||||
return msg.say('This Command requires the `SEND_MESSAGES` Permission for the Mod Log Channel.');
|
||||
if (!modlogs.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
return msg.say('This Command requires the `EMBED_LINKS` Permission for the Mod Log Channel.');
|
||||
const { member, reason } = args;
|
||||
if (!member.kickable) return msg.say('This member is not kickable. Perhaps they have a higher role than me?');
|
||||
try {
|
||||
@@ -67,7 +61,7 @@ module.exports = class KickCommand extends Command {
|
||||
**Action:** Kick
|
||||
**Reason:** ${reason}
|
||||
`);
|
||||
await modlogs.send({ embed });
|
||||
modlogs.send({ embed });
|
||||
return null;
|
||||
} catch (err) {
|
||||
return msg.say(`${err.name}: ${err.message}`);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const { stripIndents } = require('common-tags');
|
||||
|
||||
module.exports = class LockdownCommand extends Command {
|
||||
@@ -9,6 +9,9 @@ module.exports = class LockdownCommand extends Command {
|
||||
memberName: 'lockdown',
|
||||
description: 'Locks down the current channel or removes a lockdown, which prevents non-administrator members from speaking.',
|
||||
guildOnly: true,
|
||||
clientPermissions: ['ADMINISTRATOR'],
|
||||
userPermissions: ['ADMINISTRATOR'],
|
||||
allowStaff: true,
|
||||
args: [
|
||||
{
|
||||
key: 'type',
|
||||
@@ -25,16 +28,7 @@ module.exports = class LockdownCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
hasPermission(msg) {
|
||||
const staffRole = msg.guild.roles.get(msg.guild.settings.get('staffRole'));
|
||||
if (staffRole && !msg.member.roles.has(staffRole.id)) return `You do not have the ${staffRole.name} role.`;
|
||||
else if (!msg.member.hasPermission('ADMINISTRATOR')) return 'You do not have the `Administrator` Permission.';
|
||||
else return true;
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('ADMINISTRATOR'))
|
||||
return msg.say('This Command requires the `Administrator` Permission.');
|
||||
const { type } = args;
|
||||
if (type === 'start') {
|
||||
try {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
|
||||
module.exports = class PruneCommand extends Command {
|
||||
constructor(client) {
|
||||
@@ -12,6 +12,9 @@ module.exports = class PruneCommand extends Command {
|
||||
usages: 1,
|
||||
duration: 15
|
||||
},
|
||||
clientPermissions: ['READ_MESSAGE_HISTORY', 'MANAGE_MESSAGES'],
|
||||
userPermissions: ['MANAGE_MESSAGES'],
|
||||
allowStaff: true,
|
||||
args: [
|
||||
{
|
||||
key: 'count',
|
||||
@@ -26,19 +29,7 @@ module.exports = class PruneCommand extends Command {
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
hasPermission(msg) {
|
||||
const staffRole = msg.guild.roles.get(msg.guild.settings.get('staffRole'));
|
||||
if (staffRole && !msg.member.roles.has(staffRole.id)) return `You do not have the ${staffRole.name} role.`;
|
||||
else if (!msg.member.hasPermission('MANAGE_MESSAGES')) return 'You do not have the `Manage Messages` Permission.';
|
||||
else return true;
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('READ_MESSAGE_HISTORY'))
|
||||
return msg.say('This Command requires the `Read Message History` Permission.');
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('MANAGE_MESSAGES'))
|
||||
return msg.say('This Command requires the `Manage Messages` Permission.');
|
||||
const { count } = args;
|
||||
try {
|
||||
const messages = await msg.channel.fetchMessages({ limit: count + 1 });
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const { RichEmbed } = require('discord.js');
|
||||
const { stripIndents } = require('common-tags');
|
||||
|
||||
@@ -11,6 +11,9 @@ module.exports = class SoftbanCommand extends Command {
|
||||
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'],
|
||||
allowStaff: true,
|
||||
args: [
|
||||
{
|
||||
key: 'member',
|
||||
@@ -30,24 +33,13 @@ module.exports = class SoftbanCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
hasPermission(msg) {
|
||||
const staffRole = msg.guild.roles.get(msg.guild.settings.get('staffRole'));
|
||||
if (staffRole && !msg.member.roles.has(staffRole.id)) return `You do not have the ${staffRole.name} role.`;
|
||||
else if (!msg.member.hasPermission('KICK_MEMBERS')) return 'You do not have the `Kick Members` Permission.';
|
||||
else return true;
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('BAN_MEMBERS'))
|
||||
return msg.say('This Command requires the `Ban Members` Permission.');
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('KICK_MEMBERS'))
|
||||
return msg.say('This Command requires the `Kick Members` Permission.');
|
||||
const modlogs = msg.guild.channels.get(msg.guild.settings.get('modLog'));
|
||||
if (!modlogs) return msg.say('This Command requires a channel set with the `modchannel` command.');
|
||||
if (!modlogs) return msg.say('This Command requires a channel set with the `mod-channel` command.');
|
||||
if (!modlogs.permissionsFor(this.client.user).has('SEND_MESSAGES'))
|
||||
return msg.say('This Command requires the `Send Messages` Permission for the Mod Log Channel.');
|
||||
return msg.say('This Command requires the `SEND_MESSAGES` Permission for the Mod Log Channel.');
|
||||
if (!modlogs.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
return msg.say('This Command requires the `EMBED_LINKS` Permission for the Mod Log Channel.');
|
||||
const { member, reason } = args;
|
||||
if (!member.bannable) return msg.say('This member is not softbannable. Perhaps they have a higher role than me?');
|
||||
try {
|
||||
@@ -71,7 +63,7 @@ module.exports = class SoftbanCommand extends Command {
|
||||
**Action:** Softban
|
||||
**Reason:** ${reason}
|
||||
`);
|
||||
await modlogs.send({ embed });
|
||||
modlogs.send({ embed });
|
||||
return null;
|
||||
} catch (err) {
|
||||
return msg.say(`${err.name}: ${err.message}`);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const { RichEmbed } = require('discord.js');
|
||||
const { stripIndents } = require('common-tags');
|
||||
|
||||
@@ -11,6 +11,9 @@ module.exports = class UnbanCommand extends Command {
|
||||
memberName: 'unban',
|
||||
description: 'Unbans a user and logs the unban to the mod logs.',
|
||||
guildOnly: true,
|
||||
clientPermissions: ['BAN_MEMBERS'],
|
||||
userPermissions: ['BAN_MEMBERS'],
|
||||
allowStaff: true,
|
||||
args: [
|
||||
{
|
||||
key: 'id',
|
||||
@@ -30,22 +33,13 @@ module.exports = class UnbanCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
hasPermission(msg) {
|
||||
const staffRole = msg.guild.roles.get(msg.guild.settings.get('staffRole'));
|
||||
if (staffRole && !msg.member.roles.has(staffRole.id)) return `You do not have the ${staffRole.name} role.`;
|
||||
else if (!msg.member.hasPermission('BAN_MEMBERS')) return 'You do not have the `Ban Members` Permission.';
|
||||
else return true;
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('BAN_MEMBERS'))
|
||||
return msg.say('This Command requires the `Ban Members` Permission.');
|
||||
const modlogs = msg.guild.channels.get(msg.guild.settings.get('modLog'));
|
||||
if (!modlogs) return msg.say('This Command requires a channel set with the `modchannel` command.');
|
||||
if (!modlogs) return msg.say('This Command requires a channel set with the `mod-channel` command.');
|
||||
if (!modlogs.permissionsFor(this.client.user).has('SEND_MESSAGES'))
|
||||
return msg.say('This Command requires the `Send Messages` Permission for the Mod Log Channel.');
|
||||
return msg.say('This Command requires the `SEND_MESSAGES` Permission for the Mod Log Channel.');
|
||||
if (!modlogs.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
return msg.say('This Command requires the `EMBED_LINKS` Permission for the Mod Log Channel.');
|
||||
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.');
|
||||
@@ -62,7 +56,7 @@ module.exports = class UnbanCommand extends Command {
|
||||
**Action:** Unban
|
||||
**Reason:** ${reason}
|
||||
`);
|
||||
await modlogs.send({ embed });
|
||||
modlogs.send({ embed });
|
||||
return null;
|
||||
} catch (err) {
|
||||
return msg.say(`${err.name}: ${err.message}`);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const { RichEmbed } = require('discord.js');
|
||||
const { stripIndents } = require('common-tags');
|
||||
|
||||
@@ -10,6 +10,8 @@ module.exports = class WarnCommand extends Command {
|
||||
memberName: 'warn',
|
||||
description: 'Warns a user and logs the warn to the mod logs.',
|
||||
guildOnly: true,
|
||||
allowStaff: true,
|
||||
userPermissions: ['KICK_MEMBERS'],
|
||||
args: [
|
||||
{
|
||||
key: 'member',
|
||||
@@ -29,20 +31,13 @@ module.exports = class WarnCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
hasPermission(msg) {
|
||||
const staffRole = msg.guild.roles.get(msg.guild.settings.get('staffRole'));
|
||||
if (staffRole && !msg.member.roles.has(staffRole.id)) return `You do not have the ${staffRole.name} role.`;
|
||||
else if (!msg.member.hasPermission('KICK_MEMBERS')) return 'You do not have the `Kick Members` Permission.';
|
||||
else return true;
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const modlogs = msg.guild.channels.get(msg.guild.settings.get('modLog'));
|
||||
if (!modlogs) return msg.say('This Command requires a channel set with the `modchannel` command.');
|
||||
if (!modlogs) return msg.say('This Command requires a channel set with the `mod-channel` command.');
|
||||
if (!modlogs.permissionsFor(this.client.user).has('SEND_MESSAGES'))
|
||||
return msg.say('This Command requires the `Send Messages` Permission for the Mod Log Channel.');
|
||||
return msg.say('This Command requires the `SEND_MESSAGES` Permission for the Mod Log Channel.');
|
||||
if (!modlogs.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
return msg.say('This Command requires the `EMBED_LINKS` Permission for the Mod Log Channel.');
|
||||
const { member, reason } = args;
|
||||
if (!member.kickable) return msg.say('This member is not warnable. Perhaps they have a higher role than me?');
|
||||
try {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const snekfetch = require('snekfetch');
|
||||
const codes = require('../../assets/json/currency');
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const math = require('mathjs');
|
||||
|
||||
module.exports = class MathCommand extends Command {
|
||||
@@ -22,10 +22,9 @@ module.exports = class MathCommand extends Command {
|
||||
const { expression } = args;
|
||||
try {
|
||||
const solved = math.eval(expression);
|
||||
return msg.say(solved)
|
||||
.catch(() => msg.say('Invalid statement.'));
|
||||
return msg.say(solved).catch(() => msg.say('Invalid Statement.'));
|
||||
} catch (err) {
|
||||
return msg.say('Invalid statement.');
|
||||
return msg.say('Invalid Statement.');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
|
||||
module.exports = class TemperatureCommand extends Command {
|
||||
constructor(client) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const Cleverbot = require('cleverio');
|
||||
const { CLEVS_KEY, CLEVS_USER, CLEVS_NICK } = process.env;
|
||||
|
||||
@@ -32,8 +32,7 @@ module.exports = class CleverbotCommand extends Command {
|
||||
msg.channel.startTyping();
|
||||
try {
|
||||
const { response } = await this.clevs.ask(text);
|
||||
return msg.reply(response)
|
||||
.then(() => msg.channel.stopTyping());
|
||||
return msg.reply(response).then(() => msg.channel.stopTyping());
|
||||
} catch (err) {
|
||||
return msg.say(`${err.name}: ${err.message}`);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const eastereggs = require('../../assets/json/easter-egg');
|
||||
|
||||
module.exports = class EasterEggCommand extends Command {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
|
||||
module.exports = class GiveFlowerCommand extends Command {
|
||||
constructor(client) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const { RichEmbed } = require('discord.js');
|
||||
const snekfetch = require('snekfetch');
|
||||
const signs = require('../../assets/json/horoscope');
|
||||
@@ -11,6 +11,7 @@ module.exports = class HoroscopeCommand extends Command {
|
||||
memberName: 'horoscope',
|
||||
description: 'Gives the horoscope for today for a particular sign.',
|
||||
details: `**Signs:** ${signs.join(', ')}`,
|
||||
clientPermissions: ['EMBED_LINKS'],
|
||||
args: [
|
||||
{
|
||||
key: 'sign',
|
||||
@@ -27,9 +28,6 @@ module.exports = class HoroscopeCommand extends Command {
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
const { sign } = args;
|
||||
try {
|
||||
const { text } = await snekfetch
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
|
||||
module.exports = class LennyCommand extends Command {
|
||||
constructor(client) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const codes = require('../../assets/json/meme');
|
||||
|
||||
module.exports = class MemeCommand extends Command {
|
||||
@@ -9,6 +9,7 @@ module.exports = class MemeCommand extends Command {
|
||||
memberName: 'meme',
|
||||
description: 'Sends a Meme with text of your choice, and a background of your choice.',
|
||||
details: `**Codes:** ${codes.join(', ')}`,
|
||||
clientPermissions: ['ATTACH_FILES'],
|
||||
args: [
|
||||
{
|
||||
key: 'type',
|
||||
@@ -37,9 +38,6 @@ module.exports = class MemeCommand extends Command {
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
||||
return msg.say('This Command requires the `Attach Files` Permission.');
|
||||
const { type, top, bottom } = args;
|
||||
return msg.say({ files: [`https://memegen.link/${type}/${top}/${bottom}.jpg`] })
|
||||
.catch(err => msg.say(`${err.name}: ${err.message}`));
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const { RichEmbed } = require('discord.js');
|
||||
const { stripIndents } = require('common-tags');
|
||||
|
||||
@@ -8,14 +8,12 @@ module.exports = class NitroCommand extends Command {
|
||||
name: 'nitro',
|
||||
group: 'random',
|
||||
memberName: 'nitro',
|
||||
description: 'Sends a "This Message Can Only be viewed by Nitro Members" message.'
|
||||
description: 'Sends a "This Message Can Only be viewed by Nitro Members" message.',
|
||||
clientPermissions: ['EMBED_LINKS']
|
||||
});
|
||||
}
|
||||
|
||||
run(msg) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
const embed = new RichEmbed()
|
||||
.setAuthor('Discord Nitro')
|
||||
.setThumbnail('https://i.imgur.com/wzhMMnl.jpg')
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const { names, paths } = require('../../assets/json/soundboard');
|
||||
const path = require('path');
|
||||
|
||||
@@ -16,6 +16,7 @@ module.exports = class SoundboardCommand extends Command {
|
||||
usages: 1,
|
||||
duration: 15
|
||||
},
|
||||
clientPermissions: ['ADD_REACTIONS'],
|
||||
args: [
|
||||
{
|
||||
key: 'sound',
|
||||
@@ -32,14 +33,12 @@ module.exports = class SoundboardCommand extends Command {
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('ADD_REACTIONS'))
|
||||
return msg.say('This Command requires the `Add Reactions` Permission.');
|
||||
const voiceChannel = msg.member.voiceChannel;
|
||||
if (!voiceChannel) return msg.say('Please enter a Voice Channel first.');
|
||||
if (!voiceChannel.permissionsFor(this.client.user).has('CONNECT'))
|
||||
return msg.say('This Command requires the `Connect` Permission.');
|
||||
return msg.say('This Command requires the `CONNECT` Permission.');
|
||||
if (!voiceChannel.permissionsFor(this.client.user).has('SPEAK'))
|
||||
return msg.say('This Command requires the `Speak` Permission.');
|
||||
return msg.say('This Command requires the `SPEAK` Permission.');
|
||||
if (!voiceChannel.joinable) return msg.say('This Voice Channel is not joinable.');
|
||||
const alreadyConnected = this.client.voiceConnections.get(voiceChannel.guild.id);
|
||||
if (alreadyConnected) return msg.say('I am already playing a sound.');
|
||||
@@ -47,7 +46,7 @@ module.exports = class SoundboardCommand extends Command {
|
||||
try {
|
||||
const connection = await voiceChannel.join();
|
||||
msg.react('🔊');
|
||||
const dispatcher = connection.playStream(path.join(__dirname, '..', '..', 'assets', 'sounds', paths[sound]));
|
||||
const dispatcher = connection.playFile(path.join(__dirname, '..', '..', 'assets', 'sounds', paths[sound]));
|
||||
dispatcher.on('end', () => {
|
||||
voiceChannel.leave();
|
||||
msg.react('✅');
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const path = require('path');
|
||||
|
||||
module.exports = class SpamCommand extends Command {
|
||||
@@ -7,14 +7,12 @@ module.exports = class SpamCommand extends Command {
|
||||
name: 'spam',
|
||||
group: 'random',
|
||||
memberName: 'spam',
|
||||
description: 'Puts a picture of Spam.'
|
||||
description: 'Puts a picture of Spam.',
|
||||
clientPermissions: ['ATTACH_FILES']
|
||||
});
|
||||
}
|
||||
|
||||
run(msg) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
||||
return msg.say('This Command requires the `Attach Files` Permission.');
|
||||
return msg.say({ files: [path.join(__dirname, '..', '..', 'assets', 'images', 'spam.png')] })
|
||||
.catch(err => msg.say(`${err.name}: ${err.message}`));
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const { RichEmbed } = require('discord.js');
|
||||
const moment = require('moment');
|
||||
|
||||
@@ -24,7 +24,7 @@ module.exports = class StarCommand extends Command {
|
||||
async run(msg, args, reaction) {
|
||||
const { id } = args;
|
||||
const channel = msg.guild.channels.get(msg.guild.settings.get('starboard'));
|
||||
if (!channel || !channel.permissionsFor(this.client.user).has('EMBED_LINKS')) return null;
|
||||
if (!channel || !channel.permissionsFor(this.client.user).has(['SEND_MESSAGES', 'EMBED_LINKS'])) return null;
|
||||
if (this.starred.includes(id)) return null;
|
||||
try {
|
||||
const message = await msg.channel.fetchMessage(id);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const { stripIndents } = require('common-tags');
|
||||
const snekfetch = require('snekfetch');
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const { RichEmbed } = require('discord.js');
|
||||
const snekfetch = require('snekfetch');
|
||||
|
||||
@@ -8,14 +8,12 @@ module.exports = class TodayCommand extends Command {
|
||||
name: 'today',
|
||||
group: 'random',
|
||||
memberName: 'today',
|
||||
description: 'Tells you what happened today in history.'
|
||||
description: 'Tells you what happened today in history.',
|
||||
clientPermissions: ['EMBED_LINKS']
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
try {
|
||||
const { text } = await snekfetch
|
||||
.get('http://history.muffinlabs.com/date');
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const { RichEmbed } = require('discord.js');
|
||||
const snekfetch = require('snekfetch');
|
||||
|
||||
@@ -9,14 +9,12 @@ module.exports = class WouldYouRatherCommand extends Command {
|
||||
aliases: ['wyrather'],
|
||||
group: 'random',
|
||||
memberName: 'would-you-rather',
|
||||
description: 'Gets a random would you rather question.'
|
||||
description: 'Gets a random would you rather question.',
|
||||
clientPermissions: ['EMBED_LINKS']
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
try {
|
||||
const { body } = await snekfetch
|
||||
.get('http://www.rrrather.com/botapi');
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const snekfetch = require('snekfetch');
|
||||
|
||||
module.exports = class CatCommand extends Command {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const snekfetch = require('snekfetch');
|
||||
|
||||
module.exports = class DogCommand extends Command {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const songs = require('../../assets/json/vocaloid');
|
||||
|
||||
module.exports = class VocaloidCommand extends Command {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const path = require('path');
|
||||
|
||||
module.exports = class XiaoCommand extends Command {
|
||||
@@ -8,14 +8,12 @@ module.exports = class XiaoCommand extends Command {
|
||||
aliases: ['xiao-pai'],
|
||||
group: 'randomimg',
|
||||
memberName: 'xiao',
|
||||
description: 'Sends a random image of Xiao Pai.'
|
||||
description: 'Sends a random image of Xiao Pai.',
|
||||
clientPermissions: ['ATTACH_FILES']
|
||||
});
|
||||
}
|
||||
|
||||
run(msg) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
||||
return msg.say('This Command requires the `Attach Files` Permission.');
|
||||
const xiao = Math.floor(Math.random() * 10) + 1;
|
||||
return msg.say({ files: [path.join(__dirname, '..', '..', 'assets', 'images', `xiao${xiao}.png`)] })
|
||||
.catch(err => msg.say(`${err.name}: ${err.message}`));
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const { RichEmbed } = require('discord.js');
|
||||
const snekfetch = require('snekfetch');
|
||||
|
||||
@@ -10,6 +10,7 @@ module.exports = class XKCDCommand extends Command {
|
||||
group: 'randomimg',
|
||||
memberName: 'xkcd',
|
||||
description: 'Gets an XKCD Comic, optionally opting for today\'s.',
|
||||
clientPermissions: ['EMBED_LINKS'],
|
||||
args: [
|
||||
{
|
||||
key: 'type',
|
||||
@@ -26,9 +27,6 @@ module.exports = class XKCDCommand extends Command {
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
||||
return msg.say('This Command requires the `Attach Files` Permission.');
|
||||
const { type } = args;
|
||||
try {
|
||||
const current = await snekfetch
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const { stripIndents } = require('common-tags');
|
||||
const answers = require('../../assets/json/8-ball');
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
|
||||
module.exports = class ChooseCommand extends Command {
|
||||
constructor(client) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const sides = ['heads', 'tails'];
|
||||
|
||||
module.exports = class CoinFlipCommand extends Command {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const compliments = require('../../assets/json/compliment');
|
||||
|
||||
module.exports = class ComplimentCommand extends Command {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const facts = require('../../assets/json/fact-core');
|
||||
|
||||
module.exports = class FactCoreCommand extends Command {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const fishes = [':fish:', ':tropical_fish:', ':blowfish:'];
|
||||
|
||||
module.exports = class FishyCommand extends Command {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const fortunes = require('../../assets/json/fortune');
|
||||
|
||||
module.exports = class FortuneCookieCommand extends Command {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const { stripIndents } = require('common-tags');
|
||||
const answers = require('../../assets/json/magic-conch');
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const { lastNames, maleNames, femaleNames } = require('../../assets/json/name');
|
||||
|
||||
module.exports = class RandomNameCommand extends Command {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const genders = ['boy', 'girl'];
|
||||
|
||||
module.exports = class OffspringCommand extends Command {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const sides = ['on nothing', 'on NaN', 'on 0', 'in the air', 'on null'];
|
||||
|
||||
module.exports = class QuantumCoinCommand extends Command {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
|
||||
module.exports = class RateWaifuCommand extends Command {
|
||||
constructor(client) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const roasts = require('../../assets/json/roast');
|
||||
|
||||
module.exports = class RoastCommand extends Command {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
|
||||
module.exports = class RollCommand extends Command {
|
||||
constructor(client) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
|
||||
module.exports = class RouletteCommand extends Command {
|
||||
constructor(client) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
|
||||
module.exports = class ShipCommand extends Command {
|
||||
constructor(client) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
|
||||
module.exports = class CuddleCommand extends Command {
|
||||
constructor(client) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
|
||||
module.exports = class DivorceCommand extends Command {
|
||||
constructor(client) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
|
||||
module.exports = class EatCommand extends Command {
|
||||
constructor(client) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
|
||||
module.exports = class FalconPunchCommand extends Command {
|
||||
constructor(client) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
|
||||
module.exports = class FistBumpCommand extends Command {
|
||||
constructor(client) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
|
||||
module.exports = class HighFivesCommand extends Command {
|
||||
constructor(client) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
|
||||
module.exports = class HitwithShovelCommand extends Command {
|
||||
constructor(client) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
|
||||
module.exports = class HugCommand extends Command {
|
||||
constructor(client) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
|
||||
module.exports = class InhaleCommand extends Command {
|
||||
constructor(client) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
|
||||
module.exports = class KillCommand extends Command {
|
||||
constructor(client) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
|
||||
module.exports = class KissCommand extends Command {
|
||||
constructor(client) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
|
||||
module.exports = class MarryCommand extends Command {
|
||||
constructor(client) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
|
||||
module.exports = class PatCommand extends Command {
|
||||
constructor(client) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
|
||||
module.exports = class PokeCommand extends Command {
|
||||
constructor(client) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
|
||||
module.exports = class PunchCommand extends Command {
|
||||
constructor(client) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
|
||||
module.exports = class SlapCommand extends Command {
|
||||
constructor(client) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const { RichEmbed } = require('discord.js');
|
||||
const snekfetch = require('snekfetch');
|
||||
const { promisifyAll } = require('tsubaki');
|
||||
@@ -12,6 +12,7 @@ module.exports = class AnimeCommand extends Command {
|
||||
group: 'search',
|
||||
memberName: 'anime',
|
||||
description: 'Searches My Anime List for a specified anime.',
|
||||
clientPermissions: ['EMBED_LINKS'],
|
||||
args: [
|
||||
{
|
||||
key: 'query',
|
||||
@@ -23,9 +24,6 @@ module.exports = class AnimeCommand extends Command {
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
const { query } = args;
|
||||
try {
|
||||
const { text } = await snekfetch
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const { RichEmbed } = require('discord.js');
|
||||
const snekfetch = require('snekfetch');
|
||||
const { DBOTS_KEY } = process.env;
|
||||
@@ -10,6 +10,7 @@ module.exports = class BotSearchCommand extends Command {
|
||||
group: 'search',
|
||||
memberName: 'bot-info',
|
||||
description: 'Searches Discord Bots for info on a bot.',
|
||||
clientPermissions: ['EMBED_LINKS'],
|
||||
args: [
|
||||
{
|
||||
key: 'bot',
|
||||
@@ -21,14 +22,11 @@ module.exports = class BotSearchCommand extends Command {
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
const { bot } = args;
|
||||
try {
|
||||
const { body } = await snekfetch
|
||||
.get(`https://bots.discord.pw/api/bots/${bot.id}`)
|
||||
.set({ 'Authorization': DBOTS_KEY });
|
||||
.set({ Authorization: DBOTS_KEY });
|
||||
const embed = new RichEmbed()
|
||||
.setColor(0x9797FF)
|
||||
.setAuthor('Discord Bots', 'https://i.imgur.com/lrKYBQi.jpg')
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const { RichEmbed } = require('discord.js');
|
||||
const snekfetch = require('snekfetch');
|
||||
|
||||
@@ -10,6 +10,7 @@ module.exports = class BulbapediaCommand extends Command {
|
||||
group: 'search',
|
||||
memberName: 'bulbapedia',
|
||||
description: 'Searches Bulbapedia for something.',
|
||||
clientPermissions: ['EMBED_LINKS'],
|
||||
args: [
|
||||
{
|
||||
key: 'query',
|
||||
@@ -21,9 +22,6 @@ module.exports = class BulbapediaCommand extends Command {
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
const { query } = args;
|
||||
try {
|
||||
const { body } = await snekfetch
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const snekfetch = require('snekfetch');
|
||||
|
||||
module.exports = class DanbooruCommand extends Command {
|
||||
@@ -8,6 +8,7 @@ module.exports = class DanbooruCommand extends Command {
|
||||
group: 'search',
|
||||
memberName: 'danbooru',
|
||||
description: 'Sends an image from Danbooru, with optional query.',
|
||||
nsfw: true,
|
||||
args: [
|
||||
{
|
||||
key: 'query',
|
||||
@@ -20,7 +21,6 @@ module.exports = class DanbooruCommand extends Command {
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
if (!msg.channel.nsfw) return msg.say('This Command can only be used in NSFW Channels.');
|
||||
const { query } = args;
|
||||
try {
|
||||
const { body } = await snekfetch
|
||||
@@ -30,6 +30,7 @@ module.exports = class DanbooruCommand extends Command {
|
||||
limit: 1
|
||||
});
|
||||
if (!body.length) throw new Error('No Results.');
|
||||
if (!body[0].file_url) throw new Error('No Results.');
|
||||
return msg.say(`${query ? `Result for ${query}:` : 'Random Image:'} https://danbooru.donmai.us${body[0].file_url}`);
|
||||
} catch (err) {
|
||||
return msg.say(`${err.name}: ${err.message}`);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const { RichEmbed } = require('discord.js');
|
||||
const snekfetch = require('snekfetch');
|
||||
const { WORDNIK_KEY } = process.env;
|
||||
@@ -10,6 +10,7 @@ module.exports = class DefineCommand extends Command {
|
||||
group: 'search',
|
||||
memberName: 'define',
|
||||
description: 'Defines a word.',
|
||||
clientPermissions: ['EMBED_LINKS'],
|
||||
args: [
|
||||
{
|
||||
key: 'query',
|
||||
@@ -22,9 +23,6 @@ module.exports = class DefineCommand extends Command {
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
const { query } = args;
|
||||
try {
|
||||
const { body } = await snekfetch
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const { RichEmbed } = require('discord.js');
|
||||
|
||||
module.exports = class DiscrimCommand extends Command {
|
||||
@@ -9,6 +9,7 @@ module.exports = class DiscrimCommand extends Command {
|
||||
group: 'search',
|
||||
memberName: 'discrim',
|
||||
description: 'Searches for other users with a certain discriminator.',
|
||||
clientPermissions: ['EMBED_LINKS'],
|
||||
args: [
|
||||
{
|
||||
key: 'discrim',
|
||||
@@ -24,9 +25,6 @@ module.exports = class DiscrimCommand extends Command {
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
const { discrim } = args;
|
||||
const users = this.client.users.filter(u => u.discriminator === discrim).map(u => u.username).sort();
|
||||
const embed = new RichEmbed()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const { RichEmbed } = require('discord.js');
|
||||
const snekfetch = require('snekfetch');
|
||||
|
||||
@@ -9,6 +9,7 @@ module.exports = class ForecastCommand extends Command {
|
||||
group: 'search',
|
||||
memberName: 'forecast',
|
||||
description: 'Gets the seven-day forecast for a specified location.',
|
||||
clientPermissions: ['EMBED_LINKS'],
|
||||
args: [
|
||||
{
|
||||
key: 'query',
|
||||
@@ -20,9 +21,6 @@ module.exports = class ForecastCommand extends Command {
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
const { query } = args;
|
||||
try {
|
||||
const { body } = await snekfetch
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const snekfetch = require('snekfetch');
|
||||
const { promisifyAll } = require('tsubaki');
|
||||
const xml = promisifyAll(require('xml2js'));
|
||||
@@ -10,6 +10,7 @@ module.exports = class GelbooruCommand extends Command {
|
||||
group: 'search',
|
||||
memberName: 'gelbooru',
|
||||
description: 'Sends an image from Gelbooru, with query.',
|
||||
nsfw: true,
|
||||
args: [
|
||||
{
|
||||
key: 'query',
|
||||
@@ -21,7 +22,6 @@ module.exports = class GelbooruCommand extends Command {
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
if (!msg.channel.nsfw) return msg.say('This Command can only be used in NSFW Channels.');
|
||||
const { query } = args;
|
||||
try {
|
||||
const { text } = await snekfetch
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const snekfetch = require('snekfetch');
|
||||
const { GIPHY_KEY } = process.env;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const { RichEmbed } = require('discord.js');
|
||||
const snekfetch = require('snekfetch');
|
||||
const moment = require('moment');
|
||||
@@ -11,6 +11,7 @@ module.exports = class GithubCommand extends Command {
|
||||
group: 'search',
|
||||
memberName: 'github',
|
||||
description: 'Gets repo information from GitHub.',
|
||||
clientPermissions: ['EMBED_LINKS'],
|
||||
args: [
|
||||
{
|
||||
key: 'repo',
|
||||
@@ -22,9 +23,6 @@ module.exports = class GithubCommand extends Command {
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
const { repo } = args;
|
||||
try {
|
||||
const { body } = await snekfetch
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const snekfetch = require('snekfetch');
|
||||
const cheerio = require('cheerio');
|
||||
const querystring = require('querystring');
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const snekfetch = require('snekfetch');
|
||||
|
||||
module.exports = class KonachanCommand extends Command {
|
||||
@@ -8,6 +8,7 @@ module.exports = class KonachanCommand extends Command {
|
||||
group: 'search',
|
||||
memberName: 'konachan',
|
||||
description: 'Sends an image from Konachan, with optional query.',
|
||||
nsfw: true,
|
||||
args: [
|
||||
{
|
||||
key: 'query',
|
||||
@@ -20,7 +21,6 @@ module.exports = class KonachanCommand extends Command {
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
if (!msg.channel.nsfw) return msg.say('This Command can only be used in NSFW Channels.');
|
||||
const { query } = args;
|
||||
try {
|
||||
const { body } = await snekfetch
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
|
||||
module.exports = class LMGTFYCommand extends Command {
|
||||
constructor(client) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const { RichEmbed } = require('discord.js');
|
||||
const snekfetch = require('snekfetch');
|
||||
const { promisifyAll } = require('tsubaki');
|
||||
@@ -12,6 +12,7 @@ module.exports = class MangaCommand extends Command {
|
||||
group: 'search',
|
||||
memberName: 'manga',
|
||||
description: 'Searches My Anime List for a specified manga.',
|
||||
clientPermissions: ['EMBED_LINKS'],
|
||||
args: [
|
||||
{
|
||||
key: 'query',
|
||||
@@ -23,9 +24,6 @@ module.exports = class MangaCommand extends Command {
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
const { query } = args;
|
||||
try {
|
||||
const { text } = await snekfetch
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const snekfetch = require('snekfetch');
|
||||
const { GOOGLE_KEY } = process.env;
|
||||
|
||||
@@ -9,6 +9,7 @@ module.exports = class MapCommand extends Command {
|
||||
group: 'search',
|
||||
memberName: 'map',
|
||||
description: 'Gets a map image for the location you define with the zoom level you define (1-20).',
|
||||
clientPermissions: ['ATTACH_FILES'],
|
||||
args: [
|
||||
{
|
||||
key: 'zoom',
|
||||
@@ -31,9 +32,6 @@ module.exports = class MapCommand extends Command {
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
||||
return msg.say('This Command requires the `Attach Files` Permission.');
|
||||
const { zoom, query } = args;
|
||||
try {
|
||||
const { body } = await snekfetch
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const snekfetch = require('snekfetch');
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Command = require('../../structures/Command');
|
||||
const { RichEmbed } = require('discord.js');
|
||||
const snekfetch = require('snekfetch');
|
||||
const { OSU_KEY } = process.env;
|
||||
@@ -10,6 +10,7 @@ module.exports = class OsuCommand extends Command {
|
||||
group: 'search',
|
||||
memberName: 'osu',
|
||||
description: 'Searches Osu! user data.',
|
||||
clientPermissions: ['EMBED_LINKS'],
|
||||
args: [
|
||||
{
|
||||
key: 'query',
|
||||
@@ -21,9 +22,6 @@ module.exports = class OsuCommand extends Command {
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
const { query } = args;
|
||||
try {
|
||||
const { body } = await snekfetch
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user