diff --git a/.env.example b/.env.example index 4f3523f1..093dfd30 100644 --- a/.env.example +++ b/.env.example @@ -10,7 +10,6 @@ POSTER_ID= POSTER_TOKEN= POSTER_TIME= REPORT_CHANNEL_ID= -BOT_LIST_GUILDS= # Emoji IDs GOLD_FISH_EMOJI_ID= @@ -52,7 +51,6 @@ SOUNDCLOUD_KEY= STACKOVERFLOW_KEY= TENOR_KEY= TMDB_KEY= -TOP_GG_TOKEN= TUMBLR_KEY= TWITTER_KEY= TWITTER_SECRET= diff --git a/Xiao.js b/Xiao.js index f384c9c0..fa21f88e 100644 --- a/Xiao.js +++ b/Xiao.js @@ -74,7 +74,6 @@ client.on('message', async msg => { client.on('guildMemberRemove', async member => { if (member.id === client.user.id) return null; - if (client.botListGuilds.includes(member.guild.id)) return null; const channel = member.guild.systemChannel; if (!channel || !channel.permissionsFor(client.user).has('SEND_MESSAGES')) return null; if (channel.topic && channel.topic.includes('')) return null; diff --git a/commands/other/cleverbot.js b/commands/other/cleverbot.js index c5394612..1108b68f 100644 --- a/commands/other/cleverbot.js +++ b/commands/other/cleverbot.js @@ -35,10 +35,7 @@ module.exports = class CleverbotCommand extends Command { } async run(msg, { text }, fromPattern) { - if (fromPattern) { - if (msg.guild && this.client.botListGuilds.includes(msg.guild.id)) return null; - text = msg.patternMatches[2]; - } + if (fromPattern) text = msg.patternMatches[2]; try { const convo = this.convos.get(msg.channel.id); const { body } = await request diff --git a/commands/readme/generate-commands.js b/commands/readme/generate-commands.js index 0a92ff5e..7ccd7949 100644 --- a/commands/readme/generate-commands.js +++ b/commands/readme/generate-commands.js @@ -10,22 +10,14 @@ module.exports = class GenerateCommandsCommand extends Command { description: 'Generates the commands list for Xiao\'s README.', details: 'Only the bot owner(s) may use this command.', ownerOnly: true, - guarded: true, - args: [ - { - key: 'botList', - prompt: 'Do you want to generate the bot list version of the command list?', - type: 'boolean', - default: false - } - ] + guarded: true }); } - run(msg, { botList }) { + run(msg) { const list = this.client.registry.groups .map(g => { - const commands = g.commands.filter(c => !c.hidden && (botList ? !c.ownerOnly && !c.nsfw : true)); + const commands = g.commands.filter(c => !c.hidden); return `\n### ${g.name}:\n\n${commands.map(c => { const extra = `${c.ownerOnly ? ' (Owner-Only)' : ''}${c.nsfw ? ' (NSFW)' : ''}`; return `* **${c.name}:** ${c.description}${extra}`; diff --git a/commands/util/help.js b/commands/util/help.js index 08f14645..3e07f188 100644 --- a/commands/util/help.js +++ b/commands/util/help.js @@ -34,10 +34,6 @@ module.exports = class HelpCommand extends Command { const commands = group.commands.filter(cmd => { if (owner) return true; if (cmd.ownerOnly || cmd.hidden) return false; - const inBotList = msg.guild && this.client.botListGuilds.includes(msg.guild.id); - if (inBotList && cmd instanceof AutoReplyCommand) { - return false; - } return true; }); if (!commands.size) continue; diff --git a/commands/util/unknown-command.js b/commands/util/unknown-command.js index 08cad8d8..7a6d8a69 100644 --- a/commands/util/unknown-command.js +++ b/commands/util/unknown-command.js @@ -17,7 +17,6 @@ module.exports = class UnknownCommandCommand extends Command { run(msg) { if (!msg.guild) return null; - if (msg.guild && this.client.botListGuilds.includes(msg.guild.id)) return null; const commands = this.makeCommandArray(this.client.isOwner(msg.author), msg.channel.nsfw); const command = msg.content.match(this.client.dispatcher._commandPatterns[this.client.commandPrefix]); const str = command ? command[2] : msg.content.split(' ')[0]; diff --git a/package.json b/package.json index 33411eb0..1431777d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "113.22.2", + "version": "113.22.3", "description": "Your personal server companion.", "main": "Xiao.js", "scripts": { @@ -38,7 +38,6 @@ "cloc": "^2.5.1", "common-tags": "^1.8.0", "custom-translate": "^2.2.8", - "dblapi.js": "^2.4.0", "didyoumean2": "^4.0.0", "discord.js": "^12.2.0", "discord.js-commando": "github:discordjs/Commando", diff --git a/structures/Client.js b/structures/Client.js index 562de675..27f10356 100644 --- a/structures/Client.js +++ b/structures/Client.js @@ -1,17 +1,15 @@ const { CommandoClient } = require('discord.js-commando'); const { WebhookClient } = require('discord.js'); -const DBL = require('dblapi.js'); const Collection = require('@discordjs/collection'); const winston = require('winston'); const PokemonStore = require('./pokemon/PokemonStore'); const MemePoster = require('./MemePoster'); -const { XIAO_WEBHOOK_ID, XIAO_WEBHOOK_TOKEN, BOT_LIST_GUILDS, TOP_GG_TOKEN } = process.env; +const { XIAO_WEBHOOK_ID, XIAO_WEBHOOK_TOKEN } = process.env; module.exports = class XiaoClient extends CommandoClient { constructor(options) { super(options); - this.botListGuilds = BOT_LIST_GUILDS ? BOT_LIST_GUILDS.split(',') : []; this.logger = winston.createLogger({ transports: [new winston.transports.Console()], format: winston.format.combine( @@ -22,7 +20,6 @@ module.exports = class XiaoClient extends CommandoClient { this.webhook = new WebhookClient(XIAO_WEBHOOK_ID, XIAO_WEBHOOK_TOKEN, { disableEveryone: true }); this.pokemon = new PokemonStore(); this.memePoster = new MemePoster(this); - this.dbl = TOP_GG_TOKEN ? new DBL(TOP_GG_TOKEN, this) : null; this.games = new Collection(); this.phone = new Collection(); } diff --git a/structures/commands/AutoReply.js b/structures/commands/AutoReply.js index 28b319e7..a2b03fe2 100644 --- a/structures/commands/AutoReply.js +++ b/structures/commands/AutoReply.js @@ -8,7 +8,6 @@ module.exports = class AutoReplyCommand extends Command { } run(msg, args, fromPattern) { - if (msg.guild && this.client.botListGuilds.includes(msg.guild.id) && fromPattern) return null; return this.reply ? msg.reply(this.generateText(fromPattern)) : msg.say(this.generateText(fromPattern)); } diff --git a/structures/commands/Subreddit.js b/structures/commands/Subreddit.js index 0d18a054..4b50e07c 100644 --- a/structures/commands/Subreddit.js +++ b/structures/commands/Subreddit.js @@ -17,10 +17,7 @@ module.exports = class SubredditCommand extends Command { } async run(msg, { subreddit }, fromPattern) { - if (fromPattern) { - if (msg.guild && this.client.botListGuilds.includes(msg.guild.id)) return null; - subreddit = msg.patternMatches[1]; - } + if (fromPattern) subreddit = msg.patternMatches[1]; if (!subreddit) subreddit = typeof this.subreddit === 'function' ? this.subreddit() : this.subreddit; try { const post = await this.random(subreddit, msg.channel.nsfw);