cleanup, added prune command

This commit is contained in:
Kwoth
2016-01-10 15:49:31 +01:00
parent e1d1f196fe
commit 1d632b61d8
4 changed files with 40 additions and 8 deletions

View File

@ -274,8 +274,22 @@ namespace NadekoBot.Modules
var time = (DateTime.Now - Process.GetCurrentProcess().StartTime);
string uptime = " " + time.Days + " days, " + time.Hours + " hours, and " + time.Minutes + " minutes.";
await e.Send( String.Format("```Servers: {0}\nUnique Users: {1}\nUptime: {2}\nMy id is: {3}```", serverCount, uniqueUserCount, uptime, client.CurrentUser.Id));
await e.Send($"```Servers: {serverCount}\nUnique Users: {uniqueUserCount}\nUptime: {uptime}\nMy id is: {client.CurrentUser.Id}```");
});
cgb.CreateCommand(".prune")
.Parameter("num", Discord.Commands.ParameterType.Required)
.Do(async e => {
int num;
if (!Int32.TryParse(e.GetArg("num"), out num) || num < 1) {
await e.Send("Incorrect amount.");
return;
}
(await e.Channel.DownloadMessages(num)).ForEach(async m => await m.Delete());
});
});
}

View File

@ -111,7 +111,8 @@ namespace NadekoBot.Modules {
if (video?.Uri != "" && video.Uri != null) {
SongQueue.Add(video);
await e.Send("**Queued** " + video.FullName);
if(SongQueue.Count > 1)
await e.Send("**Queued** " + video.FullName);
}
});
@ -171,7 +172,6 @@ namespace NadekoBot.Modules {
var msg = await e.Send("Playing " + Music.CurrentSong.FullName + " [00:00]");
int counter = 0;
int byteCount;
var m = await e.Send("Downloading song...");
while ((byteCount = streamer.PCMOutput.Read(buffer, 0, blockSize)) > 0) {
Voice.Send(buffer, byteCount);