Fixed osu bugs
This commit is contained in:
parent
5243bf18aa
commit
c45b91392f
@ -46,8 +46,10 @@ namespace NadekoBot.Modules.Searches
|
|||||||
http.AddFakeHeaders();
|
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);
|
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;
|
MemoryStream ms = new MemoryStream();
|
||||||
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);
|
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)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@ -96,7 +98,7 @@ namespace NadekoBot.Modules.Searches
|
|||||||
|
|
||||||
[NadekoCommand, Usage, Description, Aliases]
|
[NadekoCommand, Usage, Description, Aliases]
|
||||||
[RequireContext(ContextType.Guild)]
|
[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;
|
var channel = (ITextChannel)umsg.Channel;
|
||||||
if (string.IsNullOrWhiteSpace(NadekoBot.Credentials.OsuApiKey))
|
if (string.IsNullOrWhiteSpace(NadekoBot.Credentials.OsuApiKey))
|
||||||
|
Loading…
Reference in New Issue
Block a user