Show / Hide Table of Contents

Class SocketGuild

Represents a WebSocket-based guild object.

Inheritance
System.Object
SocketEntity<System.UInt64>
SocketGuild
Implements
IGuild
IDeletable
ISnowflakeEntity
IEntity<System.UInt64>
System.IDisposable
Inherited Members
SocketEntity<UInt64>.Id
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Discord.WebSocket
Assembly: Discord.Net.WebSocket.dll
Syntax
public class SocketGuild : SocketEntity<ulong>, IGuild, IDeletable, ISnowflakeEntity, IEntity<ulong>, IDisposable

Properties

| Improve this Doc View Source

AFKChannel

Gets the AFK voice channel in this guild.

Declaration
public SocketVoiceChannel AFKChannel { get; }
Property Value
Type Description
SocketVoiceChannel

A SocketVoiceChannel that the AFK users will be moved to after they have idled for too long; null if none is set.

| Improve this Doc View Source

AFKTimeout

Gets the amount of time (in seconds) a user must be inactive in a voice channel for until they are automatically moved to the AFK voice channel.

Declaration
public int AFKTimeout { get; }
Property Value
Type Description
System.Int32

An System.Int32 representing the amount of time in seconds for a user to be marked as inactive and moved into the AFK voice channel.

| Improve this Doc View Source

ApplicationId

Gets the application ID of the guild creator if it is bot-created.

Declaration
public ulong? ApplicationId { get; }
Property Value
Type Description
System.Nullable<System.UInt64>

A System.UInt64 representing the snowflake identifier of the application ID that created this guild, or null if it was not bot-created.

| Improve this Doc View Source

AudioClient

Gets the IAudioClient associated with this guild.

Declaration
public IAudioClient AudioClient { get; }
Property Value
Type Description
IAudioClient
| Improve this Doc View Source

BannerId

Gets the identifier for this guilds banner image.

Declaration
public string BannerId { get; }
Property Value
Type Description
System.String

An identifier for the banner image; null if none is set.

| Improve this Doc View Source

BannerUrl

Gets the URL of this guild's banner image.

Declaration
public string BannerUrl { get; }
Property Value
Type Description
System.String

A URL pointing to the guild's banner image; null if none is set.

| Improve this Doc View Source

CategoryChannels

Gets a collection of all category channels in this guild.

Declaration
public IReadOnlyCollection<SocketCategoryChannel> CategoryChannels { get; }
Property Value
Type Description
System.Collections.Generic.IReadOnlyCollection<SocketCategoryChannel>

A read-only collection of category channels found within this guild.

| Improve this Doc View Source

Channels

Gets a collection of all channels in this guild.

Declaration
public IReadOnlyCollection<SocketGuildChannel> Channels { get; }
Property Value
Type Description
System.Collections.Generic.IReadOnlyCollection<SocketGuildChannel>

A read-only collection of generic channels found within this guild.

| Improve this Doc View Source

CreatedAt

Gets when the snowflake was created.

Declaration
public DateTimeOffset CreatedAt { get; }
Property Value
Type Description
System.DateTimeOffset

A System.DateTimeOffset representing when the entity was first created.

| Improve this Doc View Source

CurrentUser

Gets the current logged-in user.

Declaration
public SocketGuildUser CurrentUser { get; }
Property Value
Type Description
SocketGuildUser
| Improve this Doc View Source

DefaultChannel

Gets the default channel in this guild.

Declaration
public SocketTextChannel DefaultChannel { get; }
Property Value
Type Description
SocketTextChannel

A SocketTextChannel representing the first viewable channel that the user has access to.

Remarks

This property retrieves the first viewable text channel for this guild.

warning

This channel does not guarantee the user can send message to it, as it only looks for the first viewable text channel.

| Improve this Doc View Source

DefaultMessageNotifications

Gets the default message notifications for users who haven't explicitly set their notification settings.

Declaration
public DefaultMessageNotifications DefaultMessageNotifications { get; }
Property Value
Type Description
DefaultMessageNotifications
| Improve this Doc View Source

Description

Gets the description for the guild.

Declaration
public string Description { get; }
Property Value
Type Description
System.String

The description for the guild; null if none is set.

| Improve this Doc View Source

DownloadedMemberCount

Gets the number of members downloaded to the local guild cache.

