crash prevent for pruning if bot has no permissions

This commit is contained in:
Kwoth 2016-01-12 23:09:26 +01:00
parent 4dcf15d285
commit b13f146d99

View File

@ -302,8 +302,9 @@ namespace NadekoBot.Modules
await e.Send("Incorrect amount.");
return;
}
try {
(await e.Channel.DownloadMessages(num)).ForEach(async m => await m.Delete());
} catch (Exception) { await e.Send("Failed pruning. Make sure the bot has correct permissions."); }
});