Class SocketInvite
Represents a WebSocket-based invite to a guild.
public class SocketInvite : SocketEntity<string>, IInviteMetadata, IInvite, IEntity<string>, IDeletable
- Inheritance
-
SocketInvite
- Implements
- Inherited Members
Properties
Application
Gets the embedded application to open for this voice channel embedded application invite.
public RestApplication Application { get; }
Property Value
- RestApplication
A partial IApplication object. null if TargetUserType is not EmbeddedApplication.
Channel
Gets the channel where this invite was created.
public SocketGuildChannel Channel { get; }
Property Value
ChannelId
Gets the ID of the channel this invite is linked to.
public ulong ChannelId { get; }
Property Value
Code
Gets the unique identifier for this invite.
public string Code { get; }
Property Value
- string
A string containing the invite code (e.g.
FTqNnyS
).
CreatedAt
Gets when this invite was created.
public DateTimeOffset CreatedAt { get; }
Property Value
ExpiresAt
Gets the expiration date of this invite. null if the invite never expires.
public DateTimeOffset? ExpiresAt { get; }
Property Value
Guild
Gets the guild where this invite was created.
public SocketGuild Guild { get; }
Property Value
GuildId
Gets the ID of the guild this invite is linked to.
public ulong? GuildId { get; }
Property Value
Inviter
Gets the user that created this invite if available.
public SocketGuildUser Inviter { get; }
Property Value
IsTemporary
Gets a value that indicates whether the invite is a temporary one.
public bool IsTemporary { get; }
Property Value
- bool
true if users accepting this invite will be removed from the guild when they log off; otherwise false.
MaxAge
Gets the time (in seconds) until the invite expires.
public int MaxAge { get; }
Property Value
MaxUses
Gets the max number of uses this invite may have.
public int MaxUses { get; }
Property Value
TargetUser
Gets the user targeted by this invite if available.
public SocketUser TargetUser { get; }
Property Value
TargetUserType
Gets the type of the user targeted by this invite.
public TargetUserType TargetUserType { get; }
Property Value
Url
Gets the URL used to accept this invite using Code.
public string Url { get; }
Property Value
- string
A string containing the full invite URL (e.g.
https://discord.gg/FTqNnyS
).
Uses
Gets the number of times this invite has been used.
public int Uses { get; }
Property Value
Methods
DeleteAsync(RequestOptions)
Deletes this object and all its children.
public Task DeleteAsync(RequestOptions options = null)
Parameters
options
RequestOptionsThe options to be used when sending the request.
Returns
ToString()
Gets the URL of the invite.
public override string ToString()
Returns
- string
A string that resolves to the Url of the invite.