Пытался сделать так:
Код: Выделить всё
[SlashCommand("join", "Makes the bot join your vc")]
public async Task Join(InteractionContext ctx)
{
var channel = ctx.Member?.VoiceState?.Channel;
if (channel == null)
throw new Exception();
VoiceNextConnection connection = await channel.ConnectAsync(); // error here
var outputEmbed = new DiscordEmbedBuilder
{
Color = DiscordColor.Green,
Title = "Bot notification",
Description = $"Successfully joined to a channel",
};
var message = new DiscordMessageBuilder().AddEmbed(outputEmbed);
await ctx.Channel.SendMessageAsync(message);
}
Код: Выделить всё
VoiceNextConnection connection = await channel.ConnectAsync();
Подробнее здесь: https://stackoverflow.com/questions/790 ... in-channel