Browse Source

Fixed CreateInvite preconditions

tags/docs-0.9
RogueException 9 years ago
parent
commit
218c5bce6f
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      src/Discord.Net/DiscordClient.Invites.cs

+ 2
- 2
src/Discord.Net/DiscordClient.Invites.cs View File

@@ -66,8 +66,8 @@ namespace Discord
public async Task<Invite> CreateInvite(Channel channel, int maxAge = 1800, int maxUses = 0, bool tempMembership = false, bool hasXkcd = false)
{
if (channel == null) throw new ArgumentNullException(nameof(channel));
if (maxAge <= 0) throw new ArgumentOutOfRangeException(nameof(maxAge));
if (maxUses <= 0) throw new ArgumentOutOfRangeException(nameof(maxUses));
if (maxAge < 0) throw new ArgumentOutOfRangeException(nameof(maxAge));
if (maxUses < 0) throw new ArgumentOutOfRangeException(nameof(maxUses));
CheckReady();

var response = await _api.CreateInvite(channel.Id, maxAge: maxAge, maxUses: maxUses,


Loading…
Cancel
Save