DBL is total garbage

This commit is contained in:
Dragon Fire
2020-04-28 09:07:54 -04:00
parent b2f86615c8
commit 1817c6e990
10 changed files with 7 additions and 34 deletions
-2
View File
@@ -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=
-1
View File
@@ -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('<xiao:disable-leave>')) return null;
+1 -4
View File
@@ -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
+3 -11
View File
@@ -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}`;
-4
View File
@@ -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;
-1
View File
@@ -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];
+1 -2
View File
@@ -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",
+1 -4
View File
@@ -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();
}
-1
View File
@@ -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));
}
+1 -4
View File
@@ -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);