예제 #1
0
        public static void Repeat(object s, MessageEventArgs e)
        {
            int Count = 1;

            if ((string)s != string.Empty)
            {
                int.TryParse((string)s, out Count);
            }

            if (Count > 0)
            {
                e.Music().Send(e.Channel, $"Repeated `{e.Music().Repeat(Count)}` {Count} times");
            }
        }
예제 #2
0
        public static void Volume(object s, MessageEventArgs e)
        {
            int Parse;

            if (int.TryParse((string)s, out Parse) && Parse >= 0 && Parse <= 15)
            {
                e.Music().Volume = (float)Parse / 10;
            }
        }
예제 #3
0
        public static void Push(object s, MessageEventArgs e)
        {
            var Split = ((string)s).Split(' ');

            int Place, ToPlace = 1;

            if (int.TryParse(Split[0], out Place))
            {
                if (Split.Length == 3)
                {
                    int.TryParse(Split[2], out ToPlace);
                }

                var Pushed = e.Music().Push(Place, ToPlace);
                if (Pushed != null)
                {
                    e.Music().Send(e.Channel, $"Pushed `{Pushed}` to #{ToPlace}");
                }
            }
        }
예제 #4
0
 public static void Join(object s, MessageEventArgs e)
 {
     if (e.User.VoiceChannel != null)
     {
         e.Music().VoiceChannel = e.User.VoiceChannel;
     }
     else
     {
         e.Respond("Please join a voice channel first");
     }
 }
예제 #5
0
        public static void Local(object s, MessageEventArgs e)
        {
            string Search = ((string)s).ToLower();

            if (Search != string.Empty)
            {
                var ToAdd = new List <string>();
                if (Files != null)
                {
                    if (Search == "all")
                    {
                        ToAdd = Files.ToList();
                    }
                    else
                    {
                        foreach (int Num in Search.ParseInts())
                        {
                            ToAdd.Add(Files[Num - 1]);
                        }
                    }

                    Files = null;
                }

                if (ToAdd.Count == 0)
                {
                    Files = Directory.GetFiles(SongData.MusicDir).Where(x => x.EndsWith(".mp3") && x.ToLower().Contains(Search)).ToArray();
                    if (Files.Length == 0)
                    {
                        e.Respond(Conversation.CantFind);
                    }
                    else if (Files.Length == 1)
                    {
                        e.Music().Send(e.Channel, e.Music().Enqueue(Files[0], true));
                        e.Music().OptionalConnectClient(e.User.VoiceChannel);
                    }
                    else
                    {
                        string Info = "";
                        for (int i = 0; i < Files.Length; i++)
                        {
                            Info += (i + 1) + ". `" + Files[i].Substring(SongData.MusicDir.Length) + "`\n";
                        }

                        e.Respond("Multiple files found\n" + Info);
                    }
                }
                else
                {
                    var Added = e.Music().LocalMultipleEnqueue(ToAdd);
                    if (Added.Count > 0)
                    {
                        e.Music().Send(e.Channel, $"Added {Added.Count} songs\n` {string.Join("`\n`", Added)}`");
                    }
                }

                e.Music().OptionalConnectClient(e.User.VoiceChannel);
            }
        }
예제 #6
0
 public static void Add(object s, MessageEventArgs e)
 {
     e.Music().Send(e.Channel, e.Music().Enqueue((string)s));
     e.Music().OptionalConnectClient(e.User.VoiceChannel);
 }
예제 #7
0
 public static void Adhd(object s, MessageEventArgs e)
 {
     e.Music().ToggleAdhd();
 }
예제 #8
0
 public static async void Leave(object s, MessageEventArgs e)
 {
     await e.Music().DisconnectClient();
 }
예제 #9
0
 public static void Load(object s, MessageEventArgs e)
 {
     e.Music().Load(e.Server, (string)s, e.Channel).Forget();
 }
예제 #10
0
 public static void Save(object s, MessageEventArgs e)
 {
     e.Respond($"Saved the playlist ({e.Music().Save(e.Server, (string)s)} songs). Use `#load` to load it again");
 }
예제 #11
0
 public static void Clear(object s, MessageEventArgs e)
 {
     e.Music().Send(e.Channel, e.Music().Clear());
 }
예제 #12
0
 public static void Shuffle(object s, MessageEventArgs e)
 {
     e.Music().Send(e.Channel, e.Music().Shuffle());
 }
예제 #13
0
 public static void Skip(object s, MessageEventArgs e)
 {
     e.Music().Skip();
 }
예제 #14
0
 public static void Playlist(object s, MessageEventArgs e)
 {
     e.Music().Send(e.Channel, e.Music().GetCurrentPlaylist());
 }
예제 #15
0
 public static void CurrentSong(object s, MessageEventArgs e)
 {
     e.Music().SendCurrentSong(e.Channel);
 }
예제 #16
0
 public static void Remove(object s, MessageEventArgs e)
 {
     e.Music().Send(e.Channel, "Removed: " + e.Music().Remove(s.ParseInts()).Join(", "));
 }