aboutsummaryrefslogtreecommitdiff
path: root/bot/src/events/ThreadListSync.js
blob: 00657e69e9a2ba4ea4b8ec63673dcc1e610ecb9b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
import { Events } from 'discord.js';

export default {
    name: Events.ThreadListSync,
    async execute(threads) {
        await threads.forEach(thread => {
            if (!thread.members.cache.has(threads.client.user.id)) {
                thread.join()
                    .catch(error => console.error(`[X] Failed to join thread ${thread.name}:`, error));
            }
        });
    }
};