Update Administration.cs

This commit is contained in:
samvaio 2016-12-01 17:39:08 +05:30 committed by GitHub
parent c5915a45d6
commit 1fe6b2a411

View File

@ -638,8 +638,11 @@ namespace NadekoBot.Modules.Administration
public async Task Prune(IUserMessage umsg)
{
var channel = (ITextChannel)umsg.Channel;
var user = channel.Guild.GetCurrentUser();
var enumerable = (await umsg.Channel.GetMessagesAsync()).Where(x => x.Author.Id == user.Id);
var enumerable = (await umsg.Channel.GetMessagesAsync()).AsEnumerable();
enumerable = enumerable.Where(x => x.Author.Id == user.Id);
await umsg.Channel.DeleteMessagesAsync(enumerable);
}