public async Task StopRadio(params string[] _) { if (Context.Guild == null) { await ReplyAsync(Base.Sentences.CommandDontPm(Context.Guild)); return; } Utilities.CheckAvailability(Context.Guild, Program.Module.Radio); await p.DoAction(Context.User, Program.Module.Radio); RadioChannel radio = p.radios.Find(x => x.m_guildId == Context.Guild.Id); if (radio == null) { await ReplyAsync(Sentences.RadioNotStarted(Context.Guild)); } else { await radio.Stop(); p.radios.Remove(radio); await ReplyAsync(Base.Sentences.DoneStr(Context.Guild)); } }
// We remove the bot from empty voice channels private async Task VoiceUpdate(SocketUser user, SocketVoiceState state, SocketVoiceState _) { RadioChannel radio = radios.Find(x => x.m_guildId == ((IGuildUser)user).GuildId); if (radio != null && await radio.IsChanEmpty()) { await radio.Stop(); radios.Remove(radio); } }
public async Task stopRadio(params string[] words) { p.doAction(Context.User, Context.Guild.Id, Program.Module.Radio); RadioChannel radio = p.radios.Find(x => x.m_guildId == Context.Guild.Id); if (radio == null) { await ReplyAsync(Sentences.radioNotStarted(Context.Guild.Id)); } else { await radio.Stop(); p.radios.Remove(radio); await ReplyAsync(Sentences.doneStr(Context.Guild.Id)); } }