Fixed osu bugs

This commit is contained in:
Kwoth 2016-10-13 03:18:32 +02:00
parent 5243bf18aa
commit c45b91392f

View File

@ -46,8 +46,10 @@ namespace NadekoBot.Modules.Searches
http.AddFakeHeaders();
var res = await http.GetStreamAsync(new Uri($"http://lemmmy.pw/osusig/sig.php?uname={ usr }&flagshadow&xpbar&xpbarhex&pp=2&mode={m}")).ConfigureAwait(false);
res.Position = 0;
await channel.SendFileAsync(res, $"{usr}.png", $"`Profile Link:`https://osu.ppy.sh/u/{Uri.EscapeDataString(usr)}\n`Image provided by https://lemmmy.pw/osusig`").ConfigureAwait(false);
MemoryStream ms = new MemoryStream();
res.CopyTo(ms);
ms.Position = 0;
await channel.SendFileAsync(ms, $"{usr}.png", $"`Profile Link:`https://osu.ppy.sh/u/{Uri.EscapeDataString(usr)}\n`Image provided by https://lemmmy.pw/osusig`").ConfigureAwait(false);
}
catch (Exception ex)
{
@ -96,7 +98,7 @@ namespace NadekoBot.Modules.Searches
[NadekoCommand, Usage, Description, Aliases]
[RequireContext(ContextType.Guild)]
public async Task Osu5(IUserMessage umsg, string user, [Remainder] string mode)
public async Task Osu5(IUserMessage umsg, string user, [Remainder] string mode = null)
{
var channel = (ITextChannel)umsg.Channel;
if (string.IsNullOrWhiteSpace(NadekoBot.Credentials.OsuApiKey))