Skip to content

Autojoin VC on Startup #544

Answered by Takiyo0
Apoo711 asked this question in Q&A
Jan 11, 2021 · 1 comments · 1 reply

You must be logged in to vote

If you want to join one VC, I think this should work.

let Channel = client.channels.cache.get('YOUR_CHANNEL_ID')

if(Channel) {
Channel.join()
}

in your client ready event.

or if you want to join more than 1 VC, you can try this.

let channel_list = ['CHANNEL_1', 'CHANNEL_2', 'CHANNEL_3'] // you can add more if you want
channel_list.forEach((id, index) => {
    let time = index++ + 1;

    setTimeout(() => { // i use timeout to prevent bot get rate limited by discord and join each VC per second
        let target = client.channels.cache.get(id)
        if (target) {
            target.join();
        }
    }, time * 1000)
})

I hope it's working because i never use it :D

Replies: 1 comment 1 reply

You must be logged in to vote
1 reply
@villagerrrrrrrrr

Answer selected by Apoo711
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants