From 18213b6634e92493bb8ea249271438e864eac6d4 Mon Sep 17 00:00:00 2001 From: Master Kwoth Date: Sun, 6 Dec 2015 13:14:52 +0100 Subject: [PATCH] Dice are also being sent from memory now. --- NadekoBot/Commands/DiceRollCommand.cs | 7 +++---- NadekoBot/Modules/Music.cs | 1 - 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/NadekoBot/Commands/DiceRollCommand.cs b/NadekoBot/Commands/DiceRollCommand.cs index 325a4a67..ad343f55 100644 --- a/NadekoBot/Commands/DiceRollCommand.cs +++ b/NadekoBot/Commands/DiceRollCommand.cs @@ -7,6 +7,7 @@ using Discord.Commands; using Discord.Modules; using Discord; using System.Drawing; +using System.Drawing.Imaging; namespace NadekoBot { @@ -37,8 +38,7 @@ namespace NadekoBot } Bitmap bitmap = ImageHandler.MergeImages(images); - bitmap.Save("dices.png"); - await client.SendFile(e.Channel, "dices.png"); + await client.SendFile(e.Channel, "dice.png", ImageHandler.ImageToStream(bitmap, ImageFormat.Png)); return; } else @@ -73,9 +73,8 @@ namespace NadekoBot } Bitmap bitmap = ImageHandler.MergeImages(dices.ToArray()); - bitmap.Save("dices.png"); await client.SendMessage(e.Channel, values.Count + " Dies rolled. Total: **"+values.Sum()+"** Average: **"+(values.Sum()/(1.0f*values.Count)).ToString("N2")+"**"); - await client.SendFile(e.Channel, "dices.png"); + await client.SendFile(e.Channel, "dices.png", ImageHandler.ImageToStream(bitmap, ImageFormat.Png)); } catch (Exception) { diff --git a/NadekoBot/Modules/Music.cs b/NadekoBot/Modules/Music.cs index 82fa1bfe..3b77fc0e 100644 --- a/NadekoBot/Modules/Music.cs +++ b/NadekoBot/Modules/Music.cs @@ -45,7 +45,6 @@ namespace NadekoBot.Modules //m sh - shuffle songs //m pl - current playlist - public override void Install(ModuleManager manager) { var client = NadekoBot.client;