mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-16 00:12:32 +02:00
Fix
This commit is contained in:
+16
-2
@@ -1,6 +1,7 @@
|
|||||||
const snekfetch = require('snekfetch');
|
const snekfetch = require('snekfetch');
|
||||||
const { promisify } = require('util');
|
const { promisify } = require('util');
|
||||||
const { DBOTS_KEY, DBOTSORG_KEY } = process.env;
|
const { DBOTS_KEY, DBOTSORG_KEY } = process.env;
|
||||||
|
const { stripIndents } = require('common-tags');
|
||||||
|
|
||||||
class Util {
|
class Util {
|
||||||
static cleanXML(str) {
|
static cleanXML(str) {
|
||||||
@@ -33,8 +34,21 @@ class Util {
|
|||||||
|
|
||||||
static filterTopics(channels, setting) {
|
static filterTopics(channels, setting) {
|
||||||
return channels.filter(c => {
|
return channels.filter(c => {
|
||||||
if (c.type !== 'text' || !c.topic || !c.permissionsFor(c.client.user).has('SEND_MESSAGES')) return false;
|
try {
|
||||||
return c.topic.includes(`<${setting}>`);
|
if (c.type !== 'text' || !c.topic || !c.permissionsFor(c.client.user).has('SEND_MESSAGES')) return false;
|
||||||
|
return c.topic.includes(`<${setting}>`);
|
||||||
|
} catch (err) {
|
||||||
|
console.error(stripIndents`
|
||||||
|
Guild memberCount: ${c.guild.memberCount}
|
||||||
|
GuildMemberStore size: ${c.guild.members.size}
|
||||||
|
permissionsFor ClientUser: ${c.guild.permissionsFor(c.client.user)}
|
||||||
|
GuildMember for ClientUser: ${c.guild.me}
|
||||||
|
Guild available: ${c.guild.available}
|
||||||
|
Guild ID: ${c.guild.id}
|
||||||
|
Channel ID: ${c.id}
|
||||||
|
`);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user