From b111ff0f124690f1f8c3a8c228aa355a9f819884 Mon Sep 17 00:00:00 2001 From: Master Kwoth Date: Sun, 24 Jan 2016 09:06:48 +0100 Subject: [PATCH] fixed hide/unhide thanks to voltana --- NadekoBot/Modules/Conversations.cs | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/NadekoBot/Modules/Conversations.cs b/NadekoBot/Modules/Conversations.cs index bb46b805..1ca42db3 100644 --- a/NadekoBot/Modules/Conversations.cs +++ b/NadekoBot/Modules/Conversations.cs @@ -456,12 +456,9 @@ namespace NadekoBot.Modules { try { - using (MemoryStream ms = new MemoryStream()) - using (Image img = Image.FromFile("images/hidden.png")) + using (Stream ms = File.OpenRead("images/hidden.png")) { - img.Save(ms, ImageFormat.Png); - - await client.CurrentUser.Edit(NadekoBot.password, null, null, null, ms, ImageType.Png); + await client.CurrentUser.Edit(NadekoBot.password, avatar: ms); } await e.Send("*hides*"); } @@ -477,12 +474,8 @@ namespace NadekoBot.Modules { try { - using (MemoryStream ms = new MemoryStream()) - using (Image img = Image.FromFile("images/nadeko.jpg")) - { - img.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg); - - await client.CurrentUser.Edit(NadekoBot.password, null, null, null, ms, ImageType.Jpeg); + using (Stream ms = File.OpenRead("images/nadeko.jpg")) { + await client.CurrentUser.Edit(NadekoBot.password, avatar: ms,avatarType:ImageType.Jpeg); } await e.Send("*unhides*"); }