fixed .clr
This commit is contained in:
parent
9c9e676ae9
commit
69a0efd6c9
@ -415,14 +415,10 @@ namespace NadekoBot.Modules {
|
|||||||
cgb.CreateCommand(".clr")
|
cgb.CreateCommand(".clr")
|
||||||
.Description("Clears some of nadeko's messages from the current channel.")
|
.Description("Clears some of nadeko's messages from the current channel.")
|
||||||
.Do(async e => {
|
.Do(async e => {
|
||||||
try {
|
var msgs = await e.Channel.DownloadMessages(100);
|
||||||
await e.Channel.DownloadMessages(100);
|
|
||||||
|
|
||||||
e.Channel.Messages.Where(msg => msg.User.Id == client.CurrentUser.Id).ForEach(async m => await m.Delete());
|
msgs.Where(msg => msg.User.Id == client.CurrentUser.Id)
|
||||||
|
.ForEach(async m => { try { await m.Delete(); } catch (Exception) { } });
|
||||||
} catch (Exception) {
|
|
||||||
await e.Send("I cant do it :(");
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
cgb.CreateCommand(".newname")
|
cgb.CreateCommand(".newname")
|
||||||
.Description("Give the bot a new name.")
|
.Description("Give the bot a new name.")
|
||||||
|
Loading…
Reference in New Issue
Block a user