Dice are also being sent from memory now.

This commit is contained in:
Master Kwoth 2015-12-06 13:14:52 +01:00
parent 654099afa4
commit 18213b6634
2 changed files with 3 additions and 5 deletions

View File

@ -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)
{

View File

@ -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;