mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
rewrite voice state handling
This commit is contained in:
@@ -31,8 +31,8 @@ client.on('message', async message => {
|
||||
|
||||
if (message.content === '/join') {
|
||||
// Only try to join the sender's voice channel if they are in one themselves
|
||||
if (message.member.voiceChannel) {
|
||||
const connection = await message.member.voiceChannel.join();
|
||||
if (message.member.voice.channel) {
|
||||
const connection = await message.member.voice.channel.join();
|
||||
} else {
|
||||
message.reply('You need to join a voice channel first!');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user