Declaration
public int DownloadedMemberCount { get; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

DownloaderPromise

Declaration
public Task DownloaderPromise { get; }
Property Value
Type Description
System.Threading.Tasks.Task
| Improve this Doc View Source

EmbedChannel

Gets the embed channel (i.e. the channel set in the guild's widget settings) in this guild.

Declaration
public SocketGuildChannel EmbedChannel { get; }
Property Value
Type Description
SocketGuildChannel

A channel set within the server's widget settings; null if none is set.

| Improve this Doc View Source

Emotes

Gets a collection of all custom emotes for this guild.

Declaration
public IReadOnlyCollection<GuildEmote> Emotes { get; }
Property Value
Type Description
System.Collections.Generic.IReadOnlyCollection<GuildEmote>

A read-only collection of all custom emotes for this guild.

| Improve this Doc View Source

EveryoneRole

Gets the built-in role containing all users in this guild.

Declaration
public SocketRole EveryoneRole { get; }
Property Value
Type Description
SocketRole

A role object that represents an @everyone role in this guild.

| Improve this Doc View Source

ExplicitContentFilter

Gets the level of content filtering applied to user's content in a Guild.

Declaration
public ExplicitContentFilterLevel ExplicitContentFilter { get; }
Property Value
Type Description
ExplicitContentFilterLevel

The level of explicit content filtering.

| Improve this Doc View Source

Features

Gets a collection of all extra features added to this guild.

Declaration
public IReadOnlyCollection<string> Features { get; }
Property Value
Type Description
System.Collections.Generic.IReadOnlyCollection<System.String>

A read-only collection of enabled features in this guild.

| Improve this Doc View Source

HasAllMembers

Indicates whether the client has all the members downloaded to the local guild cache.

Declaration
public bool HasAllMembers { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

IconId

Gets the ID of this guild's icon.

Declaration
public string IconId { get; }
Property Value
Type Description
System.String

An identifier for the splash image; null if none is set.

| Improve this Doc View Source

IconUrl

Gets the URL of this guild's icon.

Declaration
public string IconUrl { get; }
Property Value
Type Description
System.String

A URL pointing to the guild's icon; null if none is set.

| Improve this Doc View Source

IsConnected

Indicates whether the client is connected to this guild.

Declaration
public bool IsConnected { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

IsEmbeddable

Gets a value that indicates whether this guild is embeddable (i.e. can use widget).

Declaration
public bool IsEmbeddable { get; }
Property Value
Type Description
System.Boolean

true if this guild can be embedded via widgets; otherwise false.

| Improve this Doc View Source

IsSynced

Indicates whether the guild cache is synced to this guild.

Declaration
public bool IsSynced { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

MemberCount

Gets the number of members.

Declaration
public int MemberCount { get; }
Property Value
Type Description
System.Int32
Remarks

This property retrieves the number of members returned by Discord.

tip

Due to how this property is returned by Discord instead of relying on the WebSocket cache, the number here is the most accurate in terms of counting the number of users within this guild.

Use this instead of enumerating the count of the Users collection, as you may see discrepancy between that and this property.

| Improve this Doc View Source

MfaLevel

Gets the level of Multi-Factor Authentication requirements a user must fulfill before being allowed to perform administrative actions in this guild.

Declaration
public MfaLevel MfaLevel { get; }
Property Value
Type Description
MfaLevel

The level of MFA requirement.

| Improve this Doc View Source

Name

Gets the name of this guild.

Declaration
public string Name { get; }
Property Value
Type Description
System.String

A string containing the name of this guild.

| Improve this Doc View Source

Owner

Gets the user that owns this guild.

Declaration
public SocketGuildUser Owner { get; }
Property Value
Type Description
SocketGuildUser
| Improve this Doc View Source

OwnerId

Gets the ID of the user that owns this guild.

Declaration
public ulong OwnerId { get; }
Property Value
Type Description
System.UInt64

A System.UInt64 representing the snowflake identifier of the user that owns this guild.

| Improve this Doc View Source

PreferredCulture

Gets the preferred culture of this guild.

Declaration
public CultureInfo PreferredCulture { get; }
Property Value
Type Description
System.Globalization.CultureInfo

The preferred culture information of this guild.

| Improve this Doc View Source

PreferredLocale

Gets the preferred locale of this guild in IETF BCP 47 language tag format.

Declaration
public string PreferredLocale { get; }
Property Value
Type Description
System.String

The preferred locale of the guild in IETF BCP 47 language tag format.

| Improve this Doc View Source

PremiumSubscriptionCount

Gets the number of premium subscribers of this guild.

Declaration
public int PremiumSubscriptionCount { get; }
Property Value
Type Description
System.Int32

The number of premium subscribers of this guild.

Remarks

This is the number of users who have boosted this guild.

| Improve this Doc View Source

PremiumTier

Gets the tier of guild boosting in this guild.

Declaration
public PremiumTier PremiumTier { get; }
Property Value
Type Description
PremiumTier

The tier of guild boosting in this guild.

| Improve this Doc View Source

Roles

Gets a collection of all roles in this guild.

Declaration
public IReadOnlyCollection<SocketRole> Roles { get; }
Property Value
Type Description
System.Collections.Generic.IReadOnlyCollection<SocketRole>

A read-only collection of roles found within this guild.

| Improve this Doc View Source

SplashId

Gets the ID of this guild's splash image.

Declaration
public string SplashId { get; }
Property Value
Type Description
System.String

An identifier for the splash image; null if none is set.

| Improve this Doc View Source

SplashUrl

Gets the URL of this guild's splash image.

Declaration
public string SplashUrl { get; }
Property Value
Type Description
System.String

A URL pointing to the guild's splash image; null if none is set.

| Improve this Doc View Source

SyncPromise

Declaration
public Task SyncPromise { get; }
Property Value
Type Description
System.Threading.Tasks.Task
| Improve this Doc View Source

SystemChannel

Gets the system channel where randomized welcome messages are sent in this guild.

Declaration
public SocketTextChannel SystemChannel { get; }
Property Value
Type Description
SocketTextChannel

A text channel where randomized welcome messages will be sent to; null if none is set.

| Improve this Doc View Source

SystemChannelFlags

Gets the flags for the types of system channel messages that are disabled.

Declaration
public SystemChannelMessageDeny SystemChannelFlags { get; }
Property Value
Type Description
SystemChannelMessageDeny

The flags for the types of system channel messages that are disabled.

| Improve this Doc View Source

TextChannels

Gets a collection of all text channels in this guild.

Declaration
public IReadOnlyCollection<SocketTextChannel> TextChannels { get; }
Property Value
Type Description
System.Collections.Generic.IReadOnlyCollection<SocketTextChannel>

A read-only collection of message channels found within this guild.

| Improve this Doc View Source

Users

Gets a collection of users in this guild.

Declaration
public IReadOnlyCollection<SocketGuildUser> Users { get; }
Property Value
Type Description
System.Collections.Generic.IReadOnlyCollection<SocketGuildUser>

A collection of guild users found within this guild.

Remarks

This property retrieves all users found within this guild.

warning

This property may not always return all the members for large guilds (i.e. guilds containing 100+ users). If you are simply looking to get the number of users present in this guild, consider using MemberCount instead.

Otherwise, you may need to enable AlwaysDownloadUsers to fetch the full user list upon startup, or use DownloadUsersAsync() to manually download the users.

| Improve this Doc View Source

VanityURLCode

Gets the code for this guild's vanity invite URL.

Declaration
public string VanityURLCode { get; }
Property Value
Type Description
System.String

A string containing the vanity invite code for this guild; null if none is set.

| Improve this Doc View Source

VerificationLevel

Gets the level of requirements a user must fulfill before being allowed to post messages in this guild.

Declaration
public VerificationLevel VerificationLevel { get; }
Property Value
Type Description
VerificationLevel

The level of requirements.

| Improve this Doc View Source

VoiceChannels

Gets a collection of all voice channels in this guild.

Declaration
public IReadOnlyCollection<SocketVoiceChannel> VoiceChannels { get; }
Property Value
Type Description
System.Collections.Generic.IReadOnlyCollection<SocketVoiceChannel>

A read-only collection of voice channels found within this guild.

| Improve this Doc View Source

VoiceRegionId

Gets the ID of the region hosting this guild's voice channels.

Declaration
public string VoiceRegionId { get; }
Property Value
Type Description
System.String

A string containing the identifier for the voice region that this guild uses (e.g. eu-central).

Methods

| Improve this Doc View Source

AddBanAsync(IUser, Int32, String, RequestOptions)

Bans the user from this guild and optionally prunes their recent messages.

Declaration
public Task AddBanAsync(IUser user, int pruneDays = 0, string reason = null, RequestOptions options = null)
Parameters
Type Name Description
IUser user

The user to ban.

System.Int32 pruneDays

The number of days to remove messages from this user for, and this number must be between [0, 7].

System.String reason

The reason of the ban to be written in the audit log.

RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task

A task that represents the asynchronous add operation for the ban.

Exceptions
Type Condition
System.ArgumentException

pruneDays is not between 0 to 7.

| Improve this Doc View Source

AddBanAsync(UInt64, Int32, String, RequestOptions)

Bans the user from this guild and optionally prunes their recent messages.

Declaration
public Task AddBanAsync(ulong userId, int pruneDays = 0, string reason = null, RequestOptions options = null)
Parameters
Type Name Description
System.UInt64 userId

The snowflake ID of the user to ban.

System.Int32 pruneDays

The number of days to remove messages from this user for, and this number must be between [0, 7].

System.String reason

The reason of the ban to be written in the audit log.

RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task

A task that represents the asynchronous add operation for the ban.

Exceptions
Type Condition
System.ArgumentException

pruneDays is not between 0 to 7.

| Improve this Doc View Source

AddGuildUserAsync(UInt64, String, Action<AddGuildUserProperties>, RequestOptions)

Declaration
public Task<RestGuildUser> AddGuildUserAsync(ulong id, string accessToken, Action<AddGuildUserProperties> func = null, RequestOptions options = null)
Parameters
Type Name Description
System.UInt64 id
System.String accessToken
System.Action<AddGuildUserProperties> func
RequestOptions options
Returns
Type Description
System.Threading.Tasks.Task<RestGuildUser>
| Improve this Doc View Source

CreateCategoryChannelAsync(String, Action<GuildChannelProperties>, RequestOptions)

Creates a new channel category in this guild.

Declaration
public Task<RestCategoryChannel> CreateCategoryChannelAsync(string name, Action<GuildChannelProperties> func = null, RequestOptions options = null)
Parameters
Type Name Description
System.String name

The new name for the category.

System.Action<GuildChannelProperties> func

The delegate containing the properties to be applied to the channel upon its creation.

RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<RestCategoryChannel>

A task that represents the asynchronous creation operation. The task result contains the newly created category channel.

Exceptions
Type Condition
System.ArgumentNullException

name is null.

| Improve this Doc View Source

CreateEmoteAsync(String, Image, Optional<IEnumerable<IRole>>, RequestOptions)

Creates a new GuildEmote in this guild.

Declaration
public Task<GuildEmote> CreateEmoteAsync(string name, Image image, Optional<IEnumerable<IRole>> roles = default(Optional<IEnumerable<IRole>>), RequestOptions options = null)
Parameters
Type Name Description
System.String name

The name of the guild emote.

Image image

The image of the new emote.

Optional<System.Collections.Generic.IEnumerable<IRole>> roles

The roles to limit the emote usage to.

RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<GuildEmote>

A task that represents the asynchronous creation operation. The task result contains the created emote.

| Improve this Doc View Source

CreateIntegrationAsync(UInt64, String, RequestOptions)

Declaration
public Task<RestGuildIntegration> CreateIntegrationAsync(ulong id, string type, RequestOptions options = null)
Parameters
Type Name Description
System.UInt64 id
System.String type
RequestOptions options
Returns
Type Description
System.Threading.Tasks.Task<RestGuildIntegration>
| Improve this Doc View Source

CreateRoleAsync(String, Nullable<GuildPermissions>, Nullable<Color>, Boolean, RequestOptions)

Declaration
public Task<RestRole> CreateRoleAsync(string name, GuildPermissions? permissions = default(GuildPermissions? ), Color? color = default(Color? ), bool isHoisted = false, RequestOptions options = null)
Parameters
Type Name Description
System.String name
System.Nullable<GuildPermissions> permissions
System.Nullable<Color> color
System.Boolean isHoisted
RequestOptions options
Returns
Type Description
System.Threading.Tasks.Task<RestRole>
| Improve this Doc View Source

CreateRoleAsync(String, Nullable<GuildPermissions>, Nullable<Color>, Boolean, Boolean, RequestOptions)

Creates a new role with the provided name.

Declaration
public Task<RestRole> CreateRoleAsync(string name, GuildPermissions? permissions = default(GuildPermissions? ), Color? color = default(Color? ), bool isHoisted = false, bool isMentionable = false, RequestOptions options = null)
Parameters
Type Name Description
System.String name

The new name for the role.

System.Nullable<GuildPermissions> permissions

The guild permission that the role should possess.

System.Nullable<Color> color

The color of the role.

System.Boolean isHoisted

Whether the role is separated from others on the sidebar.

System.Boolean isMentionable

Whether the role can be mentioned.

RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<RestRole>

A task that represents the asynchronous creation operation. The task result contains the newly created role.

Exceptions
Type Condition
System.ArgumentNullException

name is null.

| Improve this Doc View Source

CreateTextChannelAsync(String, Action<TextChannelProperties>, RequestOptions)

Creates a new text channel in this guild.

Declaration
public Task<RestTextChannel> CreateTextChannelAsync(string name, Action<TextChannelProperties> func = null, RequestOptions options = null)
Parameters
Type Name Description
System.String name

The new name for the text channel.

System.Action<TextChannelProperties> func

The delegate containing the properties to be applied to the channel upon its creation.

RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<RestTextChannel>

A task that represents the asynchronous creation operation. The task result contains the newly created text channel.

Examples

The following example creates a new text channel under an existing category named Wumpus with a set topic.

var categories = await guild.GetCategoriesAsync();
var targetCategory = categories.FirstOrDefault(x => x.Name == "wumpus");
if (targetCategory == null) return;
await Context.Guild.CreateTextChannelAsync(name, x =>
{
    x.CategoryId = targetCategory.Id;
    x.Topic = $"This channel was created at {DateTimeOffset.UtcNow} by {user}.";
});
| Improve this Doc View Source

CreateVoiceChannelAsync(String, Action<VoiceChannelProperties>, RequestOptions)

Creates a new voice channel in this guild.

Declaration
public Task<RestVoiceChannel> CreateVoiceChannelAsync(string name, Action<VoiceChannelProperties> func = null, RequestOptions options = null)
Parameters
Type Name Description
System.String name

The new name for the voice channel.

System.Action<VoiceChannelProperties> func

The delegate containing the properties to be applied to the channel upon its creation.

RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<RestVoiceChannel>

A task that represents the asynchronous creation operation. The task result contains the newly created voice channel.

Exceptions
Type Condition
System.ArgumentNullException

name is null.

| Improve this Doc View Source

DeleteAsync(RequestOptions)

Deletes this object and all its children.

Declaration
public Task DeleteAsync(RequestOptions options = null)
Parameters
Type Name Description
RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task
| Improve this Doc View Source

DeleteEmoteAsync(GuildEmote, RequestOptions)

Deletes an existing GuildEmote from this guild.

Declaration
public Task DeleteEmoteAsync(GuildEmote emote, RequestOptions options = null)
Parameters
Type Name Description
GuildEmote emote

The emote to delete.

RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task

A task that represents the asynchronous removal operation.

| Improve this Doc View Source

DownloadUsersAsync()

Downloads all users for this guild if the current list is incomplete.

Declaration
public Task DownloadUsersAsync()
Returns
Type Description
System.Threading.Tasks.Task

A task that represents the asynchronous download operation.

| Improve this Doc View Source

GetAuditLogsAsync(Int32, RequestOptions, Nullable<UInt64>, Nullable<UInt64>, Nullable<ActionType>)

Gets the specified number of audit log entries for this guild.

Declaration
public IAsyncEnumerable<IReadOnlyCollection<RestAuditLogEntry>> GetAuditLogsAsync(int limit, RequestOptions options = null, ulong? beforeId = default(ulong? ), ulong? userId = default(ulong? ), ActionType? actionType = default(ActionType? ))
Parameters
Type Name Description
System.Int32 limit

The number of audit log entries to fetch.

RequestOptions options

The options to be used when sending the request.

System.Nullable<System.UInt64> beforeId

The audit log entry ID to filter entries before.

System.Nullable<System.UInt64> userId

The user ID to filter entries for.

System.Nullable<ActionType> actionType

The type of actions to filter.

Returns
Type Description
System.Collections.Generic.IAsyncEnumerable<System.Collections.Generic.IReadOnlyCollection<RestAuditLogEntry>>

A task that represents the asynchronous get operation. The task result contains a read-only collection of the requested audit log entries.

| Improve this Doc View Source

GetBanAsync(IUser, RequestOptions)

Gets a ban object for a banned user.

Declaration
public Task<RestBan> GetBanAsync(IUser user, RequestOptions options = null)
Parameters
Type Name Description
IUser user

The banned user.

RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<RestBan>

A task that represents the asynchronous get operation. The task result contains a ban object, which contains the user information and the reason for the ban; null if the ban entry cannot be found.

| Improve this Doc View Source

GetBanAsync(UInt64, RequestOptions)

Gets a ban object for a banned user.

Declaration
public Task<RestBan> GetBanAsync(ulong userId, RequestOptions options = null)
Parameters
Type Name Description
System.UInt64 userId

The snowflake identifier for the banned user.

RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<RestBan>

A task that represents the asynchronous get operation. The task result contains a ban object, which contains the user information and the reason for the ban; null if the ban entry cannot be found.

| Improve this Doc View Source

GetBansAsync(RequestOptions)

Gets a collection of all users banned in this guild.

Declaration
public Task<IReadOnlyCollection<RestBan>> GetBansAsync(RequestOptions options = null)
Parameters
Type Name Description
RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<RestBan>>

A task that represents the asynchronous get operation. The task result contains a read-only collection of ban objects that this guild currently possesses, with each object containing the user banned and reason behind the ban.

| Improve this Doc View Source

GetCategoryChannel(UInt64)

Gets a category channel in this guild.

Declaration
public SocketCategoryChannel GetCategoryChannel(ulong id)
Parameters
Type Name Description
System.UInt64 id

The snowflake identifier for the category channel.

Returns
Type Description
SocketCategoryChannel

A category channel associated with the specified id; null if none is found.

| Improve this Doc View Source

GetChannel(UInt64)

Gets a channel in this guild.

Declaration
public SocketGuildChannel GetChannel(ulong id)
Parameters
Type Name Description
System.UInt64 id

The snowflake identifier for the channel.

Returns
Type Description
SocketGuildChannel

A generic channel associated with the specified id; null if none is found.

| Improve this Doc View Source

GetEmoteAsync(UInt64, RequestOptions)

Gets a specific emote from this guild.

Declaration
public Task<GuildEmote> GetEmoteAsync(ulong id, RequestOptions options = null)
Parameters
Type Name Description
System.UInt64 id

The snowflake identifier for the guild emote.

RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<GuildEmote>

A task that represents the asynchronous get operation. The task result contains the emote found with the specified id; null if none is found.

| Improve this Doc View Source

GetIntegrationsAsync(RequestOptions)

Declaration
public Task<IReadOnlyCollection<RestGuildIntegration>> GetIntegrationsAsync(RequestOptions options = null)
Parameters
Type Name Description
RequestOptions options
Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<RestGuildIntegration>>
| Improve this Doc View Source

GetInvitesAsync(RequestOptions)

Gets a collection of all invites in this guild.

Declaration
public Task<IReadOnlyCollection<RestInviteMetadata>> GetInvitesAsync(RequestOptions options = null)
Parameters
Type Name Description
RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<RestInviteMetadata>>

A task that represents the asynchronous get operation. The task result contains a read-only collection of invite metadata, each representing information for an invite found within this guild.

| Improve this Doc View Source

GetRole(UInt64)

Gets a role in this guild.

Declaration
public SocketRole GetRole(ulong id)
Parameters
Type Name Description
System.UInt64 id

The snowflake identifier for the role.

Returns
Type Description
SocketRole

A role that is associated with the specified id; null if none is found.

| Improve this Doc View Source

GetTextChannel(UInt64)

Gets a text channel in this guild.

Declaration
public SocketTextChannel GetTextChannel(ulong id)
Parameters
Type Name Description
System.UInt64 id

The snowflake identifier for the text channel.

Returns
Type Description
SocketTextChannel

A text channel associated with the specified id; null if none is found.

| Improve this Doc View Source

GetUser(UInt64)

Gets a user from this guild.

Declaration
public SocketGuildUser GetUser(ulong id)
Parameters
Type Name Description
System.UInt64 id

The snowflake identifier of the user.

Returns
Type Description
SocketGuildUser

A guild user associated with the specified id; null if none is found.

Remarks

This method retrieves a user found within this guild.

note

This may return null in the WebSocket implementation due to incomplete user collection in large guilds.

| Improve this Doc View Source

GetVanityInviteAsync(RequestOptions)

Gets the vanity invite URL of this guild.

Declaration
public Task<RestInviteMetadata> GetVanityInviteAsync(RequestOptions options = null)
Parameters
Type Name Description
RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<RestInviteMetadata>

A task that represents the asynchronous get operation. The task result contains the partial metadata of the vanity invite found within this guild; null if none is found.

| Improve this Doc View Source

GetVoiceChannel(UInt64)

Gets a voice channel in this guild.

Declaration
public SocketVoiceChannel GetVoiceChannel(ulong id)
Parameters
Type Name Description
System.UInt64 id

The snowflake identifier for the voice channel.

Returns
Type Description
SocketVoiceChannel

A voice channel associated with the specified id; null if none is found.

| Improve this Doc View Source

GetVoiceRegionsAsync(RequestOptions)

Gets a collection of all the voice regions this guild can access.

Declaration
public Task<IReadOnlyCollection<RestVoiceRegion>> GetVoiceRegionsAsync(RequestOptions options = null)
Parameters
Type Name Description
RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<RestVoiceRegion>>

A task that represents the asynchronous get operation. The task result contains a read-only collection of voice regions the guild can access.

| Improve this Doc View Source

GetWebhookAsync(UInt64, RequestOptions)

Gets a webhook found within this guild.

Declaration
public Task<RestWebhook> GetWebhookAsync(ulong id, RequestOptions options = null)
Parameters
Type Name Description
System.UInt64 id

The identifier for the webhook.

RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<RestWebhook>

A task that represents the asynchronous get operation. The task result contains the webhook with the specified id; null if none is found.

| Improve this Doc View Source

GetWebhooksAsync(RequestOptions)

Gets a collection of all webhook from this guild.

Declaration
public Task<IReadOnlyCollection<RestWebhook>> GetWebhooksAsync(RequestOptions options = null)
Parameters
Type Name Description
RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<RestWebhook>>

A task that represents the asynchronous get operation. The task result contains a read-only collection of webhooks found within the guild.

| Improve this Doc View Source

LeaveAsync(RequestOptions)

Leaves this guild.

Declaration
public Task LeaveAsync(RequestOptions options = null)
Parameters
Type Name Description
RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task

A task that represents the asynchronous leave operation.

Remarks

This method will make the currently logged-in user leave the guild.

note

If the user is the owner of this guild, use DeleteAsync(RequestOptions) instead.

| Improve this Doc View Source

ModifyAsync(Action<GuildProperties>, RequestOptions)

Modifies this guild.

Declaration
public Task ModifyAsync(Action<GuildProperties> func, RequestOptions options = null)
Parameters
Type Name Description
System.Action<GuildProperties> func

The delegate containing the properties to modify the guild with.

RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task

A task that represents the asynchronous modification operation.

Exceptions
Type Condition
System.ArgumentNullException

func is null.

| Improve this Doc View Source

ModifyEmbedAsync(Action<GuildEmbedProperties>, RequestOptions)

Modifies this guild's embed channel.

Declaration
public Task ModifyEmbedAsync(Action<GuildEmbedProperties> func, RequestOptions options = null)
Parameters
Type Name Description
System.Action<GuildEmbedProperties> func

The delegate containing the properties to modify the guild widget with.

RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task

A task that represents the asynchronous modification operation.

Exceptions
Type Condition
System.ArgumentNullException

func is null.

| Improve this Doc View Source

ModifyEmoteAsync(GuildEmote, Action<EmoteProperties>, RequestOptions)

Modifies an existing GuildEmote in this guild.

Declaration
public Task<GuildEmote> ModifyEmoteAsync(GuildEmote emote, Action<EmoteProperties> func, RequestOptions options = null)
Parameters
Type Name Description
GuildEmote emote

The emote to be modified.

System.Action<EmoteProperties> func

The delegate containing the properties to modify the emote with.

RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<GuildEmote>

A task that represents the asynchronous modification operation. The task result contains the modified emote.

Exceptions
Type Condition
System.ArgumentNullException

func is null.

| Improve this Doc View Source

PruneUsersAsync(Int32, Boolean, RequestOptions)

Prunes inactive users.

Declaration
public Task<int> PruneUsersAsync(int days = 30, bool simulate = false, RequestOptions options = null)
Parameters
Type Name Description
System.Int32 days

The number of days required for the users to be kicked.

System.Boolean simulate

Whether this prune action is a simulation.

RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<System.Int32>

A task that represents the asynchronous prune operation. The task result contains the number of users to be or has been removed from this guild.

Remarks

This method removes all users that have not logged on in the provided number of days.

If simulate is true, this method will only return the number of users that would be removed without kicking the users.

| Improve this Doc View Source

RemoveBanAsync(IUser, RequestOptions)

Unbans the user if they are currently banned.

Declaration
public Task RemoveBanAsync(IUser user, RequestOptions options = null)
Parameters
Type Name Description
IUser user

The user to be unbanned.

RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task

A task that represents the asynchronous removal operation for the ban.

| Improve this Doc View Source

RemoveBanAsync(UInt64, RequestOptions)

Unbans the user if they are currently banned.

Declaration
public Task RemoveBanAsync(ulong userId, RequestOptions options = null)
Parameters
Type Name Description
System.UInt64 userId

The snowflake identifier of the user to be unbanned.

RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task

A task that represents the asynchronous removal operation for the ban.

| Improve this Doc View Source

ReorderChannelsAsync(IEnumerable<ReorderChannelProperties>, RequestOptions)

Bulk-modifies the order of channels in this guild.

Declaration
public Task ReorderChannelsAsync(IEnumerable<ReorderChannelProperties> args, RequestOptions options = null)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<ReorderChannelProperties> args

The properties used to modify the channel positions with.

RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task

A task that represents the asynchronous reorder operation.

| Improve this Doc View Source

ReorderRolesAsync(IEnumerable<ReorderRoleProperties>, RequestOptions)

Bulk-modifies the order of roles in this guild.

Declaration
public Task ReorderRolesAsync(IEnumerable<ReorderRoleProperties> args, RequestOptions options = null)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<ReorderRoleProperties> args

The properties used to modify the role positions with.

RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task

A task that represents the asynchronous reorder operation.

| Improve this Doc View Source

ToString()

Gets the name of the guild.

Declaration
public override string ToString()
Returns
Type Description
System.String

A string that resolves to Name.

Overrides
System.Object.ToString()

Explicit Interface Implementations

| Improve this Doc View Source

IGuild.AddGuildUserAsync(UInt64, String, Action<AddGuildUserProperties>, RequestOptions)

Adds a user to this guild.

Declaration
Task<IGuildUser> IGuild.AddGuildUserAsync(ulong userId, string accessToken, Action<AddGuildUserProperties> func, RequestOptions options)
Parameters
Type Name Description
System.UInt64 userId

The snowflake identifier of the user.

System.String accessToken

The OAuth2 access token for the user, requested with the guilds.join scope.

System.Action<AddGuildUserProperties> func

The delegate containing the properties to be applied to the user upon being added to the guild.

RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<IGuildUser>

A guild user associated with the specified userId; null if the user is already in the guild.

Remarks

This method requires you have an OAuth2 access token for the user, requested with the guilds.join scope, and that the bot have the MANAGE_INVITES permission in the guild.

| Improve this Doc View Source

IGuild.AFKChannelId

Gets the ID of the AFK voice channel for this guild.

Declaration
ulong? IGuild.AFKChannelId { get; }
Returns
Type Description
System.Nullable<System.UInt64>

A System.UInt64 representing the snowflake identifier of the AFK voice channel; null if none is set.

| Improve this Doc View Source

IGuild.AudioClient

Gets the IAudioClient currently associated with this guild.

Declaration
IAudioClient IGuild.AudioClient { get; }
Returns
Type Description
IAudioClient

An IAudioClient currently associated with this guild.

| Improve this Doc View Source

IGuild.Available

Determines if this guild is currently connected and ready to be used.

Declaration
bool IGuild.Available { get; }
Returns
Type Description
System.Boolean

true if this guild is currently connected and ready to be used; otherwise false.

Remarks
note

This property only applies to a WebSocket-based client.

This boolean is used to determine if the guild is currently connected to the WebSocket and is ready to be used/accessed.
| Improve this Doc View Source

IGuild.CreateCategoryAsync(String, Action<GuildChannelProperties>, RequestOptions)

Creates a new channel category in this guild.

Declaration
Task<ICategoryChannel> IGuild.CreateCategoryAsync(string name, Action<GuildChannelProperties> func, RequestOptions options)
Parameters
Type Name Description
System.String name

The new name for the category.

System.Action<GuildChannelProperties> func

The delegate containing the properties to be applied to the channel upon its creation.

RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<ICategoryChannel>

A task that represents the asynchronous creation operation. The task result contains the newly created category channel.

| Improve this Doc View Source

IGuild.CreateIntegrationAsync(UInt64, String, RequestOptions)

Declaration
Task<IGuildIntegration> IGuild.CreateIntegrationAsync(ulong id, string type, RequestOptions options)
Parameters
Type Name Description
System.UInt64 id
System.String type
RequestOptions options
Returns
Type Description
System.Threading.Tasks.Task<IGuildIntegration>
| Improve this Doc View Source

IGuild.CreateRoleAsync(String, Nullable<GuildPermissions>, Nullable<Color>, Boolean, RequestOptions)

Creates a new role with the provided name.

Declaration
Task<IRole> IGuild.CreateRoleAsync(string name, GuildPermissions? permissions, Color? color, bool isHoisted, RequestOptions options)
Parameters
Type Name Description
System.String name

The new name for the role.

System.Nullable<GuildPermissions> permissions

The guild permission that the role should possess.

System.Nullable<Color> color

The color of the role.

System.Boolean isHoisted

Whether the role is separated from others on the sidebar.

RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<IRole>

A task that represents the asynchronous creation operation. The task result contains the newly created role.

| Improve this Doc View Source

IGuild.CreateRoleAsync(String, Nullable<GuildPermissions>, Nullable<Color>, Boolean, Boolean, RequestOptions)

Creates a new role with the provided name.

Declaration
Task<IRole> IGuild.CreateRoleAsync(string name, GuildPermissions? permissions, Color? color, bool isHoisted, bool isMentionable, RequestOptions options)
Parameters
Type Name Description
System.String name

The new name for the role.

System.Nullable<GuildPermissions> permissions

The guild permission that the role should possess.

System.Nullable<Color> color

The color of the role.

System.Boolean isHoisted

Whether the role is separated from others on the sidebar.

System.Boolean isMentionable

Whether the role can be mentioned.

RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<IRole>

A task that represents the asynchronous creation operation. The task result contains the newly created role.

| Improve this Doc View Source

IGuild.CreateTextChannelAsync(String, Action<TextChannelProperties>, RequestOptions)

Creates a new text channel in this guild.

Declaration
Task<ITextChannel> IGuild.CreateTextChannelAsync(string name, Action<TextChannelProperties> func, RequestOptions options)
Parameters
Type Name Description
System.String name

The new name for the text channel.

System.Action<TextChannelProperties> func

The delegate containing the properties to be applied to the channel upon its creation.

RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<ITextChannel>

A task that represents the asynchronous creation operation. The task result contains the newly created text channel.

| Improve this Doc View Source

IGuild.CreateVoiceChannelAsync(String, Action<VoiceChannelProperties>, RequestOptions)

Creates a new voice channel in this guild.

Declaration
Task<IVoiceChannel> IGuild.CreateVoiceChannelAsync(string name, Action<VoiceChannelProperties> func, RequestOptions options)
Parameters
Type Name Description
System.String name

The new name for the voice channel.

System.Action<VoiceChannelProperties> func

The delegate containing the properties to be applied to the channel upon its creation.

RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<IVoiceChannel>

A task that represents the asynchronous creation operation. The task result contains the newly created voice channel.

| Improve this Doc View Source

IGuild.DefaultChannelId

Gets the ID of the default channel for this guild.

Declaration
ulong IGuild.DefaultChannelId { get; }
Returns
Type Description
System.UInt64

A System.UInt64 representing the snowflake identifier of the default text channel; 0 if none can be found.

Remarks

This property retrieves the snowflake identifier of the first viewable text channel for this guild.

warning

This channel does not guarantee the user can send message to it, as it only looks for the first viewable text channel.

| Improve this Doc View Source

IGuild.EmbedChannelId

Gets the ID of the widget embed channel of this guild.

Declaration
ulong? IGuild.EmbedChannelId { get; }
Returns
Type Description
System.Nullable<System.UInt64>

A System.UInt64 representing the snowflake identifier of the embedded channel found within the widget settings of this guild; null if none is set.

| Improve this Doc View Source

IGuild.EveryoneRole

Gets the built-in role containing all users in this guild.

Declaration
IRole IGuild.EveryoneRole { get; }
Returns
Type Description
IRole

A role object that represents an @everyone role in this guild.

| Improve this Doc View Source

IGuild.GetAFKChannelAsync(CacheMode, RequestOptions)

Gets the AFK voice channel in this guild.

Declaration
Task<IVoiceChannel> IGuild.GetAFKChannelAsync(CacheMode mode, RequestOptions options)
Parameters
Type Name Description
CacheMode mode

The CacheMode that determines whether the object should be fetched from cache.

RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<IVoiceChannel>

A task that represents the asynchronous get operation. The task result contains the voice channel that the AFK users will be moved to after they have idled for too long; null if none is set.

| Improve this Doc View Source

IGuild.GetAuditLogsAsync(Int32, CacheMode, RequestOptions, Nullable<UInt64>, Nullable<UInt64>, Nullable<ActionType>)

Gets the specified number of audit log entries for this guild.

Declaration
Task<IReadOnlyCollection<IAuditLogEntry>> IGuild.GetAuditLogsAsync(int limit, CacheMode cacheMode, RequestOptions options, ulong? beforeId, ulong? userId, ActionType? actionType)
Parameters
Type Name Description
System.Int32 limit

The number of audit log entries to fetch.

CacheMode cacheMode
RequestOptions options

The options to be used when sending the request.

System.Nullable<System.UInt64> beforeId

The audit log entry ID to get entries before.

System.Nullable<System.UInt64> userId

The user ID to filter entries for.

System.Nullable<ActionType> actionType

The type of actions to filter.

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<IAuditLogEntry>>

A task that represents the asynchronous get operation. The task result contains a read-only collection of the requested audit log entries.

| Improve this Doc View Source

IGuild.GetBanAsync(IUser, RequestOptions)

Gets a ban object for a banned user.

Declaration
Task<IBan> IGuild.GetBanAsync(IUser user, RequestOptions options)
Parameters
Type Name Description
IUser user

The banned user.

RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<IBan>

A task that represents the asynchronous get operation. The task result contains a ban object, which contains the user information and the reason for the ban; null if the ban entry cannot be found.

| Improve this Doc View Source

IGuild.GetBanAsync(UInt64, RequestOptions)

Gets a ban object for a banned user.

Declaration
Task<IBan> IGuild.GetBanAsync(ulong userId, RequestOptions options)
Parameters
Type Name Description
System.UInt64 userId

The snowflake identifier for the banned user.

RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<IBan>

A task that represents the asynchronous get operation. The task result contains a ban object, which contains the user information and the reason for the ban; null if the ban entry cannot be found.

| Improve this Doc View Source

IGuild.GetBansAsync(RequestOptions)

Gets a collection of all users banned in this guild.

Declaration
Task<IReadOnlyCollection<IBan>> IGuild.GetBansAsync(RequestOptions options)
Parameters
Type Name Description
RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<IBan>>

A task that represents the asynchronous get operation. The task result contains a read-only collection of ban objects that this guild currently possesses, with each object containing the user banned and reason behind the ban.

| Improve this Doc View Source

IGuild.GetCategoriesAsync(CacheMode, RequestOptions)

Gets a collection of all category channels in this guild.

Declaration
Task<IReadOnlyCollection<ICategoryChannel>> IGuild.GetCategoriesAsync(CacheMode mode, RequestOptions options)
Parameters
Type Name Description
CacheMode mode

The CacheMode that determines whether the object should be fetched from cache.

RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<ICategoryChannel>>

A task that represents the asynchronous get operation. The task result contains a read-only collection of category channels found within this guild.

| Improve this Doc View Source

IGuild.GetChannelAsync(UInt64, CacheMode, RequestOptions)

Gets a channel in this guild.

Declaration
Task<IGuildChannel> IGuild.GetChannelAsync(ulong id, CacheMode mode, RequestOptions options)
Parameters
Type Name Description
System.UInt64 id

The snowflake identifier for the channel.

CacheMode mode

The CacheMode that determines whether the object should be fetched from cache.

RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<IGuildChannel>

A task that represents the asynchronous get operation. The task result contains the generic channel associated with the specified id; null if none is found.

| Improve this Doc View Source

IGuild.GetChannelsAsync(CacheMode, RequestOptions)

Gets a collection of all channels in this guild.

Declaration
Task<IReadOnlyCollection<IGuildChannel>> IGuild.GetChannelsAsync(CacheMode mode, RequestOptions options)
Parameters
Type Name Description
CacheMode mode

The CacheMode that determines whether the object should be fetched from cache.

RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<IGuildChannel>>

A task that represents the asynchronous get operation. The task result contains a read-only collection of generic channels found within this guild.

| Improve this Doc View Source

IGuild.GetCurrentUserAsync(CacheMode, RequestOptions)

Gets the current user for this guild.

Declaration
Task<IGuildUser> IGuild.GetCurrentUserAsync(CacheMode mode, RequestOptions options)
Parameters
Type Name Description
CacheMode mode

The CacheMode that determines whether the object should be fetched from cache.

RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<IGuildUser>

A task that represents the asynchronous get operation. The task result contains the currently logged-in user within this guild.

| Improve this Doc View Source

IGuild.GetDefaultChannelAsync(CacheMode, RequestOptions)

Gets the first viewable text channel in this guild.

Declaration
Task<ITextChannel> IGuild.GetDefaultChannelAsync(CacheMode mode, RequestOptions options)
Parameters
Type Name Description
CacheMode mode

The CacheMode that determines whether the object should be fetched from cache.

RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<ITextChannel>

A task that represents the asynchronous get operation. The task result contains the first viewable text channel in this guild; null if none is found.

| Improve this Doc View Source

IGuild.GetEmbedChannelAsync(CacheMode, RequestOptions)

Gets the embed channel (i.e. the channel set in the guild's widget settings) in this guild.

Declaration
Task<IGuildChannel> IGuild.GetEmbedChannelAsync(CacheMode mode, RequestOptions options)
Parameters
Type Name Description
CacheMode mode

The CacheMode that determines whether the object should be fetched from cache.

RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<IGuildChannel>

A task that represents the asynchronous get operation. The task result contains the embed channel set within the server's widget settings; null if none is set.

| Improve this Doc View Source

IGuild.GetIntegrationsAsync(RequestOptions)

Declaration
Task<IReadOnlyCollection<IGuildIntegration>> IGuild.GetIntegrationsAsync(RequestOptions options)
Parameters
Type Name Description
RequestOptions options
Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<IGuildIntegration>>
| Improve this Doc View Source

IGuild.GetInvitesAsync(RequestOptions)

Gets a collection of all invites in this guild.

Declaration
Task<IReadOnlyCollection<IInviteMetadata>> IGuild.GetInvitesAsync(RequestOptions options)
Parameters
Type Name Description
RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<IInviteMetadata>>

A task that represents the asynchronous get operation. The task result contains a read-only collection of invite metadata, each representing information for an invite found within this guild.

| Improve this Doc View Source

IGuild.GetOwnerAsync(CacheMode, RequestOptions)

Gets the owner of this guild.

Declaration
Task<IGuildUser> IGuild.GetOwnerAsync(CacheMode mode, RequestOptions options)
Parameters
Type Name Description
CacheMode mode

The CacheMode that determines whether the object should be fetched from cache.

RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<IGuildUser>

A task that represents the asynchronous get operation. The task result contains the owner of this guild.

| Improve this Doc View Source

IGuild.GetRole(UInt64)

Gets a role in this guild.

Declaration
IRole IGuild.GetRole(ulong id)
Parameters
Type Name Description
System.UInt64 id

The snowflake identifier for the role.

Returns
Type Description
IRole

A role that is associated with the specified id; null if none is found.

| Improve this Doc View Source

IGuild.GetSystemChannelAsync(CacheMode, RequestOptions)

Gets the system channel where randomized welcome messages are sent in this guild.

Declaration
Task<ITextChannel> IGuild.GetSystemChannelAsync(CacheMode mode, RequestOptions options)
Parameters
Type Name Description
CacheMode mode

The CacheMode that determines whether the object should be fetched from cache.

RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<ITextChannel>

A task that represents the asynchronous get operation. The task result contains the text channel where randomized welcome messages will be sent to; null if none is set.

| Improve this Doc View Source

IGuild.GetTextChannelAsync(UInt64, CacheMode, RequestOptions)

Gets a text channel in this guild.

Declaration
Task<ITextChannel> IGuild.GetTextChannelAsync(ulong id, CacheMode mode, RequestOptions options)
Parameters
Type Name Description
System.UInt64 id

The snowflake identifier for the text channel.

CacheMode mode

The CacheMode that determines whether the object should be fetched from cache.

RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<ITextChannel>

A task that represents the asynchronous get operation. The task result contains the text channel associated with the specified id; null if none is found.

| Improve this Doc View Source

IGuild.GetTextChannelsAsync(CacheMode, RequestOptions)

Gets a collection of all text channels in this guild.

Declaration
Task<IReadOnlyCollection<ITextChannel>> IGuild.GetTextChannelsAsync(CacheMode mode, RequestOptions options)
Parameters
Type Name Description
CacheMode mode

The CacheMode that determines whether the object should be fetched from cache.

RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<ITextChannel>>

A task that represents the asynchronous get operation. The task result contains a read-only collection of message channels found within this guild.

| Improve this Doc View Source

IGuild.GetUserAsync(UInt64, CacheMode, RequestOptions)

Gets a user from this guild.

Declaration
Task<IGuildUser> IGuild.GetUserAsync(ulong id, CacheMode mode, RequestOptions options)
Parameters
Type Name Description
System.UInt64 id

The snowflake identifier of the user.

CacheMode mode

The CacheMode that determines whether the object should be fetched from cache.

RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<IGuildUser>

A task that represents the asynchronous get operation. The task result contains the guild user associated with the specified id; null if none is found.

Remarks

This method retrieves a user found within this guild.

note

This may return null in the WebSocket implementation due to incomplete user collection in large guilds.

| Improve this Doc View Source

IGuild.GetUsersAsync(CacheMode, RequestOptions)

Gets a collection of all users in this guild.

Declaration
Task<IReadOnlyCollection<IGuildUser>> IGuild.GetUsersAsync(CacheMode mode, RequestOptions options)
Parameters
Type Name Description
CacheMode mode

The CacheMode that determines whether the object should be fetched from cache.

RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<IGuildUser>>

A task that represents the asynchronous get operation. The task result contains a collection of guild users found within this guild.

Remarks

This method retrieves all users found within this guild.

note

This may return an incomplete collection in the WebSocket implementation due to how Discord does not send a complete user list for large guilds.

| Improve this Doc View Source

IGuild.GetVanityInviteAsync(RequestOptions)

Gets the vanity invite URL of this guild.

Declaration
Task<IInviteMetadata> IGuild.GetVanityInviteAsync(RequestOptions options)
Parameters
Type Name Description
RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<IInviteMetadata>

A task that represents the asynchronous get operation. The task result contains the partial metadata of the vanity invite found within this guild; null if none is found.

| Improve this Doc View Source

IGuild.GetVoiceChannelAsync(UInt64, CacheMode, RequestOptions)

Gets a voice channel in this guild.

Declaration
Task<IVoiceChannel> IGuild.GetVoiceChannelAsync(ulong id, CacheMode mode, RequestOptions options)
Parameters
Type Name Description
System.UInt64 id

The snowflake identifier for the voice channel.

CacheMode mode

The CacheMode that determines whether the object should be fetched from cache.

RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<IVoiceChannel>

A task that represents the asynchronous get operation. The task result contains the voice channel associated with the specified id; null if none is found.

| Improve this Doc View Source

IGuild.GetVoiceChannelsAsync(CacheMode, RequestOptions)

Gets a collection of all voice channels in this guild.

Declaration
Task<IReadOnlyCollection<IVoiceChannel>> IGuild.GetVoiceChannelsAsync(CacheMode mode, RequestOptions options)
Parameters
Type Name Description
CacheMode mode

The CacheMode that determines whether the object should be fetched from cache.

RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<IVoiceChannel>>

A task that represents the asynchronous get operation. The task result contains a read-only collection of voice channels found within this guild.

| Improve this Doc View Source

IGuild.GetVoiceRegionsAsync(RequestOptions)

Gets a collection of all the voice regions this guild can access.

Declaration
Task<IReadOnlyCollection<IVoiceRegion>> IGuild.GetVoiceRegionsAsync(RequestOptions options)
Parameters
Type Name Description
RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<IVoiceRegion>>

A task that represents the asynchronous get operation. The task result contains a read-only collection of voice regions the guild can access.

| Improve this Doc View Source

IGuild.GetWebhookAsync(UInt64, RequestOptions)

Gets a webhook found within this guild.

Declaration
Task<IWebhook> IGuild.GetWebhookAsync(ulong id, RequestOptions options)
Parameters
Type Name Description
System.UInt64 id

The identifier for the webhook.

RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<IWebhook>

A task that represents the asynchronous get operation. The task result contains the webhook with the specified id; null if none is found.

| Improve this Doc View Source

IGuild.GetWebhooksAsync(RequestOptions)

Gets a collection of all webhook from this guild.

Declaration
Task<IReadOnlyCollection<IWebhook>> IGuild.GetWebhooksAsync(RequestOptions options)
Parameters
Type Name Description
RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<IWebhook>>

A task that represents the asynchronous get operation. The task result contains a read-only collection of webhooks found within the guild.

| Improve this Doc View Source

IGuild.Roles

Gets a collection of all roles in this guild.

Declaration
IReadOnlyCollection<IRole> IGuild.Roles { get; }
Returns
Type Description
System.Collections.Generic.IReadOnlyCollection<IRole>

A read-only collection of roles found within this guild.

| Improve this Doc View Source

IGuild.SystemChannelId

Gets the ID of the channel where randomized welcome messages are sent.

Declaration
ulong? IGuild.SystemChannelId { get; }
Returns
Type Description
System.Nullable<System.UInt64>

A System.UInt64 representing the snowflake identifier of the system channel where randomized welcome messages are sent; null if none is set.

| Improve this Doc View Source

IDisposable.Dispose()

Declaration
void IDisposable.Dispose()

Implements

IGuild
IDeletable
ISnowflakeEntity
IEntity<TId>
System.IDisposable
  • Improve this Doc
  • View Source
Back to top Generated by DocFX