C
C#2y ago
bLanco

❔ Why it's not joining?

Settings on Discord Developer Portal is okay, but when i use !join command it's don't join to voice channel. Why?
[Command("join")]
public async Task Join(CommandContext ctx)
{
var user = ctx.Member;
var voiceChannel = user?.VoiceState?.Channel;

if (voiceChannel == null || voiceChannel.Type != ChannelType.Voice)
{
await ctx.RespondAsync("You must be in a voice channel to use this command.");

}
else
{
var voiceNext = ctx.Client.GetVoiceNext();
await voiceNext.ConnectAsync(voiceChannel);

await ctx.RespondAsync($"Connected to {voiceChannel.Name}");
}

}
[Command("join")]
public async Task Join(CommandContext ctx)
{
var user = ctx.Member;
var voiceChannel = user?.VoiceState?.Channel;

if (voiceChannel == null || voiceChannel.Type != ChannelType.Voice)
{
await ctx.RespondAsync("You must be in a voice channel to use this command.");

}
else
{
var voiceNext = ctx.Client.GetVoiceNext();
await voiceNext.ConnectAsync(voiceChannel);

await ctx.RespondAsync($"Connected to {voiceChannel.Name}");
}

}
5 Replies
bLanco
bLancoOP2y ago
Did i missed something in codes?
Thinker
Thinker2y ago
Have you tried using the debugger to check whether everything is working as you expect it to?
bLanco
bLancoOP2y ago
no i didn't, let me check! lol even i type !join nothing happens in VS2022
Thinker
Thinker2y ago
Have you checked that you have registered the appropriate intents? Also, #discord-dev would be a better place for this kind of question
Accord
Accord2y ago
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server