Exemplo n.º 1
0
        private async Task <bool> StartRadio(IMessageChannel chan)
        {
            if (p.radios.Any(x => x.m_guildId == Context.Guild.Id))
            {
                await chan.SendMessageAsync(Sentences.RadioAlreadyStarted(Context.Guild.Id));

                return(true);
            }
            IGuildUser guildUser = Context.User as IGuildUser;

            if (guildUser.VoiceChannel == null)
            {
                await chan.SendMessageAsync(Sentences.RadioNeedChannel(Context.Guild.Id));

                return(false);
            }
            IAudioClient audioClient = await guildUser.VoiceChannel.ConnectAsync();

            p.radios.Add(new RadioChannel(guildUser.VoiceChannel, Context.Channel, audioClient)); // You need opus.dll and libsodium.dll
            return(true);
        }