Improved plant/pick stuff, ~ow fixed

This commit is contained in:
Kwoth
2017-03-09 03:17:58 +01:00
parent ba19524245
commit e4a62c4d5e
3 changed files with 28 additions and 17 deletions

View File

@@ -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())

View File

@@ -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<OverwatchApiModel.OverwatchPlayer>(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<OverwatchApiModel.OverwatchPlayer>(url);
return model.data;
}
}
}
catch
catch (Exception ex)
{
_log.Warn(ex);
return null;
}
}