From aef1d066658a9d72b8a9d4e3d2fff06a8eb8abca Mon Sep 17 00:00:00 2001 From: fkndean Date: Fri, 28 Oct 2016 04:04:15 -0400 Subject: [PATCH 1/9] Add Minecraft Searches --- src/NadekoBot/Modules/Searches/Searches.cs | 139 ++++++++++++++++++++- 1 file changed, 138 insertions(+), 1 deletion(-) diff --git a/src/NadekoBot/Modules/Searches/Searches.cs b/src/NadekoBot/Modules/Searches/Searches.cs index 9a370f80..bf8c5203 100644 --- a/src/NadekoBot/Modules/Searches/Searches.cs +++ b/src/NadekoBot/Modules/Searches/Searches.cs @@ -225,7 +225,7 @@ $@"🌍 **Weather for** 【{obj["target"]}】 throw new KeyNotFoundException("Cannot find a card by that name"); foreach (var item in items.Where(item => item.HasValues && item["img"] != null).Take(4)) { - using (var sr =await http.GetStreamAsync(item["img"].ToString())) + using (var sr = await http.GetStreamAsync(item["img"].ToString())) { var imgStream = new MemoryStream(); await sr.CopyToAsync(imgStream); @@ -464,6 +464,143 @@ $@"🌍 **Weather for** 【{obj["target"]}】 } } + [NadekoCommand, Usage, Description, Aliases] + [RequireContext(ContextType.Guild)] + public async Task MCPing(IUserMessage umsg, [Remainder] string query = null) + { + var channel = (ITextChannel)umsg.Channel; + var arg = query; + if (string.IsNullOrWhiteSpace(arg)) + { + await channel.SendMessageAsync("πŸ’’ Please enter a ip:port.").ConfigureAwait(false); + return; + } + await umsg.Channel.TriggerTypingAsync().ConfigureAwait(false); + using (var http = new HttpClient()) + { + http.DefaultRequestHeaders.Clear(); + string ip = arg.Split(':')[0]; + string port = arg.Split(':')[1]; + var res = await http.GetStringAsync($"https://api.minetools.eu/ping/{Uri.EscapeUriString(ip)}/{Uri.EscapeUriString(port)}").ConfigureAwait(false); + try + { + var items = JObject.Parse(res); + var sb = new System.Text.StringBuilder(); + int ping = (int)Math.Ceiling(Double.Parse(items["latency"].ToString())); + sb.AppendLine($"`Server:` {arg}"); + sb.AppendLine($"`Version:` {items["version"]["name"].ToString()} / Protocol {items["version"]["protocol"].ToString()}"); + sb.AppendLine($"`Description:` {items["description"].ToString()}"); + sb.AppendLine($"`Online Players:` {items["players"]["online"].ToString()}/{items["players"]["max"].ToString()}"); + sb.Append($"`Latency:` {ping}"); + await channel.SendMessageAsync(sb.ToString()); + } + catch + { + await channel.SendMessageAsync($"πŸ’’ [MINECRAFT] Failed finding {arg}.").ConfigureAwait(false); + } + } + } + + [NadekoCommand, Usage, Description, Aliases] + [RequireContext(ContextType.Guild)] + public async Task MCQuery(IUserMessage umsg, [Remainder] string query = null) + { + var channel = (ITextChannel)umsg.Channel; + var arg = query; + if (string.IsNullOrWhiteSpace(arg)) + { + await channel.SendMessageAsync("πŸ’’ Please enter a ip:port.").ConfigureAwait(false); + return; + } + await umsg.Channel.TriggerTypingAsync().ConfigureAwait(false); + using (var http = new HttpClient()) + { + http.DefaultRequestHeaders.Clear(); + try + { + string ip = arg.Split(':')[0]; + string port = arg.Split(':')[1]; + var res = await http.GetStringAsync($"https://api.minetools.eu/query/{Uri.EscapeUriString(ip)}/{Uri.EscapeUriString(port)}").ConfigureAwait(false); + var items = JObject.Parse(res); + var sb = new System.Text.StringBuilder(); + sb.AppendLine($"`Server:` {arg.ToString()} γ€˜Status: {items["status"]}γ€™"); + sb.AppendLine($"`Player List:`"); + for (int i=0;i < items["Playerlist"].Count();i++) + { + if (i == 5) + { + break; + } else + { + sb.AppendLine($"γ€”{i+1}. {items["Playerlist"][i]}〕"); + } + } + sb.AppendLine($"`Online Players:` {items["Players"]} / {items["MaxPlayers"]}"); + sb.AppendLine($"`Plugins:` {items["Plugins"]}"); + sb.Append($"`Version:` {items["Version"]}"); + await channel.SendMessageAsync(sb.ToString()); + } + catch + { + await channel.SendMessageAsync($"πŸ’’ [MINECRAFT] Failed finding server: `{arg}`.").ConfigureAwait(false); + } + } + } + + [NadekoCommand, Usage, Description, Aliases] + [RequireContext(ContextType.Guild)] + public async Task MCUser(IUserMessage umsg, [Remainder] string query = null) + { + var channel = (ITextChannel)umsg.Channel; + var arg = query; + if (string.IsNullOrWhiteSpace(arg)) + { + await channel.SendMessageAsync("πŸ’’ Please enter a name or uuid.").ConfigureAwait(false); + return; + } + await umsg.Channel.TriggerTypingAsync().ConfigureAwait(false); + using (var http = new HttpClient()) + { + http.DefaultRequestHeaders.Clear(); + var res = await http.GetStringAsync($"https://api.minetools.eu/uuid/{Uri.EscapeUriString(arg)}").ConfigureAwait(false); + try + { + var items = JObject.Parse(res); + var sb = new System.Text.StringBuilder(); + if (items["uuid"].ToString() == "null") + { + sb.Append($"πŸ’’ [MINECRAFT] Failed finding a name/uuid going by {Uri.EscapeUriString(arg)}, bugger off!"); + } + else + { + using (var httpkek = new HttpClient()) + { + httpkek.DefaultRequestHeaders.Clear(); + var uuid = items["uuid"].ToString(); + var reskek = await http.GetStringAsync($"https://api.minetools.eu/profile/{Uri.EscapeUriString(uuid)}").ConfigureAwait(false); + try + { + var itemskek = JObject.Parse(reskek); + sb.AppendLine($"`Profile ID:` {itemskek["decoded"]["profileId"].ToString()}"); + sb.AppendLine($"`Profile Name:` {itemskek["decoded"]["profileName"].ToString()}"); + sb.AppendLine($"`Textures (CAPE):` {await _google.ShortenUrl(itemskek["decoded"]["textures"]["CAPE"]["url"].ToString()).ConfigureAwait(false)}"); + sb.AppendLine($"`Textures (SKIN):` {await _google.ShortenUrl(itemskek["decoded"]["textures"]["SKIN"]["url"].ToString()).ConfigureAwait(false)}"); + sb.Append($"`Timestamp:` {Convert.ToDateTime(itemskek["decoded"]["timestamp"].ToString())}"); + } + catch + { + } + } + } + await channel.SendMessageAsync(sb.ToString()); + } + catch + { + await channel.SendMessageAsync("πŸ’’ [MINECRAFT] Failed finding user.").ConfigureAwait(false); + } + } + } + public static async Task ValidateQuery(ITextChannel ch, string query) { if (!string.IsNullOrEmpty(query.Trim())) return true; From dd3d70bd4517dc373f74cb2cd256250b06223954 Mon Sep 17 00:00:00 2001 From: fkndean Date: Fri, 28 Oct 2016 04:09:33 -0400 Subject: [PATCH 2/9] :boom: --- .../Resources/CommandStrings.Designer.cs | 278 ++++++------------ src/NadekoBot/Resources/CommandStrings.resx | 100 ++----- 2 files changed, 117 insertions(+), 261 deletions(-) diff --git a/src/NadekoBot/Resources/CommandStrings.Designer.cs b/src/NadekoBot/Resources/CommandStrings.Designer.cs index ef639f4c..dfe67852 100644 --- a/src/NadekoBot/Resources/CommandStrings.Designer.cs +++ b/src/NadekoBot/Resources/CommandStrings.Designer.cs @@ -519,61 +519,7 @@ namespace NadekoBot.Resources { } /// - /// Looks up a localized string similar to autotranslang atl. - /// - public static string autotranslang_cmd { - get { - return ResourceManager.GetString("autotranslang_cmd", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to `{0}atl en>fr`. - /// - public static string autotranslang_desc { - get { - return ResourceManager.GetString("autotranslang_desc", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Sets your source and target language to be used with `{0}at`. Specify no arguments to remove previously set value.. - /// - public static string autotranslang_usage { - get { - return ResourceManager.GetString("autotranslang_usage", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to autotrans at. - /// - public static string autotranslate_cmd { - get { - return ResourceManager.GetString("autotranslate_cmd", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Starts automatic translation of all messages by users who set their `{0}atl` in this channel. You can set "del" argument to automatically delete all translated user messages.. - /// - public static string autotranslate_desc { - get { - return ResourceManager.GetString("autotranslate_desc", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to `{0}at` or `{0}at del`. - /// - public static string autotranslate_usage { - get { - return ResourceManager.GetString("autotranslate_usage", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to avatar av. + /// Looks up a localized string similar to av avatar. /// public static string avatar_cmd { get { @@ -609,7 +555,7 @@ namespace NadekoBot.Resources { } /// - /// Looks up a localized string similar to Awards someone a certain amount of currency. You can also specify a role name to award currency to all users in a role.. + /// Looks up a localized string similar to Awards someone a certain amount of currency. . /// public static string award_desc { get { @@ -618,7 +564,7 @@ namespace NadekoBot.Resources { } /// - /// Looks up a localized string similar to `{0}award 100 @person` or `{0}award 5 Role Of Gamblers`. + /// Looks up a localized string similar to `{0}award 100 @person`. /// public static string award_usage { get { @@ -3407,33 +3353,6 @@ namespace NadekoBot.Resources { } } - /// - /// Looks up a localized string similar to listquotes liqu. - /// - public static string listquotes_cmd { - get { - return ResourceManager.GetString("listquotes_cmd", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to `{0}liqu` or `{0}liqu 3`. - /// - public static string listquotes_desc { - get { - return ResourceManager.GetString("listquotes_desc", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Lists all quotes on the server ordered alphabetically. 15 Per page.. - /// - public static string listquotes_usage { - get { - return ResourceManager.GetString("listquotes_usage", resourceCulture); - } - } - /// /// Looks up a localized string similar to liststreams ls. /// @@ -3839,6 +3758,87 @@ namespace NadekoBot.Resources { } } + /// + /// Looks up a localized string similar to minecraftping mcping. + /// + public static string mcping_cmd { + get { + return ResourceManager.GetString("mcping_cmd", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Pings a minecraft server.. + /// + public static string mcping_desc { + get { + return ResourceManager.GetString("mcping_desc", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to `{0}mcping 127.0.0.1:1337`. + /// + public static string mcping_usage { + get { + return ResourceManager.GetString("mcping_usage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to minecraftquery mcquery. + /// + public static string mcquery_cmd { + get { + return ResourceManager.GetString("mcquery_cmd", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Finds information about a minecraft server.. + /// + public static string mcquery_desc { + get { + return ResourceManager.GetString("mcquery_desc", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to `{0}mcquery server:ip`. + /// + public static string mcquery_usage { + get { + return ResourceManager.GetString("mcquery_usage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to minecraftuser mcuser. + /// + public static string mcuser_cmd { + get { + return ResourceManager.GetString("mcuser_cmd", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Finds information about a minecraft user.. + /// + public static string mcuser_desc { + get { + return ResourceManager.GetString("mcuser_desc", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to `{0}mcuser username or uuid`. + /// + public static string mcuser_usage { + get { + return ResourceManager.GetString("mcuser_usage", resourceCulture); + } + } + /// /// Looks up a localized string similar to memegen. /// @@ -4325,60 +4325,6 @@ namespace NadekoBot.Resources { } } - /// - /// Looks up a localized string similar to place. - /// - public static string place_cmd { - get { - return ResourceManager.GetString("place_cmd", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Shows a placeholder image of a given tag. Use `{0}placelist` to see all available tags. You can specify the width and height of the image as the last two optional arguments.. - /// - public static string place_desc { - get { - return ResourceManager.GetString("place_desc", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to `{0}place Cage` or `{0}place steven 500 400`. - /// - public static string place_usage { - get { - return ResourceManager.GetString("place_usage", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to placelist. - /// - public static string placelist_cmd { - get { - return ResourceManager.GetString("placelist_cmd", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Shows the list of available tags for the `{0}place` command.. - /// - public static string placelist_desc { - get { - return ResourceManager.GetString("placelist_desc", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to `{0}placelist`. - /// - public static string placelist_usage { - get { - return ResourceManager.GetString("placelist_usage", resourceCulture); - } - } - /// /// Looks up a localized string similar to plant. /// @@ -4524,7 +4470,7 @@ namespace NadekoBot.Resources { } /// - /// Looks up a localized string similar to Creates a poll which requires users to send the number of the voting option to the bot.. + /// Looks up a localized string similar to Creates a poll, only person who has manage server permission can do it.. /// public static string poll_desc { get { @@ -4595,33 +4541,6 @@ namespace NadekoBot.Resources { } } - /// - /// Looks up a localized string similar to publicpoll ppoll. - /// - public static string publicpoll_cmd { - get { - return ResourceManager.GetString("publicpoll_cmd", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Creates a public poll which requires users to type a number of the voting option in the channel command is ran in.. - /// - public static string publicpoll_desc { - get { - return ResourceManager.GetString("publicpoll_desc", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to `{0}ppoll Question?;Answer1;Answ 2;A_3`. - /// - public static string publicpoll_usage { - get { - return ResourceManager.GetString("publicpoll_usage", resourceCulture); - } - } - /// /// Looks up a localized string similar to queue q yq. /// @@ -6512,33 +6431,6 @@ namespace NadekoBot.Resources { } } - /// - /// Looks up a localized string similar to togethertube totube. - /// - public static string togethertube_cmd { - get { - return ResourceManager.GetString("togethertube_cmd", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Creates a new room on <https://togethertube.com> and shows the link in the chat.. - /// - public static string togethertube_desc { - get { - return ResourceManager.GetString("togethertube_desc", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to `{0}totube`. - /// - public static string togethertube_usage { - get { - return ResourceManager.GetString("togethertube_usage", resourceCulture); - } - } - /// /// Looks up a localized string similar to tq. /// diff --git a/src/NadekoBot/Resources/CommandStrings.resx b/src/NadekoBot/Resources/CommandStrings.resx index 23fdb67f..799ce4dc 100644 --- a/src/NadekoBot/Resources/CommandStrings.resx +++ b/src/NadekoBot/Resources/CommandStrings.resx @@ -1246,10 +1246,10 @@ award - Awards someone a certain amount of currency. You can also specify a role name to award currency to all users in a role. + Awards someone a certain amount of currency. - `{0}award 100 @person` or `{0}award 5 Role Of Gamblers` + `{0}award 100 @person` take @@ -1336,7 +1336,7 @@ poll - Creates a poll which requires users to send the number of the voting option to the bot. + Creates a poll, only person who has manage server permission can do it. `{0}poll Question?;Answer1;Answ 2;A_3` @@ -1971,6 +1971,33 @@ `{0}hs Ysera` + + minecraftping mcping + + + Pings a minecraft server. + + + `{0}mcping 127.0.0.1:1337` + + + minecraftuser mcuser + + + Finds information about a minecraft user. + + + `{0}mcuser username or uuid` + + + minecraftquery mcquery + + + Finds information about a minecraft server. + + + `{0}mcquery server:ip` + urbandict ud @@ -2089,7 +2116,7 @@ `{0}videocall "@SomeGuy"` - avatar av + av avatar Shows a mentioned person's avatar. @@ -2511,67 +2538,4 @@ `{0}xkcd` or `{0}xkcd 1400` or `{0}xkcd latest` - - placelist - - - Shows the list of available tags for the `{0}place` command. - - - `{0}placelist` - - - place - - - Shows a placeholder image of a given tag. Use `{0}placelist` to see all available tags. You can specify the width and height of the image as the last two optional arguments. - - - `{0}place Cage` or `{0}place steven 500 400` - - - togethertube totube - - - Creates a new room on <https://togethertube.com> and shows the link in the chat. - - - `{0}totube` - - - publicpoll ppoll - - - Creates a public poll which requires users to type a number of the voting option in the channel command is ran in. - - - `{0}ppoll Question?;Answer1;Answ 2;A_3` - - - autotranslang atl - - - `{0}atl en>fr` - - - Sets your source and target language to be used with `{0}at`. Specify no arguments to remove previously set value. - - - autotrans at - - - Starts automatic translation of all messages by users who set their `{0}atl` in this channel. You can set "del" argument to automatically delete all translated user messages. - - - `{0}at` or `{0}at del` - - - listquotes liqu - - - `{0}liqu` or `{0}liqu 3` - - - Lists all quotes on the server ordered alphabetically. 15 Per page. - - \ No newline at end of file + From b7b8dfdf05cf542936daaba1177529a7e729f005 Mon Sep 17 00:00:00 2001 From: fkndean Date: Fri, 28 Oct 2016 04:12:52 -0400 Subject: [PATCH 3/9] :camel: --- .../Resources/CommandStrings.Designer.cs | 360 +++++++++++++----- src/NadekoBot/Resources/CommandStrings.resx | 127 ++++-- 2 files changed, 369 insertions(+), 118 deletions(-) diff --git a/src/NadekoBot/Resources/CommandStrings.Designer.cs b/src/NadekoBot/Resources/CommandStrings.Designer.cs index dfe67852..a41c6a07 100644 --- a/src/NadekoBot/Resources/CommandStrings.Designer.cs +++ b/src/NadekoBot/Resources/CommandStrings.Designer.cs @@ -519,7 +519,61 @@ namespace NadekoBot.Resources { } /// - /// Looks up a localized string similar to av avatar. + /// Looks up a localized string similar to autotranslang atl. + /// + public static string autotranslang_cmd { + get { + return ResourceManager.GetString("autotranslang_cmd", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to `{0}atl en>fr`. + /// + public static string autotranslang_desc { + get { + return ResourceManager.GetString("autotranslang_desc", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Sets your source and target language to be used with `{0}at`. Specify no arguments to remove previously set value.. + /// + public static string autotranslang_usage { + get { + return ResourceManager.GetString("autotranslang_usage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to autotrans at. + /// + public static string autotranslate_cmd { + get { + return ResourceManager.GetString("autotranslate_cmd", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Starts automatic translation of all messages by users who set their `{0}atl` in this channel. You can set "del" argument to automatically delete all translated user messages.. + /// + public static string autotranslate_desc { + get { + return ResourceManager.GetString("autotranslate_desc", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to `{0}at` or `{0}at del`. + /// + public static string autotranslate_usage { + get { + return ResourceManager.GetString("autotranslate_usage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to avatar av. /// public static string avatar_cmd { get { @@ -555,7 +609,7 @@ namespace NadekoBot.Resources { } /// - /// Looks up a localized string similar to Awards someone a certain amount of currency. . + /// Looks up a localized string similar to Awards someone a certain amount of currency. You can also specify a role name to award currency to all users in a role.. /// public static string award_desc { get { @@ -564,7 +618,7 @@ namespace NadekoBot.Resources { } /// - /// Looks up a localized string similar to `{0}award 100 @person`. + /// Looks up a localized string similar to `{0}award 100 @person` or `{0}award 5 Role Of Gamblers`. /// public static string award_usage { get { @@ -3353,6 +3407,33 @@ namespace NadekoBot.Resources { } } + /// + /// Looks up a localized string similar to listquotes liqu. + /// + public static string listquotes_cmd { + get { + return ResourceManager.GetString("listquotes_cmd", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to `{0}liqu` or `{0}liqu 3`. + /// + public static string listquotes_desc { + get { + return ResourceManager.GetString("listquotes_desc", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Lists all quotes on the server ordered alphabetically. 15 Per page.. + /// + public static string listquotes_usage { + get { + return ResourceManager.GetString("listquotes_usage", resourceCulture); + } + } + /// /// Looks up a localized string similar to liststreams ls. /// @@ -3758,87 +3839,6 @@ namespace NadekoBot.Resources { } } - /// - /// Looks up a localized string similar to minecraftping mcping. - /// - public static string mcping_cmd { - get { - return ResourceManager.GetString("mcping_cmd", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Pings a minecraft server.. - /// - public static string mcping_desc { - get { - return ResourceManager.GetString("mcping_desc", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to `{0}mcping 127.0.0.1:1337`. - /// - public static string mcping_usage { - get { - return ResourceManager.GetString("mcping_usage", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to minecraftquery mcquery. - /// - public static string mcquery_cmd { - get { - return ResourceManager.GetString("mcquery_cmd", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Finds information about a minecraft server.. - /// - public static string mcquery_desc { - get { - return ResourceManager.GetString("mcquery_desc", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to `{0}mcquery server:ip`. - /// - public static string mcquery_usage { - get { - return ResourceManager.GetString("mcquery_usage", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to minecraftuser mcuser. - /// - public static string mcuser_cmd { - get { - return ResourceManager.GetString("mcuser_cmd", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Finds information about a minecraft user.. - /// - public static string mcuser_desc { - get { - return ResourceManager.GetString("mcuser_desc", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to `{0}mcuser username or uuid`. - /// - public static string mcuser_usage { - get { - return ResourceManager.GetString("mcuser_usage", resourceCulture); - } - } - /// /// Looks up a localized string similar to memegen. /// @@ -4325,6 +4325,60 @@ namespace NadekoBot.Resources { } } + /// + /// Looks up a localized string similar to place. + /// + public static string place_cmd { + get { + return ResourceManager.GetString("place_cmd", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Shows a placeholder image of a given tag. Use `{0}placelist` to see all available tags. You can specify the width and height of the image as the last two optional arguments.. + /// + public static string place_desc { + get { + return ResourceManager.GetString("place_desc", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to `{0}place Cage` or `{0}place steven 500 400`. + /// + public static string place_usage { + get { + return ResourceManager.GetString("place_usage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to placelist. + /// + public static string placelist_cmd { + get { + return ResourceManager.GetString("placelist_cmd", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Shows the list of available tags for the `{0}place` command.. + /// + public static string placelist_desc { + get { + return ResourceManager.GetString("placelist_desc", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to `{0}placelist`. + /// + public static string placelist_usage { + get { + return ResourceManager.GetString("placelist_usage", resourceCulture); + } + } + /// /// Looks up a localized string similar to plant. /// @@ -4470,7 +4524,7 @@ namespace NadekoBot.Resources { } /// - /// Looks up a localized string similar to Creates a poll, only person who has manage server permission can do it.. + /// Looks up a localized string similar to Creates a poll which requires users to send the number of the voting option to the bot.. /// public static string poll_desc { get { @@ -4541,6 +4595,33 @@ namespace NadekoBot.Resources { } } + /// + /// Looks up a localized string similar to publicpoll ppoll. + /// + public static string publicpoll_cmd { + get { + return ResourceManager.GetString("publicpoll_cmd", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Creates a public poll which requires users to type a number of the voting option in the channel command is ran in.. + /// + public static string publicpoll_desc { + get { + return ResourceManager.GetString("publicpoll_desc", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to `{0}ppoll Question?;Answer1;Answ 2;A_3`. + /// + public static string publicpoll_usage { + get { + return ResourceManager.GetString("publicpoll_usage", resourceCulture); + } + } + /// /// Looks up a localized string similar to queue q yq. /// @@ -6431,6 +6512,33 @@ namespace NadekoBot.Resources { } } + /// + /// Looks up a localized string similar to togethertube totube. + /// + public static string togethertube_cmd { + get { + return ResourceManager.GetString("togethertube_cmd", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Creates a new room on <https://togethertube.com> and shows the link in the chat.. + /// + public static string togethertube_desc { + get { + return ResourceManager.GetString("togethertube_desc", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to `{0}totube`. + /// + public static string togethertube_usage { + get { + return ResourceManager.GetString("togethertube_usage", resourceCulture); + } + } + /// /// Looks up a localized string similar to tq. /// @@ -7321,5 +7429,85 @@ namespace NadekoBot.Resources { return ResourceManager.GetString("youtube_usage", resourceCulture); } } + /// + /// Looks up a localized string similar to minecraftping mcping. + /// + public static string mcping_cmd { + get { + return ResourceManager.GetString("mcping_cmd", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Pings a minecraft server.. + /// + public static string mcping_desc { + get { + return ResourceManager.GetString("mcping_desc", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to `{0}mcping 127.0.0.1:1337`. + /// + public static string mcping_usage { + get { + return ResourceManager.GetString("mcping_usage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to minecraftquery mcquery. + /// + public static string mcquery_cmd { + get { + return ResourceManager.GetString("mcquery_cmd", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Finds information about a minecraft server.. + /// + public static string mcquery_desc { + get { + return ResourceManager.GetString("mcquery_desc", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to `{0}mcquery server:ip`. + /// + public static string mcquery_usage { + get { + return ResourceManager.GetString("mcquery_usage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to minecraftuser mcuser. + /// + public static string mcuser_cmd { + get { + return ResourceManager.GetString("mcuser_cmd", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Finds information about a minecraft user.. + /// + public static string mcuser_desc { + get { + return ResourceManager.GetString("mcuser_desc", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to `{0}mcuser username or uuid`. + /// + public static string mcuser_usage { + get { + return ResourceManager.GetString("mcuser_usage", resourceCulture); + } + } } -} +} \ No newline at end of file diff --git a/src/NadekoBot/Resources/CommandStrings.resx b/src/NadekoBot/Resources/CommandStrings.resx index 799ce4dc..a89a5669 100644 --- a/src/NadekoBot/Resources/CommandStrings.resx +++ b/src/NadekoBot/Resources/CommandStrings.resx @@ -1246,10 +1246,10 @@ award - Awards someone a certain amount of currency. + Awards someone a certain amount of currency. You can also specify a role name to award currency to all users in a role. - `{0}award 100 @person` + `{0}award 100 @person` or `{0}award 5 Role Of Gamblers` take @@ -1336,7 +1336,7 @@ poll - Creates a poll, only person who has manage server permission can do it. + Creates a poll which requires users to send the number of the voting option to the bot. `{0}poll Question?;Answer1;Answ 2;A_3` @@ -1971,33 +1971,6 @@ `{0}hs Ysera` - - minecraftping mcping - - - Pings a minecraft server. - - - `{0}mcping 127.0.0.1:1337` - - - minecraftuser mcuser - - - Finds information about a minecraft user. - - - `{0}mcuser username or uuid` - - - minecraftquery mcquery - - - Finds information about a minecraft server. - - - `{0}mcquery server:ip` - urbandict ud @@ -2116,7 +2089,7 @@ `{0}videocall "@SomeGuy"` - av avatar + avatar av Shows a mentioned person's avatar. @@ -2538,4 +2511,94 @@ `{0}xkcd` or `{0}xkcd 1400` or `{0}xkcd latest` - + + placelist + + + Shows the list of available tags for the `{0}place` command. + + + `{0}placelist` + + + place + + + Shows a placeholder image of a given tag. Use `{0}placelist` to see all available tags. You can specify the width and height of the image as the last two optional arguments. + + + `{0}place Cage` or `{0}place steven 500 400` + + + togethertube totube + + + Creates a new room on <https://togethertube.com> and shows the link in the chat. + + + `{0}totube` + + + publicpoll ppoll + + + Creates a public poll which requires users to type a number of the voting option in the channel command is ran in. + + + `{0}ppoll Question?;Answer1;Answ 2;A_3` + + + autotranslang atl + + + `{0}atl en>fr` + + + Sets your source and target language to be used with `{0}at`. Specify no arguments to remove previously set value. + + + autotrans at + + + Starts automatic translation of all messages by users who set their `{0}atl` in this channel. You can set "del" argument to automatically delete all translated user messages. + + + `{0}at` or `{0}at del` + + + listquotes liqu + + + `{0}liqu` or `{0}liqu 3` + + + Lists all quotes on the server ordered alphabetically. 15 Per page. + + + minecraftping mcping + + + Pings a minecraft server. + + + `{0}mcping 127.0.0.1:1337` + + + minecraftuser mcuser + + + Finds information about a minecraft user. + + + `{0}mcuser username or uuid` + + + minecraftquery mcquery + + + Finds information about a minecraft server. + + + `{0}mcquery server:ip` + + \ No newline at end of file From 807fe78ea285b4fb66d3326a0932ab0cc430e9b6 Mon Sep 17 00:00:00 2001 From: Kwoth Date: Fri, 28 Oct 2016 12:32:29 +0200 Subject: [PATCH 4/9] commandlist fix --- docs/Commands List.md | 21 ++++++++++++--------- src/NadekoBot/Modules/Help/Help.cs | 4 ++-- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/docs/Commands List.md b/docs/Commands List.md index 2ed4d12d..003da472 100644 --- a/docs/Commands List.md +++ b/docs/Commands List.md @@ -1,17 +1,17 @@ -######For more information and how to setup your own NadekoBot, go to: -######You can support the project on patreon: or paypal: `nadekodiscordbot@gmail.com` +For more information and how to setup your own NadekoBot, go to: +You can support the project on patreon: or paypal: `nadekodiscordbot@gmail.com` ##Table Of Contents -- [CustomReactions](#customreactions) -- [ClashOfClans](#clashofclans) - [Searches](#searches) -- [Utility](#utility) -- [Permissions](#permissions) -- [Help](#help) -- [Administration](#administration) -- [NSFW](#nsfw) - [Games](#games) +- [Permissions](#permissions) +- [Utility](#utility) - [Gambling](#gambling) +- [CustomReactions](#customreactions) - [Music](#music) +- [ClashOfClans](#clashofclans) +- [NSFW](#nsfw) +- [Administration](#administration) +- [Help](#help) ### Administration @@ -285,6 +285,9 @@ Command and aliases | Description | Usage `~color` `~clr` | Shows you what color corresponds to that hex. | `~clr 00ff00` `~videocall` | Creates a private video call link for you and other mentioned people. The link is sent to mentioned people via a private message. | `~videocall "@SomeGuy"` `~avatar` `~av` | Shows a mentioned person's avatar. | `~av "@SomeGuy"` +`~minecraftping` `~mcping` | Pings a minecraft server. | `~mcping 127.0.0.1:1337` +`~minecraftquery` `~mcquery` | Finds information about a minecraft server. | `~mcquery server:ip` +`~minecraftuser` `~mcuser` | Finds information about a minecraft user. | `~mcuser username or uuid` `~lolban` | Shows top banned champions ordered by ban rate. | `~lolban` `~memelist` | Pulls a list of memes you can use with `~memegen` from http://memegen.link/templates/ | `~memelist` `~memegen` | Generates a meme from memelist with top and bottom text. | `~memegen biw "gets iced coffee" "in the winter"` diff --git a/src/NadekoBot/Modules/Help/Help.cs b/src/NadekoBot/Modules/Help/Help.cs index a25ed111..a11e1d60 100644 --- a/src/NadekoBot/Modules/Help/Help.cs +++ b/src/NadekoBot/Modules/Help/Help.cs @@ -125,8 +125,8 @@ namespace NadekoBot.Modules.Help public Task Hgit(IUserMessage umsg) { var helpstr = new StringBuilder(); - helpstr.AppendLine(@"######For more information and how to setup your own NadekoBot, go to: -######You can support the project on patreon: or paypal: `nadekodiscordbot@gmail.com`"); + helpstr.AppendLine(@"For more information and how to setup your own NadekoBot, go to: +You can support the project on patreon: or paypal: `nadekodiscordbot@gmail.com`"); helpstr.AppendLine("##Table Of Contents"); helpstr.AppendLine(string.Join("\n", NadekoBot.CommandService.Modules.Select(m => $"- [{m.Name}](#{m.Name.ToLowerInvariant()})"))); helpstr.AppendLine(); From 3611817e220d04b5492879e6f87f4003f169d5a1 Mon Sep 17 00:00:00 2001 From: fkndean Date: Sun, 6 Nov 2016 16:04:24 -0500 Subject: [PATCH 5/9] Add Minecraft Commands --- src/NadekoBot/Modules/Searches/Searches.cs | 89 ++++++++++++++++++- .../Resources/CommandStrings.Designer.cs | 54 +++++++++++ src/NadekoBot/Resources/CommandStrings.resx | 18 ++++ 3 files changed, 159 insertions(+), 2 deletions(-) diff --git a/src/NadekoBot/Modules/Searches/Searches.cs b/src/NadekoBot/Modules/Searches/Searches.cs index 9a370f80..5d700d6c 100644 --- a/src/NadekoBot/Modules/Searches/Searches.cs +++ b/src/NadekoBot/Modules/Searches/Searches.cs @@ -4,6 +4,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System; using System.Linq; +using System.Text; using System.Net.Http; using NadekoBot.Services; using System.Threading.Tasks; @@ -225,7 +226,7 @@ $@"🌍 **Weather for** 【{obj["target"]}】 throw new KeyNotFoundException("Cannot find a card by that name"); foreach (var item in items.Where(item => item.HasValues && item["img"] != null).Take(4)) { - using (var sr =await http.GetStreamAsync(item["img"].ToString())) + using (var sr = await http.GetStreamAsync(item["img"].ToString())) { var imgStream = new MemoryStream(); await sr.CopyToAsync(imgStream); @@ -271,7 +272,7 @@ $@"🌍 **Weather for** 【{obj["target"]}】 try { var items = JObject.Parse(res); - var sb = new System.Text.StringBuilder(); + var sb = new StringBuilder(); sb.AppendLine($"`Term:` {items["list"][0]["word"].ToString()}"); sb.AppendLine($"`Definition:` {items["list"][0]["definition"].ToString()}"); sb.Append($"`Link:` <{await _google.ShortenUrl(items["list"][0]["permalink"].ToString()).ConfigureAwait(false)}>"); @@ -464,6 +465,90 @@ $@"🌍 **Weather for** 【{obj["target"]}】 } } + [NadekoCommand, Usage, Description, Aliases] + [RequireContext(ContextType.Guild)] + public async Task MCPing(IUserMessage umsg, [Remainder] string query = null) + { + var channel = (ITextChannel)umsg.Channel; + var arg = query; + if (string.IsNullOrWhiteSpace(arg)) + { + await channel.SendMessageAsync("πŸ’’ Please enter a `ip:port`.").ConfigureAwait(false); + return; + } + await umsg.Channel.TriggerTypingAsync().ConfigureAwait(false); + using (var http = new HttpClient()) + { + http.DefaultRequestHeaders.Clear(); + string ip = arg.Split(':')[0]; + string port = arg.Split(':')[1]; + var res = await http.GetStringAsync($"https://api.minetools.eu/ping/{Uri.EscapeUriString(ip)}/{Uri.EscapeUriString(port)}").ConfigureAwait(false); + try + { + var items = JObject.Parse(res); + var sb = new StringBuilder(); + int ping = (int)Math.Ceiling(Double.Parse(items["latency"].ToString())); + sb.AppendLine($"`Server:` {arg}"); + sb.AppendLine($"`Version:` {items["version"]["name"].ToString()} / Protocol {items["version"]["protocol"].ToString()}"); + sb.AppendLine($"`Description:` {items["description"].ToString()}"); + sb.AppendLine($"`Online Players:` {items["players"]["online"].ToString()}/{items["players"]["max"].ToString()}"); + sb.Append($"`Latency:` {ping}"); + await channel.SendMessageAsync(sb.ToString()); + } + catch + { + await channel.SendMessageAsync($"πŸ’’ Failed finding `{arg}`.").ConfigureAwait(false); + } + } + } + + [NadekoCommand, Usage, Description, Aliases] + [RequireContext(ContextType.Guild)] + public async Task MCQ(IUserMessage umsg, [Remainder] string query = null) + { + var channel = (ITextChannel)umsg.Channel; + var arg = query; + if (string.IsNullOrWhiteSpace(arg)) + { + await channel.SendMessageAsync("πŸ’’ Please enter a `ip:port`.").ConfigureAwait(false); + return; + } + await umsg.Channel.TriggerTypingAsync().ConfigureAwait(false); + using (var http = new HttpClient()) + { + http.DefaultRequestHeaders.Clear(); + try + { + string ip = arg.Split(':')[0]; + string port = arg.Split(':')[1]; + var res = await http.GetStringAsync($"https://api.minetools.eu/query/{Uri.EscapeUriString(ip)}/{Uri.EscapeUriString(port)}").ConfigureAwait(false); + var items = JObject.Parse(res); + var sb = new StringBuilder(); + sb.AppendLine($"`Server:` {arg.ToString()} γ€˜Status: {items["status"]}γ€™"); + sb.AppendLine($"`Player List:`"); + for (int i = 0; i < items["Playerlist"].Count(); i++) + { + if (i == 5) + { + break; + } + else + { + sb.AppendLine($"γ€”{i + 1}. {items["Playerlist"][i]}〕"); + } + } + sb.AppendLine($"`Online Players:` {items["Players"]} / {items["MaxPlayers"]}"); + sb.AppendLine($"`Plugins:` {items["Plugins"]}"); + sb.Append($"`Version:` {items["Version"]}"); + await channel.SendMessageAsync(sb.ToString()); + } + catch + { + await channel.SendMessageAsync($"πŸ’’ Failed finding server `{arg}`.").ConfigureAwait(false); + } + } + } + public static async Task ValidateQuery(ITextChannel ch, string query) { if (!string.IsNullOrEmpty(query.Trim())) return true; diff --git a/src/NadekoBot/Resources/CommandStrings.Designer.cs b/src/NadekoBot/Resources/CommandStrings.Designer.cs index b34b06f9..70df73b6 100644 --- a/src/NadekoBot/Resources/CommandStrings.Designer.cs +++ b/src/NadekoBot/Resources/CommandStrings.Designer.cs @@ -3937,6 +3937,60 @@ namespace NadekoBot.Resources { return ResourceManager.GetString("memegen_desc", resourceCulture); } } + + /// + /// Looks up a localized string similar to minecraftping mcping. + /// + public static string mcping_cmd { + get { + return ResourceManager.GetString("mcping_cmd", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Pings a minecraft server.. + /// + public static string mcping_desc { + get { + return ResourceManager.GetString("mcping_desc", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to `{0}mcping 127.0.0.1:1337`. + /// + public static string mcping_usage { + get { + return ResourceManager.GetString("mcping_usage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to minecraftquery mcq. + /// + public static string mcq_cmd { + get { + return ResourceManager.GetString("mcq_cmd", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Finds information about a minecraft server.. + /// + public static string mcq_desc { + get { + return ResourceManager.GetString("mcq_desc", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to `{0}mcq server:ip`. + /// + public static string mcq_usage { + get { + return ResourceManager.GetString("mcq_usage", resourceCulture); + } + } /// /// Looks up a localized string similar to `{0}memegen biw "gets iced coffee" "in the winter"`. diff --git a/src/NadekoBot/Resources/CommandStrings.resx b/src/NadekoBot/Resources/CommandStrings.resx index e414ffe5..54b18ef6 100644 --- a/src/NadekoBot/Resources/CommandStrings.resx +++ b/src/NadekoBot/Resources/CommandStrings.resx @@ -2619,4 +2619,22 @@ `{0}hentaibomb yuri` + + minecraftping mcping + + + Pings a minecraft server. + + + `{0}mcping 127.0.0.1:25565` + + + minecraftquery mcq + + + Finds information about a minecraft server. + + + `{0}mcq server:ip` + \ No newline at end of file From ac06c9b48b8bc795ff4a4da50b1115b7feca05e5 Mon Sep 17 00:00:00 2001 From: fkndean Date: Sun, 6 Nov 2016 17:29:32 -0500 Subject: [PATCH 6/9] MCQ minor consistency fix --- src/NadekoBot/Modules/Searches/Searches.cs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/NadekoBot/Modules/Searches/Searches.cs b/src/NadekoBot/Modules/Searches/Searches.cs index 5d700d6c..4ee6f93b 100644 --- a/src/NadekoBot/Modules/Searches/Searches.cs +++ b/src/NadekoBot/Modules/Searches/Searches.cs @@ -524,18 +524,12 @@ $@"🌍 **Weather for** 【{obj["target"]}】 var res = await http.GetStringAsync($"https://api.minetools.eu/query/{Uri.EscapeUriString(ip)}/{Uri.EscapeUriString(port)}").ConfigureAwait(false); var items = JObject.Parse(res); var sb = new StringBuilder(); + int i = 0; sb.AppendLine($"`Server:` {arg.ToString()} γ€˜Status: {items["status"]}γ€™"); - sb.AppendLine($"`Player List:`"); - for (int i = 0; i < items["Playerlist"].Count(); i++) + sb.AppendLine($"`Player List (First 5):`"); + foreach (var item in items["Playerlist"].Take(5)) { - if (i == 5) - { - break; - } - else - { - sb.AppendLine($"γ€”{i + 1}. {items["Playerlist"][i]}〕"); - } + sb.AppendLine($"γ€”:rosette: {item}〕"); } sb.AppendLine($"`Online Players:` {items["Players"]} / {items["MaxPlayers"]}"); sb.AppendLine($"`Plugins:` {items["Plugins"]}"); From 56eb10cf8175a9328460f5a64a8c481955c46f6a Mon Sep 17 00:00:00 2001 From: fkndean Date: Sun, 6 Nov 2016 17:30:47 -0500 Subject: [PATCH 7/9] bah :camel: --- src/NadekoBot/Modules/Searches/Searches.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/NadekoBot/Modules/Searches/Searches.cs b/src/NadekoBot/Modules/Searches/Searches.cs index 4ee6f93b..f4e0ef2c 100644 --- a/src/NadekoBot/Modules/Searches/Searches.cs +++ b/src/NadekoBot/Modules/Searches/Searches.cs @@ -524,7 +524,6 @@ $@"🌍 **Weather for** 【{obj["target"]}】 var res = await http.GetStringAsync($"https://api.minetools.eu/query/{Uri.EscapeUriString(ip)}/{Uri.EscapeUriString(port)}").ConfigureAwait(false); var items = JObject.Parse(res); var sb = new StringBuilder(); - int i = 0; sb.AppendLine($"`Server:` {arg.ToString()} γ€˜Status: {items["status"]}γ€™"); sb.AppendLine($"`Player List (First 5):`"); foreach (var item in items["Playerlist"].Take(5)) From c06b1ae33ca1a8516103c11a390c714f68b20401 Mon Sep 17 00:00:00 2001 From: fkndean Date: Sun, 6 Nov 2016 17:58:04 -0500 Subject: [PATCH 8/9] Wikia Search --- src/NadekoBot/Modules/Searches/Searches.cs | 35 +++++++++++++++++++ .../Resources/CommandStrings.Designer.cs | 27 ++++++++++++++ src/NadekoBot/Resources/CommandStrings.resx | 9 +++++ 3 files changed, 71 insertions(+) diff --git a/src/NadekoBot/Modules/Searches/Searches.cs b/src/NadekoBot/Modules/Searches/Searches.cs index f4e0ef2c..aee7f422 100644 --- a/src/NadekoBot/Modules/Searches/Searches.cs +++ b/src/NadekoBot/Modules/Searches/Searches.cs @@ -464,6 +464,41 @@ $@"🌍 **Weather for** 【{obj["target"]}】 return matches[rng.Next(0, matches.Count)].Groups["url"].Value; } } + + [NadekoCommand, Usage, Description, Aliases] + [RequireContext(ContextType.Guild)] + public async Task Wikia(IUserMessage umsg, string targ, [Remainder] string query = null) + { + var channel = (ITextChannel)umsg.Channel; + var arg = query; + if (string.IsNullOrWhiteSpace(arg)) + { + await channel.SendMessageAsync("πŸ’’ Please enter `target query`.").ConfigureAwait(false); + return; + } + await umsg.Channel.TriggerTypingAsync().ConfigureAwait(false); + using (var http = new HttpClient()) + { + http.DefaultRequestHeaders.Clear(); + string target = targ; + string search = arg; + try + { + var res = await http.GetStringAsync($"http://www.{Uri.EscapeUriString(target)}.wikia.com/api/v1/Search/List?query={Uri.EscapeUriString(search)}&limit=25&minArticleQuality=10&batch=1&namespaces=0%2C14").ConfigureAwait(false); + var items = JObject.Parse(res); + var sb = new StringBuilder(); + sb.AppendLine($"`Found:` {items["items"][0]["title"].ToString()}"); + sb.AppendLine($"`Total Found:` {items["total"].ToString()}"); + sb.AppendLine($"`Batch:` {items["currentBatch"].ToString()}/{items["batches"].ToString()}"); + sb.Append($"`URL:` <{await _google.ShortenUrl(items["items"][0]["url"].ToString()).ConfigureAwait(false)}> / `Quality`: {items["items"][0]["quality"].ToString()}"); + await channel.SendMessageAsync(sb.ToString()); + } + catch + { + await channel.SendMessageAsync($"πŸ’’ Failed finding `{arg}`.").ConfigureAwait(false); + } + } + } [NadekoCommand, Usage, Description, Aliases] [RequireContext(ContextType.Guild)] diff --git a/src/NadekoBot/Resources/CommandStrings.Designer.cs b/src/NadekoBot/Resources/CommandStrings.Designer.cs index 70df73b6..15c84b56 100644 --- a/src/NadekoBot/Resources/CommandStrings.Designer.cs +++ b/src/NadekoBot/Resources/CommandStrings.Designer.cs @@ -7510,6 +7510,33 @@ namespace NadekoBot.Resources { return ResourceManager.GetString("wiki_usage", resourceCulture); } } + + /// + /// Looks up a localized string similar to wikia. + /// + public static string wikia_cmd { + get { + return ResourceManager.GetString("wikia_cmd", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Gives you back a wikia link. + /// + public static string wikia_desc { + get { + return ResourceManager.GetString("wikia_desc", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to `{0}wikia target query`. + /// + public static string wikia_usage { + get { + return ResourceManager.GetString("wikia_usage", resourceCulture); + } + } /// /// Looks up a localized string similar to wowjoke. diff --git a/src/NadekoBot/Resources/CommandStrings.resx b/src/NadekoBot/Resources/CommandStrings.resx index 54b18ef6..98faafae 100644 --- a/src/NadekoBot/Resources/CommandStrings.resx +++ b/src/NadekoBot/Resources/CommandStrings.resx @@ -2637,4 +2637,13 @@ `{0}mcq server:ip` + + wikia + + + Gives you back a wikia link + + + `{0}wikia target query` + \ No newline at end of file From f9fb9d2f7631344c4ee2b0c0206806750c1d7435 Mon Sep 17 00:00:00 2001 From: fkndean Date: Mon, 7 Nov 2016 07:29:36 -0500 Subject: [PATCH 9/9] also check targ for null or whitespace --- src/NadekoBot/Modules/Searches/Searches.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NadekoBot/Modules/Searches/Searches.cs b/src/NadekoBot/Modules/Searches/Searches.cs index aee7f422..76edb462 100644 --- a/src/NadekoBot/Modules/Searches/Searches.cs +++ b/src/NadekoBot/Modules/Searches/Searches.cs @@ -471,7 +471,7 @@ $@"🌍 **Weather for** 【{obj["target"]}】 { var channel = (ITextChannel)umsg.Channel; var arg = query; - if (string.IsNullOrWhiteSpace(arg)) + if (string.IsNullOrWhiteSpace(targ) || string.IsNullOrWhiteSpace(arg)) { await channel.SendMessageAsync("πŸ’’ Please enter `target query`.").ConfigureAwait(false); return;