C
C#15mo ago
zita epsilon

❔ 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
zita epsilon
zita epsilon15mo ago
Did i missed something in codes?
Thinker
Thinker15mo ago
Have you tried using the debugger to check whether everything is working as you expect it to?
zita epsilon
zita epsilon15mo ago
no i didn't, let me check! lol even i type !join nothing happens in VS2022
Thinker
Thinker15mo 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
Accord15mo 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
More Posts