Fixed bugs with creating invites

This commit is contained in:
RogueException
2017-02-07 19:48:09 -04:00
parent 4cf6d8e03f
commit d9fd0c34e4
4 changed files with 7 additions and 3 deletions

View File

@@ -74,8 +74,12 @@ namespace Discord.Rest
var args = new CreateChannelInviteParams { IsTemporary = isTemporary };
if (maxAge.HasValue)
args.MaxAge = maxAge.Value;
else
args.MaxAge = 0;
if (maxUses.HasValue)
args.MaxUses = maxUses.Value;
else
args.MaxUses = 0;
var model = await client.ApiClient.CreateChannelInviteAsync(channel.Id, args, options).ConfigureAwait(false);
return RestInviteMetadata.Create(client, null, channel, model);
}