fixed newavatar

This commit is contained in:
Master Kwoth 2016-03-05 16:06:20 +01:00
parent 707418fc46
commit af891b53f5
2 changed files with 3 additions and 2 deletions

View File

@ -470,8 +470,7 @@ namespace NadekoBot.Modules {
var image = System.Drawing.Image.FromStream(imageStream);
// Save the image to disk.
image.Save("data/avatar.png", System.Drawing.Imaging.ImageFormat.Png);
imageStream.Position = 0;
await client.CurrentUser.Edit(NadekoBot.Creds.Password, avatar: imageStream);
await client.CurrentUser.Edit(NadekoBot.Creds.Password, avatar: image.ToStream());
// Send confirm.
await e.Channel.SendMessage("New avatar set.");
});

View File

@ -8,6 +8,7 @@ using System;
using System.Collections.Concurrent;
using System.Linq;
using System.Threading.Tasks;
using NadekoBot.Classes.Permissions;
using Timer = System.Timers.Timer;
namespace NadekoBot.Modules {
@ -308,6 +309,7 @@ namespace NadekoBot.Modules {
cgb.CreateCommand("cleanup")
.Description("Cleans up hanging voice connections. BOT OWNER ONLY")
.AddCheck(SimpleCheckers.OwnerOnly())
.Do(e => {
foreach (var kvp in MusicPlayers) {
var songs = kvp.Value.Playlist;