Command.ChatInputCommandInteraction GuildMember.voice not updating

public async play(interaction : Command.ChatInputCommandInteraction)
{
const interactionGuildId = interaction.guildId;
const member = interaction.member as GuildMember;
if (interactionGuildId == null || member == null)
{
await interaction.reply("This command can only be used in a server");
return;
}

const voiceState = member.voice;
if (voiceState == null || voiceState.channel == null)
{
//I get this message even when in a voice channel
await interaction.reply("You must be in a voice channel to use this command");
return;
}
public async play(interaction : Command.ChatInputCommandInteraction)
{
const interactionGuildId = interaction.guildId;
const member = interaction.member as GuildMember;
if (interactionGuildId == null || member == null)
{
await interaction.reply("This command can only be used in a server");
return;
}

const voiceState = member.voice;
if (voiceState == null || voiceState.channel == null)
{
//I get this message even when in a voice channel
await interaction.reply("You must be in a voice channel to use this command");
return;
}
If before starting my bot I am in a voice channel, then it works as expected, but when I start the bot, and then join a voice channel, it doesn't work. interaction.member.voice.channel is null, as well as interaction.member.voice.channelId
1 Reply
Disuqi
Disuqi15mo ago
I forgot the intent for voice states...
Want results from more Discord servers?
Add your server