Пример #1
0
        public static void SearchYTForTrack(string cmd, string sender, MatrixRoom room)
        {
            string query = cmd.Replace("search ", "");

            if (string.IsNullOrWhiteSpace(query))
            {
                return;
            }
            try
            {
                string url = Downloaders.GetYoutubeURLFromSearch(query);
                if (url != null)
                {
                    DownloadTrack(url, sender, room);
                }
                else
                {
                    throw new Exception("No videos matching those terms were found");
                }
            }
            catch (Exception e) {
                room.SendNotice("There was an issue with that request, " + sender + ": " + e.Message);
                Console.Error.WriteLine(e);
            }
        }