H
H
Habr2021-07-24 21:14:52
Node.js
Habr, 2021-07-24 21:14:52

How to get the user who entered the voice channel first (Discord.JS)?

How can I get the user who entered the voice channel first?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2021-07-25
@RozmarinUS

client.on('voiceStateUpdate', (oldMember, newMember) => {
    let newUserChannel = newMember.channel,
        oldUserChannel = oldMember.channel;

    if (!oldUserChannel && newUserChannel) {
        if (newMember.channel.members.size === 1) {
            // пользователь первым зашел в голосовой канал
        }
    }
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question