Update Administration.cs

This commit is contained in:
samvaio 2016-12-01 17:20:27 +05:30 committed by GitHub
parent 2f1dedb33a
commit bd70dc21fd

View File

@ -635,11 +635,11 @@ namespace NadekoBot.Modules.Administration
//delets her own messages, no perm required //delets her own messages, no perm required
[NadekoCommand, Usage, Description, Aliases] [NadekoCommand, Usage, Description, Aliases]
[RequireContext(ContextType.Guild)] [RequireContext(ContextType.Guild)]
public async Task Prune(IUserMessage umsg) public async Task Prune(IUserMessage umsg, int count)
{ {
var channel = (ITextChannel)umsg.Channel; var channel = (ITextChannel)umsg.Channel;
var user = channel.Guild.GetCurrentUser(); var user = channel.Guild.GetCurrentUser();
var enumerable = (await umsg.Channel.GetMessagesAsync(100)).Where(x => x.Author.Id == user.Id); var enumerable = (await umsg.Channel.GetMessagesAsync(count : 100)).Where(x => x.Author.Id == user.Id);
await umsg.Channel.DeleteMessagesAsync(enumerable); await umsg.Channel.DeleteMessagesAsync(enumerable);
} }