Removed hide/unhide commands. Removed "Trivia cancelled" console message. Slight change to .newavatar

This commit is contained in:
Master Kwoth 2016-06-04 03:16:47 +02:00
parent 052fa32e55
commit c540b2c3d6
3 changed files with 5 additions and 29 deletions

View File

@ -720,11 +720,13 @@ namespace NadekoBot.Modules.Administration
var avatarAddress = e.GetArg("img"); var avatarAddress = e.GetArg("img");
var imageStream = await SearchHelper.GetResponseStreamAsync(avatarAddress).ConfigureAwait(false); var imageStream = await SearchHelper.GetResponseStreamAsync(avatarAddress).ConfigureAwait(false);
var image = System.Drawing.Image.FromStream(imageStream); var image = System.Drawing.Image.FromStream(imageStream);
// Save the image to disk.
image.Save("data/avatar.png", System.Drawing.Imaging.ImageFormat.Png);
await client.CurrentUser.Edit(NadekoBot.Creds.Password, avatar: image.ToStream()).ConfigureAwait(false); await client.CurrentUser.Edit(NadekoBot.Creds.Password, avatar: image.ToStream()).ConfigureAwait(false);
// Send confirm. // Send confirm.
await e.Channel.SendMessage("New avatar set.").ConfigureAwait(false); await e.Channel.SendMessage("New avatar set.").ConfigureAwait(false);
// Save the image to disk.
image.Save("data/avatar.png", System.Drawing.Imaging.ImageFormat.Png);
}); });
cgb.CreateCommand(Prefix + "setgame") cgb.CreateCommand(Prefix + "setgame")

View File

@ -258,28 +258,6 @@ namespace NadekoBot.Modules.Conversations
await e.Channel.SendMessage("I can't find a message mentioning you.").ConfigureAwait(false); await e.Channel.SendMessage("I can't find a message mentioning you.").ConfigureAwait(false);
}); });
cgb.CreateCommand("hide")
.Description("Hides Nadeko in plain sight!11!!")
.Do(async e =>
{
using (var ms = Resources.hidden.ToStream(ImageFormat.Png))
{
await client.CurrentUser.Edit(NadekoBot.Creds.Password, avatar: ms).ConfigureAwait(false);
}
await e.Channel.SendMessage("*hides*").ConfigureAwait(false);
});
cgb.CreateCommand("unhide")
.Description("Unhides Nadeko in plain sight!1!!1")
.Do(async e =>
{
using (var fs = new FileStream("data/avatar.png", FileMode.Open))
{
await client.CurrentUser.Edit(NadekoBot.Creds.Password, avatar: fs).ConfigureAwait(false);
}
await e.Channel.SendMessage("*unhides*").ConfigureAwait(false);
});
cgb.CreateCommand("dump") cgb.CreateCommand("dump")
.Description("Dumps all of the invites it can to dump.txt.** Owner Only.**") .Description("Dumps all of the invites it can to dump.txt.** Owner Only.**")
.Do(async e => .Do(async e =>

View File

@ -2,7 +2,6 @@
using Discord.Commands; using Discord.Commands;
using NadekoBot.Classes; using NadekoBot.Classes;
using NadekoBot.Extensions; using NadekoBot.Extensions;
using System;
using System.Collections.Concurrent; using System.Collections.Concurrent;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@ -79,10 +78,7 @@ namespace NadekoBot.Modules.Games.Commands.Trivia
await Task.Delay(QuestionDurationMiliseconds - HintTimeoutMiliseconds, token).ConfigureAwait(false); await Task.Delay(QuestionDurationMiliseconds - HintTimeoutMiliseconds, token).ConfigureAwait(false);
} }
catch (TaskCanceledException) catch (TaskCanceledException) { } //means someone guessed the answer
{
Console.WriteLine("Trivia cancelled");
}
GameActive = false; GameActive = false;
if (!triviaCancelSource.IsCancellationRequested) if (!triviaCancelSource.IsCancellationRequested)
await channel.Send($":clock2: :question: **Time's up!** The correct answer was **{CurrentQuestion.Answer}**").ConfigureAwait(false); await channel.Send($":clock2: :question: **Time's up!** The correct answer was **{CurrentQuestion.Answer}**").ConfigureAwait(false);