Esempio n. 1
0
            public async Task <bool> RemoveSong(IMessageChannel chan, List <int> indexs)
            {
                int didRemove = 0;

                indexs = indexs.OrderByDescending(x => x).ToList();
                string songName = null;

                foreach (int i in indexs)
                {
                    if (i == 0)
                    {
                        songName = m_musics[0].title;
                        await Skip(null);

                        didRemove++;
                    }
                    if (i > 0 && i < m_musics.Count)
                    {
                        songName = m_musics[i].title;
                        m_musics.RemoveAt(i);
                        didRemove++;
                    }
                }
                if (didRemove == 1)
                {
                    await chan.SendMessageAsync(Sentences.SongSkipped((chan as ITextChannel).Guild, songName));
                }
                else if (didRemove > 1)
                {
                    await chan.SendMessageAsync(Sentences.SongsSkipped((chan as ITextChannel).Guild, didRemove));
                }
                return(didRemove > 0);
            }