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:
@@ -210,6 +210,12 @@ namespace Discord.Rest
|
||||
var models = await client.ApiClient.GetGuildInvitesAsync(guild.Id, options).ConfigureAwait(false);
|
||||
return models.Select(x => RestInviteMetadata.Create(client, guild, null, x)).ToImmutableArray();
|
||||
}
|
||||
public static async Task<RestInviteMetadata> GetVanityInviteAsync(IGuild guild, BaseDiscordClient client,
|
||||
RequestOptions options)
|
||||
{
|
||||
var model = await client.ApiClient.GetVanityInviteAsync(guild.Id, options).ConfigureAwait(false);
|
||||
return RestInviteMetadata.Create(client, guild, null, model);
|
||||
}
|
||||
|
||||
//Roles
|
||||
public static async Task<RestRole> CreateRoleAsync(IGuild guild, BaseDiscordClient client,
|
||||
|
||||
Reference in New Issue
Block a user