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); var image = System.Drawing.Image.FromStream(imageStream);
// Save the image to disk. // Save the image to disk.
image.Save("data/avatar.png", System.Drawing.Imaging.ImageFormat.Png); image.Save("data/avatar.png", System.Drawing.Imaging.ImageFormat.Png);
imageStream.Position = 0; await client.CurrentUser.Edit(NadekoBot.Creds.Password, avatar: image.ToStream());
await client.CurrentUser.Edit(NadekoBot.Creds.Password, avatar: imageStream);
// Send confirm. // Send confirm.
await e.Channel.SendMessage("New avatar set."); await e.Channel.SendMessage("New avatar set.");
}); });

View File

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