Mark guild optional in invite & general invite improvement (#1094)

* Mark guild as optional for invite

* Mark partial InviteMetadata members as Optional<T>

* Some of them aren't sent when requesting through the general GET invite endpoint

* Remove GetInviteParams

* It was kinda stupid in the first place, might as well always get the count instead of having to ask the user whether they want the two fields filled or not.

* Add ChannelType property

* Add vanity invite support
This commit is contained in:
Still Hsu
2018-07-03 05:02:38 +08:00
committed by Christopher F
parent 4bc06a0a54
commit ffe994a9df
17 changed files with 84 additions and 52 deletions

View File

@@ -51,13 +51,9 @@ namespace Discord.Rest
}
public static async Task<RestInviteMetadata> GetInviteAsync(BaseDiscordClient client,
string inviteId, bool withCount, RequestOptions options)
string inviteId, RequestOptions options)
{
var args = new GetInviteParams
{
WithCounts = withCount
};
var model = await client.ApiClient.GetInviteAsync(inviteId, args, options).ConfigureAwait(false);
var model = await client.ApiClient.GetInviteAsync(inviteId, options).ConfigureAwait(false);
if (model != null)
return RestInviteMetadata.Create(client, null, null, model);
return null;