Method CreateChannelInvite
| Improve this Doc View SourceCreateChannelInvite(Snowflake, TimeSpan?, int?, bool?, bool?)
Creates a new invite for the specified guild channel.
Requires CreateInstantInvite.
Declaration
public Task<DiscordInvite> CreateChannelInvite(Snowflake channelId, TimeSpan? maxAge = null, int? maxUses = null, bool? temporary = null, bool? unique = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Snowflake | channelId | The ID of the guild channel. |
| TimeSpan? | maxAge | The duration of invite before expiry, or 0 or null for never. |
| int? | maxUses | The max number of uses or 0 or null for unlimited. |
| bool? | temporary | Whether this invite only grants temporary membership. |
| bool? | unique | If true, don't try to reuse a similar invite (useful for creating many unique one time use invites). |
Returns
| Type | Description |
|---|---|
| Task<DiscordInvite> |
Exceptions
| Type | Condition |
|---|---|
| DiscordHttpApiException |
CreateChannelInvite(DiscordGuildChannel, TimeSpan?, int?, bool?, bool?)
Creates a new invite for the specified guild channel.
Requires CreateInstantInvite.
Declaration
public Task<DiscordInvite> CreateChannelInvite(DiscordGuildChannel channel, TimeSpan? maxAge = null, int? maxUses = null, bool? temporary = null, bool? unique = null)
Parameters
| Type | Name | Description |
|---|---|---|
| DiscordGuildChannel | channel | The guild channel. |
| TimeSpan? | maxAge | The duration of invite before expiry, or 0 or null for never. |
| int? | maxUses | The max number of uses or 0 or null for unlimited. |
| bool? | temporary | Whether this invite only grants temporary membership. |
| bool? | unique | If true, don't try to reuse a similar invite (useful for creating many unique one time use invites). |
Returns
| Type | Description |
|---|---|
| Task<DiscordInvite> |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | |
| DiscordHttpApiException |