Esempio n. 1
0
        public async Task LeaveChannel()
        {
            Bot          bot          = Program.GetBot(Context.Client);
            MusicService musicService = bot.GetMusicService(Context.Guild.Id);

            if (musicService != null)
            {
                await musicService.DisconnectFromVoice();

                bot.RemoveMusicService(Context.Guild.Id);
            }
        }
Esempio n. 2
0
        public async Task <MusicService> JoinChannel(IVoiceChannel audioChannel)
        {
            Bot          bot          = Program.GetBot(Context.Client);
            MusicService musicService = bot.GetMusicService(Context.Guild.Id);

            if (musicService == null)
            {
                musicService = new MusicService();
                bot.AddMusicService(Context.Guild.Id, musicService);
            }

            if (audioChannel != null)
            {
                if (musicService.AudioChannel != audioChannel)
                {
                    await musicService.ConnectToVoice(audioChannel);
                }
            }
            return(await Task.FromResult(musicService));
        }
Esempio n. 3
0
 public void AddMusicService(ulong GuildId, MusicService musicService)
 {
     _musicServices.Add(GuildId, musicService);
 }