Skip to content

Commit

Permalink
Separated the conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
khionu authored Jun 21, 2016
1 parent 402d479 commit 99637d0
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/Discord.Net/Models/Channel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,14 @@ public async Task Edit(string name = null, string topic = null, int? position =

public async Task DeleteMessages(ulong[] messageIds)
{
if (messageIds.Count() < 2 || messageIds.Count() > 100)
if (messageIds.Count() > 100)
throw new ArgumentOutOfRangeException("messageIds",
"You must provide no more than 100 and no less than 2 Messages or Message Ids");

await Client.ClientAPI.Send(new BulkMessageDelete(Id, messageIds));
"You must provide no more than 100 Messages or Message Ids");

if (messageIds.Count() == 1)
await Client.ClientAPI.Send(new DeleteMessageRequest(Id, messageIds.First()));
else if (messageIds.Any())
await Client.ClientAPI.Send(new BulkMessageDelete(Id, messageIds));
}

public async Task Delete()
Expand Down

0 comments on commit 99637d0

Please sign in to comment.