Class DiscordInvite
Represents a Discord invite.
Inheritance
Namespace: DisCatSharp.Entities
Assembly: DisCatSharp.dll
Syntax
public class DiscordInvite
Properties
| Improve this Doc View SourceApproximateMemberCount
Gets the approximate guild total member count for the invite.
Declaration
public int? ApproximateMemberCount { get; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Int32> |
ApproximatePresenceCount
Gets the approximate guild online member count for the invite.
Declaration
public int? ApproximatePresenceCount { get; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Int32> |
Channel
Gets the channel this invite is for.
Declaration
public DiscordInviteChannel Channel { get; }
Property Value
Type | Description |
---|---|
DiscordInviteChannel |
Code
Gets the invite's code.
Declaration
public string Code { get; }
Property Value
Type | Description |
---|---|
System.String |
CreatedAt
Gets the date and time this invite was created.
Declaration
public DateTimeOffset CreatedAt { get; }
Property Value
Type | Description |
---|---|
System.DateTimeOffset |
ExpiredAt
Gets the date and time when this invite got expired.
Declaration
public DateTimeOffset ExpiredAt { get; }
Property Value
Type | Description |
---|---|
System.DateTimeOffset |
ExpiresAt
Gets the date and time when this invite expires.
Declaration
public DateTimeOffset ExpiresAt { get; }
Property Value
Type | Description |
---|---|
System.DateTimeOffset |
Guild
Gets the guild this invite is for.
Declaration
public DiscordInviteGuild Guild { get; }
Property Value
Type | Description |
---|---|
DiscordInviteGuild |
GuildScheduledEvent
Gets the guild scheduled event data for the invite.
Declaration
public DiscordScheduledEvent GuildScheduledEvent { get; }
Property Value
Type | Description |
---|---|
DiscordScheduledEvent |
Inviter
Gets the user who created the invite.
Declaration
public DiscordUser Inviter { get; }
Property Value
Type | Description |
---|---|
DiscordUser |
IsRevoked
Gets whether this invite is revoked.
Declaration
public bool IsRevoked { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsTemporary
Gets whether this invite only grants temporary membership.
Declaration
public bool IsTemporary { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
MaxAge
Gets duration in seconds after which the invite expires.
Declaration
public int MaxAge { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
MaxUses
Gets the max number of times this invite can be used.
Declaration
public int MaxUses { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Stage
Gets the stage instance this invite is for.
Declaration
public DiscordInviteStage Stage { get; }
Property Value
Type | Description |
---|---|
DiscordInviteStage |
TargetApplication
Gets the embedded partial application to open for this voice channel.
Declaration
public DiscordApplication TargetApplication { get; }
Property Value
Type | Description |
---|---|
DiscordApplication |
TargetType
Gets the target type for the voice channel this invite is for.
Declaration
public TargetType? TargetType { get; }
Property Value
Type | Description |
---|---|
System.Nullable<TargetType> |
TargetUser
Gets the user that is currently livestreaming.
Declaration
public DiscordUser TargetUser { get; }
Property Value
Type | Description |
---|---|
DiscordUser |
Type
Gets the type of this invite.
Declaration
public InviteType Type { get; }
Property Value
Type | Description |
---|---|
InviteType |
Uri
Gets the invite's url as Uri.
Declaration
public Uri Uri { get; }
Property Value
Type | Description |
---|---|
System.Uri |
Url
Gets the invite's url.
Declaration
public string Url { get; }
Property Value
Type | Description |
---|---|
System.String |
Uses
Gets the number of times this invite has been used.
Declaration
public int Uses { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
| Improve this Doc View SourceDeleteAsync(String)
Deletes the invite.
Declaration
public Task<DiscordInvite> DeleteAsync(string reason = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | reason | Reason for audit logs. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordInvite> |
Exceptions
Type | Condition |
---|---|
UnauthorizedException | Thrown when the client does not have the ManageChannels permission or the ManageGuild permission. |
NotFoundException | Thrown when the emoji does not exist. |
BadRequestException | Thrown when an invalid parameter was provided. |
ServerErrorException | Thrown when Discord is unable to process the request. |
ToString()
Converts this invite into an invite link.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | A discord.gg invite link. |