Skip to content

Commit

Permalink
Added OutOfBounds exception for DeleteMessages, for when Message Coun…
Browse files Browse the repository at this point in the history
…t is less than 2 or greater than 100
  • Loading branch information
Khionu Terabite committed Jun 19, 2016
1 parent 03c0f67 commit aeebe5d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Discord.Net/Models/Channel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@ public async Task Edit(string name = null, string topic = null, int? position =

public async Task DeleteMessages(ulong[] messageIds)
{
if (messageIds.Count() < 2) throw new ArgumentOutOfRangeException("messageIds", "You must provide at least 2 Messages or Message Ids");

await Client.ClientAPI.Send(new BulkMessageDelete(Id, messageIds));
}

Expand Down

0 comments on commit aeebe5d

Please sign in to comment.