diff --git a/XiaoBot.js b/XiaoBot.js index e227bc8d..a8ffc197 100644 --- a/XiaoBot.js +++ b/XiaoBot.js @@ -97,4 +97,12 @@ client.on('guildDelete', async guild => { client.login(TOKEN); -process.on('unhandledRejection', console.error); +client.setTimeout(() => { + console.log(`[RESTART] Shard ${client.shard.id} restarted!`); + process.exit(0); +}, 8.64e+7); + +process.on('unhandledRejection', err => { + console.error('Unhandled Promise Rejection:', err); + process.exit(1); +}); diff --git a/package.json b/package.json index c0f719e1..07bd784d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiaobot", - "version": "37.4.1", + "version": "37.4.2", "description": "Your personal server companion.", "main": "Shard.js", "scripts": { diff --git a/structures/Util.js b/structures/Util.js index 63c3dba8..8c35e477 100644 --- a/structures/Util.js +++ b/structures/Util.js @@ -33,9 +33,8 @@ class Util { static filterTopics(channels, setting) { return channels.filter(c => { - if (c.type !== 'text' || !c.topic) return false; - if (c.topic.includes(`<${setting}>`)) return true; - return false; + if (c.type !== 'text' || !c.topic || !c.permissionsFor(c.client.user).has('SEND_MESSAGES')) return false; + return c.topic.includes(`<${setting}>`); }); }