From e4a62c4d5ef169717333b583d13f8f9dd03c52b9 Mon Sep 17 00:00:00 2001 From: Kwoth Date: Thu, 9 Mar 2017 03:17:58 +0100 Subject: [PATCH] Improved plant/pick stuff, ~ow fixed --- .../Games/Commands/PlantAndPickCommands.cs | 4 ++-- .../Searches/Commands/OverwatchCommands.cs | 22 +++++++++++++------ .../Resources/ResponseStrings.en-US.resx | 19 +++++++++------- 3 files changed, 28 insertions(+), 17 deletions(-) diff --git a/src/NadekoBot/Modules/Games/Commands/PlantAndPickCommands.cs b/src/NadekoBot/Modules/Games/Commands/PlantAndPickCommands.cs index f5c66cb7..7c081289 100644 --- a/src/NadekoBot/Modules/Games/Commands/PlantAndPickCommands.cs +++ b/src/NadekoBot/Modules/Games/Commands/PlantAndPickCommands.cs @@ -162,9 +162,9 @@ namespace NadekoBot.Modules.Games Prefix); if (amount > 1) - msgToSend += GetText("pick_pl", Prefix); + msgToSend += " " + GetText("pick_pl", Prefix); else - msgToSend += GetText("pick_sn", Prefix); + msgToSend += " " + GetText("pick_sn", Prefix); IUserMessage msg; using (var toSend = imgData.Value.ToStream()) diff --git a/src/NadekoBot/Modules/Searches/Commands/OverwatchCommands.cs b/src/NadekoBot/Modules/Searches/Commands/OverwatchCommands.cs index afee7e8d..c90cf7f8 100644 --- a/src/NadekoBot/Modules/Searches/Commands/OverwatchCommands.cs +++ b/src/NadekoBot/Modules/Searches/Commands/OverwatchCommands.cs @@ -1,4 +1,5 @@ -using Discord; +using System; +using Discord; using Discord.Commands; using NadekoBot.Attributes; using NadekoBot.Extensions; @@ -20,7 +21,7 @@ namespace NadekoBot.Modules.Searches { if (string.IsNullOrWhiteSpace(query)) return; - var battletag = Regex.Replace(query, "#", "-"); + var battletag = query.Replace("#", "-"); await Context.Channel.TriggerTypingAsync().ConfigureAwait(false); try @@ -73,15 +74,22 @@ namespace NadekoBot.Modules.Searches { try { - using (var http = new HttpClient()) + using (var handler = new HttpClientHandler()) { - var url = await http.GetStringAsync($"https://api.lootbox.eu/pc/{region.ToLower()}/{battletag}/profile"); - var model = JsonConvert.DeserializeObject(url); - return model.data; + handler.ServerCertificateCustomValidationCallback = (x, y, z, e) => true; + using (var http = new HttpClient(handler)) + { + var url = + await http.GetStringAsync( + $"https://api.lootbox.eu/pc/{region.ToLower()}/{battletag}/profile"); + var model = JsonConvert.DeserializeObject(url); + return model.data; + } } } - catch + catch (Exception ex) { + _log.Warn(ex); return null; } } diff --git a/src/NadekoBot/Resources/ResponseStrings.en-US.resx b/src/NadekoBot/Resources/ResponseStrings.en-US.resx index debaf993..014c0600 100644 --- a/src/NadekoBot/Resources/ResponseStrings.en-US.resx +++ b/src/NadekoBot/Resources/ResponseStrings.en-US.resx @@ -1235,13 +1235,6 @@ Don't forget to leave your discord name or id in the message. Currency generation has been enabled on this channel. - - {0} random {1} appeared! Pick them up by typing `{2}pick` - plural - - - A random {0} appeared! Pick it up by typing `{1}pick` - Failed loading a question. @@ -2219,6 +2212,16 @@ Owner ID: {2} {0} total votes cast. - Page #{0} + page {0} + + + No users found. + + + {0} random {1} appeared! + plural + + + A random {0} appeared! \ No newline at end of file