bernardo
bernardo
DIAdiscord.js - Imagine an app
Created by bernardo on 9/27/2023 in #djs-questions
Can't find user's voice channel!
When using member.voice.channel it returns null and I can't understand why.
export async function execute(interaction: ChatInputCommandInteraction){

let member = await interaction.guild!.members.fetch(interaction.user.id);
let channel = member.voice.channel;
// null
export async function execute(interaction: ChatInputCommandInteraction){

let member = await interaction.guild!.members.fetch(interaction.user.id);
let channel = member.voice.channel;
// null
I have the GuildVoiceStates intent and I am on a voice channel when doing the command. discord.js version: 14.13.0 node version: 18.18.0
10 replies