mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-09 09:12:07 +02:00
DBL is total garbage
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user