Table of Contents

Class SocketInvite

Namespace
Discord.WebSocket
Assembly
Discord.Net.WebSocket.dll

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

SocketGuildChannel

ChannelId

Gets the ID of the channel this invite is linked to.

public ulong ChannelId { get; }

Property Value

ulong

An ulong representing the channel snowflake identifier that the invite points to.

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

DateTimeOffset

ExpiresAt

Gets the expiration date of this invite. null if the invite never expires.

public DateTimeOffset? ExpiresAt { get; }

Property Value

DateTimeOffset?

Guild

Gets the guild where this invite was created.

public SocketGuild Guild { get; }

Property Value

SocketGuild

GuildId

Gets the ID of the guild this invite is linked to.

public ulong? GuildId { get; }

Property Value

ulong?

An ulong representing the guild snowflake identifier that the invite points to.

Inviter

Gets the user that created this invite if available.

public SocketGuildUser Inviter { get; }

Property Value

SocketGuildUser

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

int

MaxUses

Gets the max number of uses this invite may have.

public int MaxUses { get; }

Property Value

int

TargetUser

Gets the user targeted by this invite if available.

public SocketUser TargetUser { get; }

Property Value

SocketUser

TargetUserType

Gets the type of the user targeted by this invite.

public TargetUserType TargetUserType { get; }

Property Value

TargetUserType

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

int

Methods

DeleteAsync(RequestOptions)

Deletes this object and all its children.

public Task DeleteAsync(RequestOptions options = null)

Parameters

options RequestOptions

The options to be used when sending the request.

Returns

Task

ToString()

Gets the URL of the invite.

public override string ToString()

Returns

string

A string that resolves to the Url of the invite.