added ~cp command that gets you in jail, and @NadekoBot cry
Also started youtube playlist queue
This commit is contained in:
		@@ -199,6 +199,16 @@ namespace NadekoBot.Modules {
 | 
				
			|||||||
                      await e.Send($"{e.Message.MentionedUsers.First().Mention} {pats[new Random().Next(0, pats.Length)]}");
 | 
					                      await e.Send($"{e.Message.MentionedUsers.First().Mention} {pats[new Random().Next(0, pats.Length)]}");
 | 
				
			||||||
                  });
 | 
					                  });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                cgb.CreateCommand("cry")
 | 
				
			||||||
 | 
					                  .Description("Tell Nadeko to cry. You are a heartless monster if you use this command.")
 | 
				
			||||||
 | 
					                  .Do(async e => {
 | 
				
			||||||
 | 
					                      string[] pats = new string[] { "http://i.imgur.com/Xg3i1Qy.gif",
 | 
				
			||||||
 | 
					                                                     "http://i.imgur.com/3K8DRrU.gif",
 | 
				
			||||||
 | 
					                                                     "http://i.imgur.com/k58BcAv.gif",
 | 
				
			||||||
 | 
					                                                     "http://i.imgur.com/I2fLXwo.gif" };
 | 
				
			||||||
 | 
					                      await e.Send($"(•̥́ _•ૅ。)\n{pats[new Random().Next(0, pats.Length)]}");
 | 
				
			||||||
 | 
					                  });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                cgb.CreateCommand("are you real")
 | 
					                cgb.CreateCommand("are you real")
 | 
				
			||||||
                    .Description("Useless.")
 | 
					                    .Description("Useless.")
 | 
				
			||||||
                    .Do(async e => {
 | 
					                    .Do(async e => {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -8,6 +8,7 @@ using System.Text.RegularExpressions;
 | 
				
			|||||||
using Newtonsoft.Json;
 | 
					using Newtonsoft.Json;
 | 
				
			||||||
using Discord.Commands;
 | 
					using Discord.Commands;
 | 
				
			||||||
using NadekoBot.Extensions;
 | 
					using NadekoBot.Extensions;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace NadekoBot.Modules {
 | 
					namespace NadekoBot.Modules {
 | 
				
			||||||
    class Searches : DiscordModule {
 | 
					    class Searches : DiscordModule {
 | 
				
			||||||
@@ -125,6 +126,12 @@ namespace NadekoBot.Modules {
 | 
				
			|||||||
                            tag = "";
 | 
					                            tag = "";
 | 
				
			||||||
                        await e.Send(GetGelbooruImageLink(tag));
 | 
					                        await e.Send(GetGelbooruImageLink(tag));
 | 
				
			||||||
                    });
 | 
					                    });
 | 
				
			||||||
 | 
					                cgb.CreateCommand("~cp")
 | 
				
			||||||
 | 
					                    .Description("We all know where this will lead you to.")
 | 
				
			||||||
 | 
					                    .Parameter("anything", ParameterType.Unparsed)
 | 
				
			||||||
 | 
					                    .Do(async e => {
 | 
				
			||||||
 | 
					                        await e.Send("http://i.imgur.com/MZkY1md.jpg");
 | 
				
			||||||
 | 
					                    });
 | 
				
			||||||
                cgb.CreateCommand("lmgtfy")
 | 
					                cgb.CreateCommand("lmgtfy")
 | 
				
			||||||
                    .Description("Google something for an idiot.")
 | 
					                    .Description("Google something for an idiot.")
 | 
				
			||||||
                    .Parameter("ffs", ParameterType.Unparsed)
 | 
					                    .Parameter("ffs", ParameterType.Unparsed)
 | 
				
			||||||
@@ -230,6 +237,47 @@ namespace NadekoBot.Modules {
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public static string GetPlaylistIdByKeyword(string v) {
 | 
				
			||||||
 | 
					            if (NadekoBot.GoogleAPIKey == "" || NadekoBot.GoogleAPIKey == null) {
 | 
				
			||||||
 | 
					                Console.WriteLine("ERROR: No google api key found. Playing `Never gonna give you up`.");
 | 
				
			||||||
 | 
					                return string.Empty;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            try {
 | 
				
			||||||
 | 
					                WebRequest wr = WebRequest.Create($"https://www.googleapis.com/youtube/v3/search?part=snippet&maxResults=1&q={Uri.EscapeDataString(v)}&type=playlist&key={NadekoBot.creds.GoogleAPIKey}");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                var sr = new StreamReader(wr.GetResponse().GetResponseStream());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                dynamic obj = JObject.Parse(sr.ReadToEnd());
 | 
				
			||||||
 | 
					                string toReturn = obj.items[0].id.playlistId.ToString();
 | 
				
			||||||
 | 
					                return toReturn;
 | 
				
			||||||
 | 
					            } catch (Exception ex) {
 | 
				
			||||||
 | 
					                Console.WriteLine($"Error in GetPlaylistId: {ex.Message}");
 | 
				
			||||||
 | 
					                return string.Empty;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public static List<string> GetVideoIDs(string v) {
 | 
				
			||||||
 | 
					            List<string> toReturn = new List<string>();
 | 
				
			||||||
 | 
					            if (NadekoBot.GoogleAPIKey == "" || NadekoBot.GoogleAPIKey == null) {
 | 
				
			||||||
 | 
					                Console.WriteLine("ERROR: No google api key found. Playing `Never gonna give you up`.");
 | 
				
			||||||
 | 
					                return toReturn;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            try {
 | 
				
			||||||
 | 
					                
 | 
				
			||||||
 | 
					                WebRequest wr = WebRequest.Create($"https://www.googleapis.com/youtube/v3/playlistItems?part=contentDetails&maxResults={25}&playlistId=PL8lZieNFgOdmrNGTqwjqYJpJ_2nw_O_M2&key={ NadekoBot.creds.GoogleAPIKey }");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                var sr = new StreamReader(wr.GetResponse().GetResponseStream());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                dynamic obj = JObject.Parse(sr.ReadToEnd());
 | 
				
			||||||
 | 
					                toReturn = "http://www.youtube.com/watch?v=" + obj.items[0].id.playlistId.ToString();
 | 
				
			||||||
 | 
					                return toReturn;
 | 
				
			||||||
 | 
					            } catch (Exception ex) {
 | 
				
			||||||
 | 
					                Console.WriteLine($"Error in GetPlaylistId: {ex.Message}");
 | 
				
			||||||
 | 
					                return new List<string>();
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public string GetDanbooruImageLink(string tag) {
 | 
					        public string GetDanbooruImageLink(string tag) {
 | 
				
			||||||
            try {
 | 
					            try {
 | 
				
			||||||
                var rng = new Random();
 | 
					                var rng = new Random();
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user