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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user