crash prevent for pruning if bot has no permissions
This commit is contained in:
parent
4dcf15d285
commit
b13f146d99
@ -302,8 +302,9 @@ namespace NadekoBot.Modules
|
||||
await e.Send("Incorrect amount.");
|
||||
return;
|
||||
}
|
||||
|
||||
(await e.Channel.DownloadMessages(num)).ForEach(async m => await m.Delete());
|
||||
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."); }
|
||||
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user