diff options
Diffstat (limited to 'bot/src/events/ClientReady.js')
| -rw-r--r-- | bot/src/events/ClientReady.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/bot/src/events/ClientReady.js b/bot/src/events/ClientReady.js index 9669287..b97af1f 100644 --- a/bot/src/events/ClientReady.js +++ b/bot/src/events/ClientReady.js @@ -32,6 +32,24 @@ export default { await botActivity(client); await QuoteOfTheDay(client); + await client.guilds.cache.forEach(guild => { + let threadCount = 0; + + guild.channels.cache.forEach(channel => { + if (channel.threads) { + threadCount += channel.threads.cache.size; + channel.threads.cache.forEach(thread => { + if (!thread.members.cache.has(client.user.id)) { + thread.join() + .catch(error => console.error(`[X] Failed to join thread ${thread.name}:`, error)); + } + }); + } + }); + + console.log(`[>] Processed threads in guild: ${guild.name} | ${threadCount} Threads`); + }); + if (process.env.NODE_ENV !== 'development') { const readyEmbed = new EmbedBuilder() .setAuthor({name: 'AleeBot Status', iconURL: client.user.avatarURL()}) |
