Auto-Aliases

This commit is contained in:
Daniel Odendahl Jr
2017-05-07 17:34:59 +00:00
parent 0a1bc41b26
commit 52e299b1b4
44 changed files with 83 additions and 89 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ module.exports = class BeautifulCommand extends Command {
super(client, {
name: 'beautiful',
aliases: [
'grunklestan'
'grunkle-stan'
],
group: 'avataredit',
memberName: 'beautiful',
+2 -2
View File
@@ -4,12 +4,12 @@ const Jimp = require('jimp');
module.exports = class BobRossCommand extends Command {
constructor(client) {
super(client, {
name: 'bobross',
name: 'bob-ross',
aliases: [
'ross'
],
group: 'avataredit',
memberName: 'bobross',
memberName: 'bob-ross',
description: 'Make Bob Ross draw an avatar.',
args: [
{
+3
View File
@@ -5,6 +5,9 @@ module.exports = class GreyscaleCommand extends Command {
constructor(client) {
super(client, {
name: 'greyscale',
aliases: [
'grayscale'
],
group: 'avataredit',
memberName: 'greyscale',
description: 'Greyscale a user\'s avatar colors.',
+1 -1
View File
@@ -7,7 +7,7 @@ module.exports = class RIPCommand extends Command {
name: 'rip',
aliases: [
'grave',
'gravestone'
'grave-stone'
],
group: 'avataredit',
memberName: 'rip',
+2 -2
View File
@@ -4,12 +4,12 @@ const Jimp = require('jimp');
module.exports = class SteamCardCommand extends Command {
constructor(client) {
super(client, {
name: 'steamcard',
name: 'steam-card',
aliases: [
'card'
],
group: 'avataredit',
memberName: 'steamcard',
memberName: 'steam-card',
description: 'Put an avatar on a Steam Card.',
args: [
{
+2 -2
View File
@@ -6,9 +6,9 @@ const operations = ['+', '-', '*'];
module.exports = class MathGameCommand extends Command {
constructor(client) {
super(client, {
name: 'mathgame',
name: 'math-game',
group: 'games',
memberName: 'mathgame',
memberName: 'math-game',
description: 'See how fast you can answer a math problem in a given time limit.',
args: [
{
+3 -3
View File
@@ -4,12 +4,12 @@ const responses = ['Paper', 'Rock', 'Scissors'];
module.exports = class RockPaperScissorsCommand extends Command {
constructor(client) {
super(client, {
name: 'rps',
name: 'rock-paper-scissors',
aliases: [
'rockpaperscissors'
'rps'
],
group: 'games',
memberName: 'rps',
memberName: 'rock-paper-scissors',
description: 'Play Rock-Paper-Scissors.',
args: [
{
+2 -2
View File
@@ -5,9 +5,9 @@ const sentences = require('./sentences');
module.exports = class TypingGameCommand extends Command {
constructor(client) {
super(client, {
name: 'typinggame',
name: 'typing-game',
group: 'games',
memberName: 'typinggame',
memberName: 'typing-game',
description: 'See how fast you can type a sentence in a given time limit.',
args: [
{
+2 -2
View File
@@ -10,8 +10,8 @@ module.exports = class GuildInfoCommand extends Command {
name: 'server',
aliases: [
'guild',
'serverinfo',
'guildinfo'
'server-info',
'guild-info'
],
group: 'guildinfo',
memberName: 'server',
+2 -4
View File
@@ -40,13 +40,11 @@ module.exports = class BanCommand extends Command {
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 `modchannel` command.');
if(!modlogs.permissionsFor(this.client.user).has('EMBED_LINKS'))
return msg.say('This Command requires the `Embed Links` Permission.');
const { member, reason } = args;
if(!member.bannable)
return msg.say('This member is not bannable. Perhaps they have a higher role than me?');
if(!member.bannable) return msg.say('This member is not bannable. Perhaps they have a higher role than me?');
try {
try {
await member.send(stripIndents`
+2 -4
View File
@@ -37,13 +37,11 @@ module.exports = class KickCommand extends Command {
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 `modchannel` command.');
if(!modlogs.permissionsFor(this.client.user).has('EMBED_LINKS'))
return msg.say('This Command requires the `Embed Links` Permission.');
const { member, reason } = args;
if(!member.kickable)
return msg.say('This member is not kickable. Perhaps they have a higher role than me?');
if(!member.kickable) return msg.say('This member is not kickable. Perhaps they have a higher role than me?');
try {
try {
await member.send(stripIndents`
+2 -4
View File
@@ -39,13 +39,11 @@ module.exports = class SoftbanCommand extends Command {
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 `modchannel` command.');
if(!modlogs.permissionsFor(this.client.user).has('EMBED_LINKS'))
return msg.say('This Command requires the `Embed Links` Permission.');
const { member, reason } = args;
if(!member.bannable)
return msg.say('This member is not bannable. Perhaps they have a higher role than me?');
if(!member.bannable) return msg.say('This member is not bannable. Perhaps they have a higher role than me?');
try {
try {
await member.send(stripIndents`
+2 -4
View File
@@ -44,14 +44,12 @@ module.exports = class UnbanCommand extends Command {
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 `modchannel` command.');
if(!modlogs.permissionsFor(this.client.user).has('EMBED_LINKS'))
return msg.say('This Command requires the `Embed Links` Permission.');
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.');
if(!bans.has(id)) return msg.say('This ID is not in the Guild Banlist.');
const member = bans.get(id);
try {
await msg.guild.unban(member);
+1 -2
View File
@@ -35,8 +35,7 @@ module.exports = class WarnCommand extends Command {
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 `modchannel` command.');
if(!modlogs.permissionsFor(this.client.user).has('EMBED_LINKS'))
return msg.say('This Command requires the `Embed Links` Permission.');
const { member, reason } = args;
+2 -2
View File
@@ -4,12 +4,12 @@ const eastereggs = require('./eastereggs');
module.exports = class EasterEggCommand extends Command {
constructor(client) {
super(client, {
name: 'easteregg',
name: 'easter-egg',
aliases: [
'tag'
],
group: 'random',
memberName: 'easteregg',
memberName: 'easter-egg',
description: 'Can you discover all the easter eggs?',
args: [
{
+2 -2
View File
@@ -3,9 +3,9 @@ const { Command } = require('discord.js-commando');
module.exports = class GiveFlowerCommand extends Command {
constructor(client) {
super(client, {
name: 'giveflower',
name: 'give-flower',
group: 'random',
memberName: 'giveflower',
memberName: 'give-flower',
description: 'Gives Xiao Pai a flower.'
});
}
+2 -4
View File
@@ -35,10 +35,8 @@ module.exports = class StrawpollCommand extends Command {
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.');
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.');
try {
const { body } = await request
.post('https://strawpoll.me/api/v2/polls')
+2 -2
View File
@@ -5,12 +5,12 @@ const request = require('superagent');
module.exports = class WouldYouRatherCommand extends Command {
constructor(client) {
super(client, {
name: 'wouldyourather',
name: 'would-you-rather',
aliases: [
'wyrather'
],
group: 'random',
memberName: 'wouldyourather',
memberName: 'would-you-rather',
description: 'Gets a random would you rather question.'
});
}
+1 -1
View File
@@ -4,7 +4,7 @@ const xiaos = require('./xiaos');
module.exports = class XiaoCommand extends Command {
constructor(client) {
super(client, {
name: 'xiaopai',
name: 'xiao-pai',
aliases: [
'xiao'
],
+2 -2
View File
@@ -5,9 +5,9 @@ const answers = require('./8ballanswers');
module.exports = class MagicBallCommand extends Command {
constructor(client) {
super(client, {
name: '8ball',
name: '8-ball',
group: 'response',
memberName: '8ball',
memberName: '8-ball',
description: 'Predicts your future.',
args: [
{
+1 -1
View File
@@ -6,7 +6,7 @@ module.exports = class CoinFlipCommand extends Command {
super(client, {
name: 'coin',
aliases: [
'coinflip',
'coin-flip',
'flip'
],
group: 'response',
+2 -2
View File
@@ -4,9 +4,9 @@ const facts = require('./facts');
module.exports = class FactCoreCommand extends Command {
constructor(client) {
super(client, {
name: 'factcore',
name: 'fact-core',
group: 'response',
memberName: 'factcore',
memberName: 'fact-core',
description: 'Says a random Fact Core quote.'
});
}
+2 -2
View File
@@ -4,12 +4,12 @@ const sides = ['on nothing', 'on NaN', 'on 0', 'in the air', 'on null'];
module.exports = class QuantumCoinCommand extends Command {
constructor(client) {
super(client, {
name: 'quantumcoin',
name: 'quantum-coin',
aliases: [
'qcoin'
],
group: 'response',
memberName: 'quantumcoin',
memberName: 'quantum-coin',
description: 'Flips a coin that lands on nothing.'
});
}
+2 -2
View File
@@ -3,12 +3,12 @@ const { Command } = require('discord.js-commando');
module.exports = class RateWaifuCommand extends Command {
constructor(client) {
super(client, {
name: 'ratewaifu',
name: 'rate-waifu',
aliases: [
'waifu'
],
group: 'response',
memberName: 'ratewaifu',
memberName: 'rate-waifu',
description: 'Rates your Waifu.',
args: [
{
+2 -2
View File
@@ -3,9 +3,9 @@ const { Command } = require('discord.js-commando');
module.exports = class FalconPunchCommand extends Command {
constructor(client) {
super(client, {
name: 'falconpunch',
name: 'falcon-punch',
group: 'roleplay',
memberName: 'falconpunch',
memberName: 'falcon-punch',
description: 'Falcon Punches something/someone.',
args: [
{
+2 -2
View File
@@ -3,9 +3,9 @@ const { Command } = require('discord.js-commando');
module.exports = class FistBumpCommand extends Command {
constructor(client) {
super(client, {
name: 'fistbump',
name: 'fist-bump',
group: 'roleplay',
memberName: 'fistbump',
memberName: 'fist-bump',
description: 'Fistbumps something/someone.',
args: [
{
+2 -2
View File
@@ -3,9 +3,9 @@ const { Command } = require('discord.js-commando');
module.exports = class HighFivesCommand extends Command {
constructor(client) {
super(client, {
name: 'highfive',
name: 'high-five',
group: 'roleplay',
memberName: 'highfive',
memberName: 'high-five',
description: 'High Fives something/someone.',
args: [
{
+2 -2
View File
@@ -3,9 +3,9 @@ const { Command } = require('discord.js-commando');
module.exports = class HitwithShovelCommand extends Command {
constructor(client) {
super(client, {
name: 'hitwithshovel',
name: 'hit-with-shovel',
group: 'roleplay',
memberName: 'hitwithsovel',
memberName: 'hit-with-shovel',
description: 'Hits something/someone with a shovel.',
args: [
{
+2 -2
View File
@@ -5,9 +5,9 @@ const request = require('superagent');
module.exports = class BotSearchCommand extends Command {
constructor(client) {
super(client, {
name: 'botinfo',
name: 'bot-info',
group: 'search',
memberName: 'botinfo',
memberName: 'bot-info',
description: 'Searches Discord Bots for info on a bot.',
args: [
{
+1 -1
View File
@@ -7,7 +7,7 @@ module.exports = class DiscrimCommand extends Command {
name: 'discrim',
aliases: [
'discriminator',
'searchdiscrim'
'search-discrim'
],
group: 'search',
memberName: 'discrim',
+2 -2
View File
@@ -5,9 +5,9 @@ const request = require('superagent');
module.exports = class YuGiOhCommand extends Command {
constructor(client) {
super(client, {
name: 'yugioh',
name: 'yu-gi-oh',
group: 'search',
memberName: 'yugioh',
memberName: 'yu-gi-oh',
description: 'Gets info on a Yu-Gi-Oh! Card.',
args: [
{
+2 -2
View File
@@ -4,9 +4,9 @@ const { stripIndent } = require('common-tags');
module.exports = class CowsayCommand extends Command {
constructor(client) {
super(client, {
name: 'cowsay',
name: 'cow-say',
group: 'textedit',
memberName: 'cowsay',
memberName: 'cow-say',
description: 'Converts text to cowsay.',
args: [
{
+2 -2
View File
@@ -5,12 +5,12 @@ const dictionary = require('./udmappings');
module.exports = class UpsideDownCommand extends Command {
constructor(client) {
super(client, {
name: 'upsidedown',
name: 'upside-down',
aliases: [
'udown'
],
group: 'textedit',
memberName: 'upsidedown',
memberName: 'upside-down',
description: 'Flips text upside-down.',
args: [
{
+1 -1
View File
@@ -7,7 +7,7 @@ module.exports = class WebhookCommand extends Command {
name: 'webhook',
aliases: [
'rin',
'rinsay'
'rin-say'
],
group: 'textedit',
memberName: 'webhook',
+2 -2
View File
@@ -9,9 +9,9 @@ module.exports = class UserInfoCommand extends Command {
super(client, {
name: 'user',
aliases: [
'userinfo',
'user-info',
'member',
'memberinfo'
'member-info'
],
group: 'userinfo',
memberName: 'user',
+2 -2
View File
@@ -3,9 +3,9 @@ const { Command } = require('discord.js-commando');
module.exports = class ClearSettingCommand extends Command {
constructor(client) {
super(client, {
name: 'clearsetting',
name: 'clear-setting',
group: 'util',
memberName: 'clearsetting',
memberName: 'clear-setting',
description: 'Removes a custom-set Mod Channel, Member Channel, Staff Role, or Single Role.',
guildOnly: true,
args: [
+2 -2
View File
@@ -3,9 +3,9 @@ const { Command } = require('discord.js-commando');
module.exports = class MemberLogCommand extends Command {
constructor(client) {
super(client, {
name: 'memberchannel',
name: 'member-channel',
group: 'util',
memberName: 'memberchannel',
memberName: 'member-channel',
description: 'Sets the channel for the member logs to be sent.',
guildOnly: true,
args: [
+2 -2
View File
@@ -3,9 +3,9 @@ const { Command } = require('discord.js-commando');
module.exports = class ModChannelCommand extends Command {
constructor(client) {
super(client, {
name: 'modchannel',
name: 'mod-channel',
group: 'util',
memberName: 'modchannel',
memberName: 'mod-channel',
description: 'Sets the channel for the mod logs to be sent.',
guildOnly: true,
args: [
+7 -5
View File
@@ -6,18 +6,22 @@ require('moment-duration-format');
module.exports = class ShardInfoCommand extends Command {
constructor(client) {
super(client, {
name: 'shardinfo',
name: 'shard-info',
aliases: [
'shard'
],
group: 'util',
memberName: 'shardinfo',
memberName: 'shard-info',
description: 'Gives some bot info for the Shard you specify.',
args: [
{
key: 'shard',
prompt: 'Which Shard would you like to get data for?',
type: 'integer'
type: 'integer',
validate: shard => {
if(shard < this.client.options.shardCount || shard > -1) return true;
return 'Invalid Shard ID';
}
}
]
});
@@ -28,8 +32,6 @@ module.exports = class ShardInfoCommand extends Command {
if(!msg.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
return msg.say('This Command requires the `Embed Links` Permission.');
const { shard } = args;
if(shard > this.client.options.shardCount - 1 || shard < 0)
return msg.say('The Shard ID is not valid.');
const memory = await this.client.shard.broadcastEval('Math.round(process.memoryUsage().heapUsed / 1024 / 1024)');
const uptime = await this.client.shard.fetchClientValues('uptime');
const guilds = await this.client.shard.fetchClientValues('guilds.size');
+2 -2
View File
@@ -3,9 +3,9 @@ const { Command } = require('discord.js-commando');
module.exports = class SingleRoleCommand extends Command {
constructor(client) {
super(client, {
name: 'singlerole',
name: 'single-role',
group: 'util',
memberName: 'singlerole',
memberName: 'single-role',
description: 'Sets a single role that is able to use commands.',
guildOnly: true,
args: [
+2 -2
View File
@@ -3,9 +3,9 @@ const { Command } = require('discord.js-commando');
module.exports = class StaffRoleCommand extends Command {
constructor(client) {
super(client, {
name: 'staffrole',
name: 'staff-role',
group: 'util',
memberName: 'staffrole',
memberName: 'staff-role',
description: 'Sets the role that can use Mod Commands without perms.',
guildOnly: true,
args: [
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiaobot",
"version": "18.4.0",
"version": "18.5.0",
"description": "A Discord Bot",
"main": "shardingmanager.js",
"scripts": {