Skip to main content

Class SocketGuild

Represents a WebSocket-based guild object.

Assembly: Discord.Net.WebSocket.dll​
View Source​
Declaration
public class SocketGuild : SocketEntity<ulong>, IGuild, IDeletable, ISnowflakeEntity, IEntity<ulong>, IDisposable

Properties​

Name​

Gets the name of this guild.

View Source​
Declaration
public string Name { get; }

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.

View Source​
Declaration
public int AFKTimeout { get; }

IsWidgetEnabled​

Gets a value that indicates whether this guild has the widget enabled.

View Source​
Declaration
public bool IsWidgetEnabled { get; }

VerificationLevel​

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

View Source​
Declaration
public VerificationLevel VerificationLevel { get; }

MfaLevel​

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

View Source​
Declaration
public MfaLevel MfaLevel { get; }

DefaultMessageNotifications​

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

View Source​
Declaration
public DefaultMessageNotifications DefaultMessageNotifications { get; }

ExplicitContentFilter​

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

View Source​
Declaration
public ExplicitContentFilterLevel ExplicitContentFilter { get; }

MemberCount​

Gets the number of members.

View Source​
Declaration
public int MemberCount { get; }

DownloadedMemberCount​

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

View Source​
Declaration
public int DownloadedMemberCount { get; }

IsConnected​

Indicates whether the client is connected to this guild.

View Source​
Declaration
public bool IsConnected { get; }

ApplicationId​

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

View Source​
Declaration
public ulong? ApplicationId { get; }

OwnerId​

Gets the ID of the user that owns this guild.

View Source​
Declaration
public ulong OwnerId { get; }

Owner​

Gets the user that owns this guild.

View Source​
Declaration
public SocketGuildUser Owner { get; }

VoiceRegionId​

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

View Source​
Declaration
public string VoiceRegionId { get; }

IconId​

Gets the ID of this guild's icon.

View Source​
Declaration
public string IconId { get; }

SplashId​

Gets the ID of this guild's splash image.

View Source​
Declaration
public string SplashId { get; }

DiscoverySplashId​

Gets the ID of this guild's discovery splash image.

View Source​
Declaration
public string DiscoverySplashId { get; }

PremiumTier​

Gets the tier of guild boosting in this guild.

View Source​
Declaration
public PremiumTier PremiumTier { get; }

BannerId​

Gets the identifier for this guilds banner image.

View Source​
Declaration
public string BannerId { get; }

VanityURLCode​

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

View Source​
Declaration
public string VanityURLCode { get; }

SystemChannelFlags​

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

View Source​
Declaration
public SystemChannelMessageDeny SystemChannelFlags { get; }

Description​

Gets the description for the guild.

View Source​
Declaration
public string Description { get; }

PremiumSubscriptionCount​

Gets the number of premium subscribers of this guild.

View Source​
Declaration
public int PremiumSubscriptionCount { get; }

PreferredLocale​

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

View Source​
Declaration
public string PreferredLocale { get; }

MaxPresences​

Gets the maximum number of presences for the guild.

View Source​
Declaration
public int? MaxPresences { get; }

MaxMembers​

Gets the maximum number of members for the guild.

View Source​
Declaration
public int? MaxMembers { get; }

MaxVideoChannelUsers​

Gets the maximum amount of users in a video channel.

View Source​
Declaration
public int? MaxVideoChannelUsers { get; }

NsfwLevel​

Gets the NSFW level of this guild.

View Source​
Declaration
public NsfwLevel NsfwLevel { get; }

PreferredCulture​

Gets the preferred culture of this guild.

View Source​
Declaration
public CultureInfo PreferredCulture { get; }

IsBoostProgressBarEnabled​

Gets whether the guild has the boost progress bar enabled.

View Source​
Declaration
public bool IsBoostProgressBarEnabled { get; }

Features​

Gets the features for this guild.

View Source​
Declaration
public GuildFeatures Features { get; }

CreatedAt​

Gets when the snowflake was created.

View Source​
Declaration
public DateTimeOffset CreatedAt { get; }

IconUrl​

Gets the URL of this guild's icon.

View Source​
Declaration
public string IconUrl { get; }

SplashUrl​

Gets the URL of this guild's splash image.

View Source​
Declaration
public string SplashUrl { get; }

DiscoverySplashUrl​

Gets the URL of this guild's discovery splash image.

View Source​
Declaration
public string DiscoverySplashUrl { get; }

BannerUrl​

Gets the URL of this guild's banner image.

View Source​
Declaration
public string BannerUrl { get; }

HasAllMembers​

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

View Source​
Declaration
public bool HasAllMembers { get; }

IsSynced​

Indicates whether the guild cache is synced to this guild.

View Source​
Declaration
public bool IsSynced { get; }

SyncPromise​

View Source​
Declaration
public Task SyncPromise { get; }

DownloaderPromise​

View Source​
Declaration
public Task DownloaderPromise { get; }

AudioClient​

Gets the Discord.Audio.IAudioClient associated with this guild.

View Source​
Declaration
public IAudioClient AudioClient { get; }

DefaultChannel​

Gets the default channel in this guild.

View Source​
Declaration
public SocketTextChannel DefaultChannel { get; }

AFKChannel​

Gets the AFK voice channel in this guild.

View Source​
Declaration
public SocketVoiceChannel AFKChannel { get; }

MaxBitrate​

Gets the max bitrate for voice channels in this guild.

View Source​
Declaration
public int MaxBitrate { get; }

WidgetChannel​

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

View Source​
Declaration
public SocketGuildChannel WidgetChannel { get; }

SystemChannel​

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

View Source​
Declaration
public SocketTextChannel SystemChannel { get; }

RulesChannel​

Gets the channel with the guild rules.

View Source​
Declaration
public SocketTextChannel RulesChannel { get; }

PublicUpdatesChannel​

Gets the channel where admins and moderators of Community guilds receive notices from Discord.

View Source​
Declaration
public SocketTextChannel PublicUpdatesChannel { get; }

TextChannels​

Gets a collection of all text channels in this guild.

View Source​
Declaration
public IReadOnlyCollection<SocketTextChannel> TextChannels { get; }

VoiceChannels​

Gets a collection of all voice channels in this guild.

View Source​
Declaration
public IReadOnlyCollection<SocketVoiceChannel> VoiceChannels { get; }

StageChannels​

Gets a collection of all stage channels in this guild.

View Source​
Declaration
public IReadOnlyCollection<SocketStageChannel> StageChannels { get; }

CategoryChannels​

Gets a collection of all category channels in this guild.

View Source​
Declaration
public IReadOnlyCollection<SocketCategoryChannel> CategoryChannels { get; }

ThreadChannels​

Gets a collection of all thread channels in this guild.

View Source​
Declaration
public IReadOnlyCollection<SocketThreadChannel> ThreadChannels { get; }

CurrentUser​

Gets the current logged-in user.

View Source​
Declaration
public SocketGuildUser CurrentUser { get; }

EveryoneRole​

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

View Source​
Declaration
public SocketRole EveryoneRole { get; }

Channels​

Gets a collection of all channels in this guild.

View Source​
Declaration
public IReadOnlyCollection<SocketGuildChannel> Channels { get; }

Emotes​

Gets a collection of all custom emotes for this guild.

View Source​
Declaration
public IReadOnlyCollection<GuildEmote> Emotes { get; }

Stickers​

Gets a collection of all custom stickers for this guild.

View Source​
Declaration
public IReadOnlyCollection<SocketCustomSticker> Stickers { get; }

Users​

Gets a collection of users in this guild.

View Source​
Declaration
public IReadOnlyCollection<SocketGuildUser> Users { get; }

Roles​

Gets a collection of all roles in this guild.

View Source​
Declaration
public IReadOnlyCollection<SocketRole> Roles { get; }

Events​

Gets a collection of all events within this guild.

View Source​
Declaration
public IReadOnlyCollection<SocketGuildEvent> Events { get; }

IGuild.AFKChannelId​

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

View Source​
Declaration
ulong? IGuild.AFKChannelId { get; }

IGuild.AudioClient​

Gets the Discord.Audio.IAudioClient currently associated with this guild.

View Source​
Declaration
IAudioClient IGuild.AudioClient { get; }

IGuild.Available​

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

View Source​
Declaration
bool IGuild.Available { get; }

IGuild.WidgetChannelId​

Gets the ID of the channel assigned to the widget of this guild.

View Source​
Declaration
ulong? IGuild.WidgetChannelId { get; }

IGuild.SystemChannelId​

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

View Source​
Declaration
ulong? IGuild.SystemChannelId { get; }

IGuild.RulesChannelId​

Gets the ID of the channel with the rules.

View Source​
Declaration
ulong? IGuild.RulesChannelId { get; }

IGuild.PublicUpdatesChannelId​

Gets the ID of the channel where admins and moderators of Community guilds receive notices from Discord.

View Source​
Declaration
ulong? IGuild.PublicUpdatesChannelId { get; }

IGuild.EveryoneRole​

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

View Source​
Declaration
IRole IGuild.EveryoneRole { get; }

IGuild.Roles​

Gets a collection of all roles in this guild.

View Source​
Declaration
IReadOnlyCollection<IRole> IGuild.Roles { get; }

IGuild.ApproximateMemberCount​

Gets the approximate number of members in this guild.

View Source​
Declaration
int? IGuild.ApproximateMemberCount { get; }

IGuild.ApproximatePresenceCount​

Gets the approximate number of non-offline members in this guild.

View Source​
Declaration
int? IGuild.ApproximatePresenceCount { get; }

IGuild.Stickers​

Gets a collection of all custom stickers for this guild.

View Source​
Declaration
IReadOnlyCollection<ICustomSticker> IGuild.Stickers { get; }

Methods​

DeleteAsync(RequestOptions)​

Deletes this object and all its children.

View Source​
Declaration
public Task DeleteAsync(RequestOptions options = null)
Returns​

System.Threading.Tasks.Task

Parameters​
TypeNameDescription
Discord.RequestOptionsoptionsThe options to be used when sending the request.

ModifyAsync(Action<GuildProperties>, RequestOptions)​

Modifies this guild.

View Source​
Declaration
public Task ModifyAsync(Action<GuildProperties> func, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task: A task that represents the asynchronous modification operation.

Parameters​
TypeNameDescription
System.Action<Discord.GuildProperties>funcThe delegate containing the properties to modify the guild with.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

ModifyWidgetAsync(Action<GuildWidgetProperties>, RequestOptions)​

Modifies this guild's widget.

View Source​
Declaration
public Task ModifyWidgetAsync(Action<GuildWidgetProperties> func, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task: A task that represents the asynchronous modification operation.

Parameters​
TypeNameDescription
System.Action<Discord.GuildWidgetProperties>funcThe delegate containing the properties to modify the guild widget with.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

ReorderChannelsAsync(IEnumerable<ReorderChannelProperties>, RequestOptions)​

Bulk-modifies the order of channels in this guild.

View Source​
Declaration
public Task ReorderChannelsAsync(IEnumerable<ReorderChannelProperties> args, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task: A task that represents the asynchronous reorder operation.

Parameters​
TypeNameDescription
System.Collections.Generic.IEnumerable<Discord.ReorderChannelProperties>argsThe properties used to modify the channel positions with.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

ReorderRolesAsync(IEnumerable<ReorderRoleProperties>, RequestOptions)​

Bulk-modifies the order of roles in this guild.

View Source​
Declaration
public Task ReorderRolesAsync(IEnumerable<ReorderRoleProperties> args, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task: A task that represents the asynchronous reorder operation.

Parameters​
TypeNameDescription
System.Collections.Generic.IEnumerable<Discord.ReorderRoleProperties>argsThe properties used to modify the role positions with.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

LeaveAsync(RequestOptions)​

Leaves this guild.

View Source​
Declaration
public Task LeaveAsync(RequestOptions options = null)
Returns​

System.Threading.Tasks.Task: A task that represents the asynchronous leave operation.

Parameters​
TypeNameDescription
Discord.RequestOptionsoptionsThe options to be used when sending the request.

GetBansAsync(RequestOptions)​

Gets a collection of all users banned in this guild.

View Source​
Declaration
public Task<IReadOnlyCollection<RestBan>> GetBansAsync(RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.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.

Parameters​
TypeNameDescription
Discord.RequestOptionsoptionsThe options to be used when sending the request.

GetBanAsync(IUser, RequestOptions)​

Gets a ban object for a banned user.

View Source​
Declaration
public Task<RestBan> GetBanAsync(IUser user, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<Discord.Rest.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.

Parameters​
TypeNameDescription
Discord.IUseruserThe banned user.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

GetBanAsync(UInt64, RequestOptions)​

Gets a ban object for a banned user.

View Source​
Declaration
public Task<RestBan> GetBanAsync(ulong userId, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<Discord.Rest.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.

Parameters​
TypeNameDescription
System.UInt64userIdThe snowflake identifier for the banned user.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

AddBanAsync(IUser, Int32, String, RequestOptions)​

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

View Source​
Declaration
public Task AddBanAsync(IUser user, int pruneDays = 0, string reason = null, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task: A task that represents the asynchronous add operation for the ban.

Parameters​
TypeNameDescription
Discord.IUseruserThe user to ban.
System.Int32pruneDaysThe number of days to remove messages from this user for, and this number must be between [0, 7].
System.StringreasonThe reason of the ban to be written in the audit log.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

AddBanAsync(UInt64, Int32, String, RequestOptions)​

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

View Source​
Declaration
public Task AddBanAsync(ulong userId, int pruneDays = 0, string reason = null, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task: A task that represents the asynchronous add operation for the ban.

Parameters​
TypeNameDescription
System.UInt64userIdThe snowflake ID of the user to ban.
System.Int32pruneDaysThe number of days to remove messages from this user for, and this number must be between [0, 7].
System.StringreasonThe reason of the ban to be written in the audit log.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

RemoveBanAsync(IUser, RequestOptions)​

Unbans the user if they are currently banned.

View Source​
Declaration
public Task RemoveBanAsync(IUser user, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task: A task that represents the asynchronous removal operation for the ban.

Parameters​
TypeNameDescription
Discord.IUseruserThe user to be unbanned.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

RemoveBanAsync(UInt64, RequestOptions)​

Unbans the user if they are currently banned.

View Source​
Declaration
public Task RemoveBanAsync(ulong userId, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task: A task that represents the asynchronous removal operation for the ban.

Parameters​
TypeNameDescription
System.UInt64userIdThe snowflake identifier of the user to be unbanned.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

GetChannel(UInt64)​

Gets a channel in this guild.

View Source​
Declaration
public SocketGuildChannel GetChannel(ulong id)
Returns​

Discord.WebSocket.SocketGuildChannel: A generic channel associated with the specified <code data-dev-comment-type="paramref" class="paramref">id</code>; null if none is found.

Parameters​
TypeNameDescription
System.UInt64idThe snowflake identifier for the channel.

GetTextChannel(UInt64)​

Gets a text channel in this guild.

View Source​
Declaration
public SocketTextChannel GetTextChannel(ulong id)
Returns​

Discord.WebSocket.SocketTextChannel: A text channel associated with the specified <code data-dev-comment-type="paramref" class="paramref">id</code>; null if none is found.

Parameters​
TypeNameDescription
System.UInt64idThe snowflake identifier for the text channel.

GetThreadChannel(UInt64)​

Gets a thread in this guild.

View Source​
Declaration
public SocketThreadChannel GetThreadChannel(ulong id)
Returns​

Discord.WebSocket.SocketThreadChannel: A thread channel associated with the specified <code data-dev-comment-type="paramref" class="paramref">id</code>; null if none is found.

Parameters​
TypeNameDescription
System.UInt64idThe snowflake identifier for the thread.

GetVoiceChannel(UInt64)​

Gets a voice channel in this guild.

View Source​
Declaration
public SocketVoiceChannel GetVoiceChannel(ulong id)
Returns​

Discord.WebSocket.SocketVoiceChannel: A voice channel associated with the specified <code data-dev-comment-type="paramref" class="paramref">id</code>; null if none is found.

Parameters​
TypeNameDescription
System.UInt64idThe snowflake identifier for the voice channel.

GetStageChannel(UInt64)​

Gets a stage channel in this guild.

View Source​
Declaration
public SocketStageChannel GetStageChannel(ulong id)
Returns​

Discord.WebSocket.SocketStageChannel: A stage channel associated with the specified <code data-dev-comment-type="paramref" class="paramref">id</code>; null if none is found.

Parameters​
TypeNameDescription
System.UInt64idThe snowflake identifier for the stage channel.

GetCategoryChannel(UInt64)​

Gets a category channel in this guild.

View Source​
Declaration
public SocketCategoryChannel GetCategoryChannel(ulong id)
Returns​

Discord.WebSocket.SocketCategoryChannel: A category channel associated with the specified <code data-dev-comment-type="paramref" class="paramref">id</code>; null if none is found.

Parameters​
TypeNameDescription
System.UInt64idThe snowflake identifier for the category channel.

CreateTextChannelAsync(String, Action<TextChannelProperties>, RequestOptions)​

Creates a new text channel in this guild.

View Source​
Declaration
public Task<RestTextChannel> CreateTextChannelAsync(string name, Action<TextChannelProperties> func = null, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<Discord.Rest.RestTextChannel>: A task that represents the asynchronous creation operation. The task result contains the newly created text channel.

Parameters​
TypeNameDescription
System.StringnameThe new name for the text channel.
System.Action<Discord.TextChannelProperties>funcThe delegate containing the properties to be applied to the channel upon its creation.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

CreateVoiceChannelAsync(String, Action<VoiceChannelProperties>, RequestOptions)​

Creates a new voice channel in this guild.

View Source​
Declaration
public Task<RestVoiceChannel> CreateVoiceChannelAsync(string name, Action<VoiceChannelProperties> func = null, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<Discord.Rest.RestVoiceChannel>: A task that represents the asynchronous creation operation. The task result contains the newly created voice channel.

Parameters​
TypeNameDescription
System.StringnameThe new name for the voice channel.
System.Action<Discord.VoiceChannelProperties>funcThe delegate containing the properties to be applied to the channel upon its creation.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

CreateStageChannelAsync(String, Action<VoiceChannelProperties>, RequestOptions)​

Creates a new stage channel in this guild.

View Source​
Declaration
public Task<RestStageChannel> CreateStageChannelAsync(string name, Action<VoiceChannelProperties> func = null, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<Discord.Rest.RestStageChannel>: A task that represents the asynchronous creation operation. The task result contains the newly created stage channel.

Parameters​
TypeNameDescription
System.StringnameThe new name for the stage channel.
System.Action<Discord.VoiceChannelProperties>funcThe delegate containing the properties to be applied to the channel upon its creation.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

CreateCategoryChannelAsync(String, Action<GuildChannelProperties>, RequestOptions)​

Creates a new channel category in this guild.

View Source​
Declaration
public Task<RestCategoryChannel> CreateCategoryChannelAsync(string name, Action<GuildChannelProperties> func = null, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<Discord.Rest.RestCategoryChannel>: A task that represents the asynchronous creation operation. The task result contains the newly created category channel.

Parameters​
TypeNameDescription
System.StringnameThe new name for the category.
System.Action<Discord.GuildChannelProperties>funcThe delegate containing the properties to be applied to the channel upon its creation.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

GetVoiceRegionsAsync(RequestOptions)​

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

View Source​
Declaration
public Task<IReadOnlyCollection<RestVoiceRegion>> GetVoiceRegionsAsync(RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.RestVoiceRegion>>: A task that represents the asynchronous get operation. The task result contains a read-only collection of voice regions the guild can access.

Parameters​
TypeNameDescription
Discord.RequestOptionsoptionsThe options to be used when sending the request.

GetIntegrationsAsync(RequestOptions)​

View Source​
Declaration
public Task<IReadOnlyCollection<RestGuildIntegration>> GetIntegrationsAsync(RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.RestGuildIntegration>>

Parameters​
TypeName
Discord.RequestOptionsoptions

CreateIntegrationAsync(UInt64, String, RequestOptions)​

View Source​
Declaration
public Task<RestGuildIntegration> CreateIntegrationAsync(ulong id, string type, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<Discord.Rest.RestGuildIntegration>

Parameters​
TypeName
System.UInt64id
System.Stringtype
Discord.RequestOptionsoptions

DeleteApplicationCommandsAsync(RequestOptions)​

Deletes all application commands in the current guild.

View Source​
Declaration
public Task DeleteApplicationCommandsAsync(RequestOptions options = null)
Returns​

System.Threading.Tasks.Task: A task that represents the asynchronous delete operation.

Parameters​
TypeNameDescription
Discord.RequestOptionsoptionsThe options to be used when sending the request.

GetApplicationCommandsAsync(RequestOptions)​

Gets a collection of slash commands created by the current user in this guild.

View Source​
Declaration
public async Task<IReadOnlyCollection<SocketApplicationCommand>> GetApplicationCommandsAsync(RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.WebSocket.SocketApplicationCommand>>: A task that represents the asynchronous get operation. The task result contains a read-only collection of slash commands created by the current user.

Parameters​
TypeNameDescription
Discord.RequestOptionsoptionsThe options to be used when sending the request.

GetApplicationCommandAsync(UInt64, CacheMode, RequestOptions)​

Gets an application command within this guild with the specified id.

View Source​
Declaration
public async ValueTask<SocketApplicationCommand> GetApplicationCommandAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)
Returns​

System.Threading.Tasks.ValueTask<Discord.WebSocket.SocketApplicationCommand>: A ValueTask that represents the asynchronous get operation. The task result contains a Discord.IApplicationCommand if found, otherwise null.

Parameters​
TypeNameDescription
System.UInt64idThe id of the application command to get.
Discord.CacheModemodeThe Discord.CacheMode that determines whether the object should be fetched from cache.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

CreateApplicationCommandAsync(ApplicationCommandProperties, RequestOptions)​

Creates an application command within this guild.

View Source​
Declaration
public async Task<SocketApplicationCommand> CreateApplicationCommandAsync(ApplicationCommandProperties properties, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<Discord.WebSocket.SocketApplicationCommand>: A task that represents the asynchronous creation operation. The task result contains the command that was created.

Parameters​
TypeNameDescription
Discord.ApplicationCommandPropertiespropertiesThe properties to use when creating the command.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

BulkOverwriteApplicationCommandAsync(ApplicationCommandProperties[], RequestOptions)​

Overwrites the application commands within this guild.

View Source​
Declaration
public async Task<IReadOnlyCollection<SocketApplicationCommand>> BulkOverwriteApplicationCommandAsync(ApplicationCommandProperties[] properties, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.WebSocket.SocketApplicationCommand>>: A task that represents the asynchronous creation operation. The task result contains a collection of commands that was created.

Parameters​
TypeNameDescription
Discord.ApplicationCommandProperties[]propertiesA collection of properties to use when creating the commands.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

GetInvitesAsync(RequestOptions)​

Gets a collection of all invites in this guild.

View Source​
Declaration
public Task<IReadOnlyCollection<RestInviteMetadata>> GetInvitesAsync(RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.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.

Parameters​
TypeNameDescription
Discord.RequestOptionsoptionsThe options to be used when sending the request.

GetVanityInviteAsync(RequestOptions)​

Gets the vanity invite URL of this guild.

View Source​
Declaration
public Task<RestInviteMetadata> GetVanityInviteAsync(RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<Discord.Rest.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.

Parameters​
TypeNameDescription
Discord.RequestOptionsoptionsThe options to be used when sending the request.

GetRole(UInt64)​

Gets a role in this guild.

View Source​
Declaration
public SocketRole GetRole(ulong id)
Returns​

Discord.WebSocket.SocketRole: A role that is associated with the specified <code data-dev-comment-type="paramref" class="paramref">id</code>; null if none is found.

Parameters​
TypeNameDescription
System.UInt64idThe snowflake identifier for the role.

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

View Source​
Declaration
public Task<RestRole> CreateRoleAsync(string name, GuildPermissions? permissions = null, Color? color = null, bool isHoisted = false, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<Discord.Rest.RestRole>

Parameters​
TypeName
System.Stringname
System.Nullable<Discord.GuildPermissions>permissions
System.Nullable<Discord.Color>color
System.BooleanisHoisted
Discord.RequestOptionsoptions

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

Creates a new role with the provided name.

View Source​
Declaration
public Task<RestRole> CreateRoleAsync(string name, GuildPermissions? permissions = null, Color? color = null, bool isHoisted = false, bool isMentionable = false, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<Discord.Rest.RestRole>: A task that represents the asynchronous creation operation. The task result contains the newly created role.

Parameters​
TypeNameDescription
System.StringnameThe new name for the role.
System.Nullable<Discord.GuildPermissions>permissionsThe guild permission that the role should possess.
System.Nullable<Discord.Color>colorThe color of the role.
System.BooleanisHoistedWhether the role is separated from others on the sidebar.
System.BooleanisMentionableWhether the role can be mentioned.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

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

View Source​
Declaration
public Task<RestGuildUser> AddGuildUserAsync(ulong id, string accessToken, Action<AddGuildUserProperties> func = null, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<Discord.Rest.RestGuildUser>

Parameters​
TypeName
System.UInt64id
System.StringaccessToken
System.Action<Discord.AddGuildUserProperties>func
Discord.RequestOptionsoptions

GetUser(UInt64)​

Gets a user from this guild.

View Source​
Declaration
public SocketGuildUser GetUser(ulong id)
Returns​

Discord.WebSocket.SocketGuildUser: A guild user associated with the specified <code data-dev-comment-type="paramref" class="paramref">id</code>; null if none is found.

Parameters​
TypeNameDescription
System.UInt64idThe snowflake identifier of the user.

PruneUsersAsync(Int32, Boolean, RequestOptions, IEnumerable<UInt64>)​

Prunes inactive users.

View Source​
Declaration
public Task<int> PruneUsersAsync(int days = 30, bool simulate = false, RequestOptions options = null, IEnumerable<ulong> includeRoleIds = null)
Returns​

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.

Parameters​
TypeNameDescription
System.Int32daysThe number of days required for the users to be kicked.
System.BooleansimulateWhether this prune action is a simulation.
Discord.RequestOptionsoptionsThe options to be used when sending the request.
System.Collections.Generic.IEnumerable<System.UInt64>includeRoleIdsAn array of role IDs to be included in the prune of users who do not have any additional roles.

PurgeUserCache()​

Purges this guild's user cache.

View Source​
Declaration
public void PurgeUserCache()

PurgeUserCache(Func<SocketGuildUser, Boolean>)​

Purges this guild's user cache.

View Source​
Declaration
public void PurgeUserCache(Func<SocketGuildUser, bool> predicate)
Parameters​
TypeNameDescription
System.Func<Discord.WebSocket.SocketGuildUser,System.Boolean>predicateThe predicate used to select which users to clear.

GetUsersAsync(RequestOptions)​

Gets a collection of all users in this guild.

View Source​
Declaration
public IAsyncEnumerable<IReadOnlyCollection<IGuildUser>> GetUsersAsync(RequestOptions options = null)
Returns​

System.Collections.Generic.IAsyncEnumerable<System.Collections.Generic.IReadOnlyCollection<Discord.IGuildUser>>: A task that represents the asynchronous get operation. The task result contains a collection of guild users found within this guild.

Parameters​
TypeNameDescription
Discord.RequestOptionsoptionsThe options to be used when sending the request.

DownloadUsersAsync()​

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

View Source​
Declaration
public async Task DownloadUsersAsync()
Returns​

System.Threading.Tasks.Task: A task that represents the asynchronous download operation.

SearchUsersAsync(String, Int32, RequestOptions)​

Gets a collection of users in this guild that the name or nickname starts with the provided System.String at <code data-dev-comment-type="paramref" class="paramref">query</code>.

View Source​
Declaration
public Task<IReadOnlyCollection<RestGuildUser>> SearchUsersAsync(string query, int limit = 1000, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.RestGuildUser>>: A task that represents the asynchronous get operation. The task result contains a collection of guild users that the name or nickname starts with the provided System.String at <code data-dev-comment-type="paramref" class="paramref">query</code>.

Parameters​
TypeNameDescription
System.StringqueryThe partial name or nickname to search.
System.Int32limitThe maximum number of users to be gotten.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

GetEvent(UInt64)​

Gets an event in this guild.

View Source​
Declaration
public SocketGuildEvent GetEvent(ulong id)
Returns​

Discord.WebSocket.SocketGuildEvent: An event that is associated with the specified <code data-dev-comment-type="paramref" class="paramref">id</code>; null if none is found.

Parameters​
TypeNameDescription
System.UInt64idThe snowflake identifier for the event.

GetEventAsync(UInt64, RequestOptions)​

Gets an event within this guild.

View Source​
Declaration
public Task<RestGuildEvent> GetEventAsync(ulong id, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<Discord.Rest.RestGuildEvent>: A task that represents the asynchronous get operation.

Parameters​
TypeNameDescription
System.UInt64idThe snowflake identifier for the event.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

GetEventsAsync(RequestOptions)​

Gets all active events within this guild.

View Source​
Declaration
public Task<IReadOnlyCollection<RestGuildEvent>> GetEventsAsync(RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.RestGuildEvent>>: A task that represents the asynchronous get operation.

Parameters​
TypeNameDescription
Discord.RequestOptionsoptionsThe options to be used when sending the request.

CreateEventAsync(String, DateTimeOffset, GuildScheduledEventType, GuildScheduledEventPrivacyLevel, String, Nullable<DateTimeOffset>, Nullable<UInt64>, String, RequestOptions)​

Creates an event within this guild.

View Source​
Declaration
public Task<RestGuildEvent> CreateEventAsync(string name, DateTimeOffset startTime, GuildScheduledEventType type, GuildScheduledEventPrivacyLevel privacyLevel = GuildScheduledEventPrivacyLevel.Private, string description = null, DateTimeOffset? endTime = null, ulong? channelId = null, string location = null, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<Discord.Rest.RestGuildEvent>: A task that represents the asynchronous create operation.

Parameters​
TypeNameDescription
System.StringnameThe name of the event.
System.DateTimeOffsetstartTimeThe start time of the event.
Discord.GuildScheduledEventTypetypeThe type of the event.
Discord.GuildScheduledEventPrivacyLevelprivacyLevelThe privacy level of the event.
System.StringdescriptionThe description of the event.
System.Nullable<System.DateTimeOffset>endTimeThe end time of the event.
System.Nullable<System.UInt64>channelId

The channel id of the event. <remarks> The event must have a type of Discord.GuildScheduledEventType.Stage or Discord.GuildScheduledEventType.Voice in order to use this property. </remarks> | | System.String | location | The location of the event; links are supported | | Discord.RequestOptions | options | The options to be used when sending the request. |

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

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

View Source​
Declaration
public IAsyncEnumerable<IReadOnlyCollection<RestAuditLogEntry>> GetAuditLogsAsync(int limit, RequestOptions options = null, ulong? beforeId = null, ulong? userId = null, ActionType? actionType = null)
Returns​

System.Collections.Generic.IAsyncEnumerable<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.RestAuditLogEntry>>: A task that represents the asynchronous get operation. The task result contains a read-only collection of the requested audit log entries.

Parameters​
TypeNameDescription
System.Int32limitThe number of audit log entries to fetch.
Discord.RequestOptionsoptionsThe options to be used when sending the request.
System.Nullable<System.UInt64>beforeIdThe audit log entry ID to filter entries before.
System.Nullable<System.UInt64>userIdThe user ID to filter entries for.
System.Nullable<Discord.ActionType>actionTypeThe type of actions to filter.

GetWebhookAsync(UInt64, RequestOptions)​

Gets a webhook found within this guild.

View Source​
Declaration
public Task<RestWebhook> GetWebhookAsync(ulong id, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<Discord.Rest.RestWebhook>: A task that represents the asynchronous get operation. The task result contains the webhook with the specified <code data-dev-comment-type="paramref" class="paramref">id</code>; null if none is found.

Parameters​
TypeNameDescription
System.UInt64idThe identifier for the webhook.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

GetWebhooksAsync(RequestOptions)​

Gets a collection of all webhook from this guild.

View Source​
Declaration
public Task<IReadOnlyCollection<RestWebhook>> GetWebhooksAsync(RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.RestWebhook>>: A task that represents the asynchronous get operation. The task result contains a read-only collection of webhooks found within the guild.

Parameters​
TypeNameDescription
Discord.RequestOptionsoptionsThe options to be used when sending the request.

GetEmotesAsync(RequestOptions)​

Gets a collection of emotes from this guild.

View Source​
Declaration
public Task<IReadOnlyCollection<GuildEmote>> GetEmotesAsync(RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.GuildEmote>>: A task that represents the asynchronous get operation. The task result contains a read-only collection of emotes found within the guild.

Parameters​
TypeNameDescription
Discord.RequestOptionsoptionsThe options to be used when sending the request.

GetEmoteAsync(UInt64, RequestOptions)​

Gets a specific emote from this guild.

View Source​
Declaration
public Task<GuildEmote> GetEmoteAsync(ulong id, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<Discord.GuildEmote>: A task that represents the asynchronous get operation. The task result contains the emote found with the specified <code data-dev-comment-type="paramref" class="paramref">id</code>; null if none is found.

Parameters​
TypeNameDescription
System.UInt64idThe snowflake identifier for the guild emote.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

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

Creates a new Discord.GuildEmote in this guild.

View Source​
Declaration
public Task<GuildEmote> CreateEmoteAsync(string name, Image image, Optional<IEnumerable<IRole>> roles = default(Optional<IEnumerable<IRole>>), RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<Discord.GuildEmote>: A task that represents the asynchronous creation operation. The task result contains the created emote.

Parameters​
TypeNameDescription
System.StringnameThe name of the guild emote.
Discord.ImageimageThe image of the new emote.
Discord.Optional<T>rolesThe roles to limit the emote usage to.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

ModifyEmoteAsync(GuildEmote, Action<EmoteProperties>, RequestOptions)​

Modifies an existing Discord.GuildEmote in this guild.

View Source​
Declaration
public Task<GuildEmote> ModifyEmoteAsync(GuildEmote emote, Action<EmoteProperties> func, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<Discord.GuildEmote>: A task that represents the asynchronous modification operation. The task result contains the modified emote.

Parameters​
TypeNameDescription
Discord.GuildEmoteemoteThe emote to be modified.
System.Action<Discord.EmoteProperties>funcThe delegate containing the properties to modify the emote with.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

DeleteEmoteAsync(GuildEmote, RequestOptions)​

Deletes an existing Discord.GuildEmote from this guild.

View Source​
Declaration
public Task DeleteEmoteAsync(GuildEmote emote, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task: A task that represents the asynchronous removal operation.

Parameters​
TypeNameDescription
Discord.GuildEmoteemoteThe emote to delete.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

MoveAsync(IGuildUser, IVoiceChannel)​

Moves the user to the voice channel.

View Source​
Declaration
public Task MoveAsync(IGuildUser user, IVoiceChannel targetChannel)
Returns​

System.Threading.Tasks.Task: A task that represents the asynchronous operation for moving a user.

Parameters​
TypeNameDescription
Discord.IGuildUseruserThe user to move.
Discord.IVoiceChanneltargetChannelthe channel where the user gets moved to.

IGuild.DisconnectAsync(IGuildUser)​

Disconnects the user from its current voice channel

View Source​
Declaration
async Task IGuild.DisconnectAsync(IGuildUser user)
Returns​

System.Threading.Tasks.Task: A task that represents the asynchronous operation for disconnecting a user.

Parameters​
TypeNameDescription
Discord.IGuildUseruserThe user to disconnect.

GetStickerAsync(UInt64, CacheMode, RequestOptions)​

Gets a specific sticker within this guild.

View Source​
Declaration
public async ValueTask<SocketCustomSticker> GetStickerAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)
Returns​

System.Threading.Tasks.ValueTask<Discord.WebSocket.SocketCustomSticker>: A task that represents the asynchronous get operation. The task result contains the sticker found with the specified <code data-dev-comment-type="paramref" class="paramref">id</code>; null if none is found.

Parameters​
TypeNameDescription
System.UInt64idThe id of the sticker to get.
Discord.CacheModemodeThe Discord.CacheMode that determines whether the object should be fetched from cache.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

GetSticker(UInt64)​

Gets a specific sticker within this guild.

View Source​
Declaration
public SocketCustomSticker GetSticker(ulong id)
Returns​

Discord.WebSocket.SocketCustomSticker: A sticker, if none is found then null.

Parameters​
TypeNameDescription
System.UInt64idThe id of the sticker to get.

GetStickersAsync(CacheMode, RequestOptions)​

Gets a collection of all stickers within this guild.

View Source​
Declaration
public async ValueTask<IReadOnlyCollection<SocketCustomSticker>> GetStickersAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)
Returns​

System.Threading.Tasks.ValueTask<System.Collections.Generic.IReadOnlyCollection<Discord.WebSocket.SocketCustomSticker>>: A task that represents the asynchronous get operation. The task result contains a read-only collection of stickers found within the guild.

Parameters​
TypeNameDescription
Discord.CacheModemodeThe Discord.CacheMode that determines whether the object should be fetched from cache.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

CreateStickerAsync(String, String, IEnumerable<String>, Image, RequestOptions)​

Creates a new sticker in this guild.

View Source​
Declaration
public async Task<SocketCustomSticker> CreateStickerAsync(string name, string description, IEnumerable<string> tags, Image image, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<Discord.WebSocket.SocketCustomSticker>: A task that represents the asynchronous creation operation. The task result contains the created sticker.

Parameters​
TypeNameDescription
System.StringnameThe name of the sticker.
System.StringdescriptionThe description of the sticker.
System.Collections.Generic.IEnumerable<System.String>tagsThe tags of the sticker.
Discord.ImageimageThe image of the new emote.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

CreateStickerAsync(String, String, IEnumerable<String>, String, RequestOptions)​

Creates a new sticker in this guild

View Source​
Declaration
public Task<SocketCustomSticker> CreateStickerAsync(string name, string description, IEnumerable<string> tags, string path, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<Discord.WebSocket.SocketCustomSticker>: A task that represents the asynchronous creation operation. The task result contains the created sticker.

Parameters​
TypeNameDescription
System.StringnameThe name of the sticker.
System.StringdescriptionThe description of the sticker.
System.Collections.Generic.IEnumerable<System.String>tagsThe tags of the sticker.
System.StringpathThe path of the file to upload.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

CreateStickerAsync(String, String, IEnumerable<String>, Stream, String, RequestOptions)​

Creates a new sticker in this guild

View Source​
Declaration
public async Task<SocketCustomSticker> CreateStickerAsync(string name, string description, IEnumerable<string> tags, Stream stream, string filename, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<Discord.WebSocket.SocketCustomSticker>: A task that represents the asynchronous creation operation. The task result contains the created sticker.

Parameters​
TypeNameDescription
System.StringnameThe name of the sticker.
System.StringdescriptionThe description of the sticker.
System.Collections.Generic.IEnumerable<System.String>tagsThe tags of the sticker.
System.IO.StreamstreamThe stream containing the file data.
System.StringfilenameThe name of the file <strong>with</strong> the extension, ex: image.png.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

DeleteStickerAsync(SocketCustomSticker, RequestOptions)​

Deletes a sticker within this guild.

View Source​
Declaration
public Task DeleteStickerAsync(SocketCustomSticker sticker, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task: A task that represents the asynchronous removal operation.

Parameters​
TypeNameDescription
Discord.WebSocket.SocketCustomStickerstickerThe sticker to delete.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

ToString()​

Gets the name of the guild.

View Source​
Declaration
public override string ToString()
Returns​

System.String: A string that resolves to Discord.WebSocket.SocketGuild.Name.

IGuild.CreateEventAsync(String, DateTimeOffset, GuildScheduledEventType, GuildScheduledEventPrivacyLevel, String, Nullable<DateTimeOffset>, Nullable<UInt64>, String, RequestOptions)​

Creates an event within this guild.

View Source​
Declaration
async Task<IGuildScheduledEvent> IGuild.CreateEventAsync(string name, DateTimeOffset startTime, GuildScheduledEventType type, GuildScheduledEventPrivacyLevel privacyLevel, string description, DateTimeOffset? endTime, ulong? channelId, string location, RequestOptions options)
Returns​

System.Threading.Tasks.Task<Discord.IGuildScheduledEvent>: A task that represents the asynchronous create operation.

Parameters​
TypeNameDescription
System.StringnameThe name of the event.
System.DateTimeOffsetstartTimeThe start time of the event.
Discord.GuildScheduledEventTypetypeThe type of the event.
Discord.GuildScheduledEventPrivacyLevelprivacyLevelThe privacy level of the event.
System.StringdescriptionThe description of the event.
System.Nullable<System.DateTimeOffset>endTimeThe end time of the event.
System.Nullable<System.UInt64>channelId

The channel id of the event. <remarks> The event must have a type of Discord.GuildScheduledEventType.Stage or Discord.GuildScheduledEventType.Voice in order to use this property. </remarks> | | System.String | location | The location of the event; links are supported | | Discord.RequestOptions | options | The options to be used when sending the request. |

IGuild.GetEventAsync(UInt64, RequestOptions)​

Gets a event within this guild.

View Source​
Declaration
async Task<IGuildScheduledEvent> IGuild.GetEventAsync(ulong id, RequestOptions options)
Returns​

System.Threading.Tasks.Task<Discord.IGuildScheduledEvent>: A task that represents the asynchronous get operation.

Parameters​
TypeNameDescription
System.UInt64idThe id of the event.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IGuild.GetEventsAsync(RequestOptions)​

Gets a collection of events within this guild.

View Source​
Declaration
async Task<IReadOnlyCollection<IGuildScheduledEvent>> IGuild.GetEventsAsync(RequestOptions options)
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.IGuildScheduledEvent>>: A task that represents the asynchronous get operation.

Parameters​
TypeNameDescription
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IGuild.GetBansAsync(RequestOptions)​

Gets a collection of all users banned in this guild.

View Source​
Declaration
async Task<IReadOnlyCollection<IBan>> IGuild.GetBansAsync(RequestOptions options)
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.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.

Parameters​
TypeNameDescription
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IGuild.GetBanAsync(IUser, RequestOptions)​

Gets a ban object for a banned user.

View Source​
Declaration
async Task<IBan> IGuild.GetBanAsync(IUser user, RequestOptions options)
Returns​

System.Threading.Tasks.Task<Discord.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.

Parameters​
TypeNameDescription
Discord.IUseruserThe banned user.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IGuild.GetBanAsync(UInt64, RequestOptions)​

Gets a ban object for a banned user.

View Source​
Declaration
async Task<IBan> IGuild.GetBanAsync(ulong userId, RequestOptions options)
Returns​

System.Threading.Tasks.Task<Discord.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.

Parameters​
TypeNameDescription
System.UInt64userIdThe snowflake identifier for the banned user.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IGuild.GetChannelsAsync(CacheMode, RequestOptions)​

Gets a collection of all channels in this guild.

View Source​
Declaration
Task<IReadOnlyCollection<IGuildChannel>> IGuild.GetChannelsAsync(CacheMode mode, RequestOptions options)
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.IGuildChannel>>: A task that represents the asynchronous get operation. The task result contains a read-only collection of generic channels found within this guild.

Parameters​
TypeNameDescription
Discord.CacheModemodeThe Discord.CacheMode that determines whether the object should be fetched from cache.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IGuild.GetChannelAsync(UInt64, CacheMode, RequestOptions)​

Gets a channel in this guild.

View Source​
Declaration
Task<IGuildChannel> IGuild.GetChannelAsync(ulong id, CacheMode mode, RequestOptions options)
Returns​

System.Threading.Tasks.Task<Discord.IGuildChannel>: A task that represents the asynchronous get operation. The task result contains the generic channel associated with the specified <code data-dev-comment-type="paramref" class="paramref">id</code>; null if none is found.

Parameters​
TypeNameDescription
System.UInt64idThe snowflake identifier for the channel.
Discord.CacheModemodeThe Discord.CacheMode that determines whether the object should be fetched from cache.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IGuild.GetTextChannelsAsync(CacheMode, RequestOptions)​

Gets a collection of all text channels in this guild.

View Source​
Declaration
Task<IReadOnlyCollection<ITextChannel>> IGuild.GetTextChannelsAsync(CacheMode mode, RequestOptions options)
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.ITextChannel>>: A task that represents the asynchronous get operation. The task result contains a read-only collection of message channels found within this guild.

Parameters​
TypeNameDescription
Discord.CacheModemodeThe Discord.CacheMode that determines whether the object should be fetched from cache.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IGuild.GetTextChannelAsync(UInt64, CacheMode, RequestOptions)​

Gets a text channel in this guild.

View Source​
Declaration
Task<ITextChannel> IGuild.GetTextChannelAsync(ulong id, CacheMode mode, RequestOptions options)
Returns​

System.Threading.Tasks.Task<Discord.ITextChannel>: A task that represents the asynchronous get operation. The task result contains the text channel associated with the specified <code data-dev-comment-type="paramref" class="paramref">id</code>; null if none is found.

Parameters​
TypeNameDescription
System.UInt64idThe snowflake identifier for the text channel.
Discord.CacheModemodeThe Discord.CacheMode that determines whether the object should be fetched from cache.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IGuild.GetThreadChannelAsync(UInt64, CacheMode, RequestOptions)​

Gets a thread channel within this guild.

View Source​
Declaration
Task<IThreadChannel> IGuild.GetThreadChannelAsync(ulong id, CacheMode mode, RequestOptions options)
Returns​

System.Threading.Tasks.Task<Discord.IThreadChannel>: A task that represents the asynchronous get operation. The task result contains the thread channel.

Parameters​
TypeNameDescription
System.UInt64idThe id of the thread channel.
Discord.CacheModemodeThe Discord.CacheMode that determines whether the object should be fetched from cache.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IGuild.GetThreadChannelsAsync(CacheMode, RequestOptions)​

Gets a collection of all thread channels in this guild.

View Source​
Declaration
Task<IReadOnlyCollection<IThreadChannel>> IGuild.GetThreadChannelsAsync(CacheMode mode, RequestOptions options)
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.IThreadChannel>>: A task that represents the asynchronous get operation. The task result contains a read-only collection of thread channels found within this guild.

Parameters​
TypeNameDescription
Discord.CacheModemodeThe Discord.CacheMode that determines whether the object should be fetched from cache.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IGuild.GetVoiceChannelsAsync(CacheMode, RequestOptions)​

Gets a collection of all voice channels in this guild.

View Source​
Declaration
Task<IReadOnlyCollection<IVoiceChannel>> IGuild.GetVoiceChannelsAsync(CacheMode mode, RequestOptions options)
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.IVoiceChannel>>: A task that represents the asynchronous get operation. The task result contains a read-only collection of voice channels found within this guild.

Parameters​
TypeNameDescription
Discord.CacheModemodeThe Discord.CacheMode that determines whether the object should be fetched from cache.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IGuild.GetCategoriesAsync(CacheMode, RequestOptions)​

Gets a collection of all category channels in this guild.

View Source​
Declaration
Task<IReadOnlyCollection<ICategoryChannel>> IGuild.GetCategoriesAsync(CacheMode mode, RequestOptions options)
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.ICategoryChannel>>: A task that represents the asynchronous get operation. The task result contains a read-only collection of category channels found within this guild.

Parameters​
TypeNameDescription
Discord.CacheModemodeThe Discord.CacheMode that determines whether the object should be fetched from cache.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IGuild.GetVoiceChannelAsync(UInt64, CacheMode, RequestOptions)​

Gets a voice channel in this guild.

View Source​
Declaration
Task<IVoiceChannel> IGuild.GetVoiceChannelAsync(ulong id, CacheMode mode, RequestOptions options)
Returns​

System.Threading.Tasks.Task<Discord.IVoiceChannel>: A task that represents the asynchronous get operation. The task result contains the voice channel associated with the specified <code data-dev-comment-type="paramref" class="paramref">id</code>; null if none is found.

Parameters​
TypeNameDescription
System.UInt64idThe snowflake identifier for the voice channel.
Discord.CacheModemodeThe Discord.CacheMode that determines whether the object should be fetched from cache.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IGuild.GetStageChannelAsync(UInt64, CacheMode, RequestOptions)​

Gets a stage channel in this guild.

View Source​
Declaration
Task<IStageChannel> IGuild.GetStageChannelAsync(ulong id, CacheMode mode, RequestOptions options)
Returns​

System.Threading.Tasks.Task<Discord.IStageChannel>: A task that represents the asynchronous get operation. The task result contains the stage channel associated with the specified <code data-dev-comment-type="paramref" class="paramref">id</code>; null if none is found.

Parameters​
TypeNameDescription
System.UInt64idThe snowflake identifier for the stage channel.
Discord.CacheModemodeThe Discord.CacheMode that determines whether the object should be fetched from cache.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IGuild.GetStageChannelsAsync(CacheMode, RequestOptions)​

Gets a collection of all stage channels in this guild.

View Source​
Declaration
Task<IReadOnlyCollection<IStageChannel>> IGuild.GetStageChannelsAsync(CacheMode mode, RequestOptions options)
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.IStageChannel>>: A task that represents the asynchronous get operation. The task result contains a read-only collection of stage channels found within this guild.

Parameters​
TypeNameDescription
Discord.CacheModemodeThe Discord.CacheMode that determines whether the object should be fetched from cache.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IGuild.GetAFKChannelAsync(CacheMode, RequestOptions)​

Gets the AFK voice channel in this guild.

View Source​
Declaration
Task<IVoiceChannel> IGuild.GetAFKChannelAsync(CacheMode mode, RequestOptions options)
Returns​

System.Threading.Tasks.Task<Discord.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.

Parameters​
TypeNameDescription
Discord.CacheModemodeThe Discord.CacheMode that determines whether the object should be fetched from cache.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IGuild.GetDefaultChannelAsync(CacheMode, RequestOptions)​

Gets the first viewable text channel in this guild.

View Source​
Declaration
Task<ITextChannel> IGuild.GetDefaultChannelAsync(CacheMode mode, RequestOptions options)
Returns​

System.Threading.Tasks.Task<Discord.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.

Parameters​
TypeNameDescription
Discord.CacheModemodeThe Discord.CacheMode that determines whether the object should be fetched from cache.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IGuild.GetWidgetChannelAsync(CacheMode, RequestOptions)​

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

View Source​
Declaration
Task<IGuildChannel> IGuild.GetWidgetChannelAsync(CacheMode mode, RequestOptions options)
Returns​

System.Threading.Tasks.Task<Discord.IGuildChannel>: A task that represents the asynchronous get operation. The task result contains the widget channel set within the server's widget settings; null if none is set.

Parameters​
TypeNameDescription
Discord.CacheModemodeThe Discord.CacheMode that determines whether the object should be fetched from cache.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IGuild.GetSystemChannelAsync(CacheMode, RequestOptions)​

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

View Source​
Declaration
Task<ITextChannel> IGuild.GetSystemChannelAsync(CacheMode mode, RequestOptions options)
Returns​

System.Threading.Tasks.Task<Discord.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.

Parameters​
TypeNameDescription
Discord.CacheModemodeThe Discord.CacheMode that determines whether the object should be fetched from cache.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IGuild.GetRulesChannelAsync(CacheMode, RequestOptions)​

Gets the text channel where Community guilds can display rules and/or guidelines.

View Source​
Declaration
Task<ITextChannel> IGuild.GetRulesChannelAsync(CacheMode mode, RequestOptions options)
Returns​

System.Threading.Tasks.Task<Discord.ITextChannel>: A task that represents the asynchronous get operation. The task result contains the text channel where Community guilds can display rules and/or guidelines; null if none is set.

Parameters​
TypeNameDescription
Discord.CacheModemodeThe Discord.CacheMode that determines whether the object should be fetched from cache.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IGuild.GetPublicUpdatesChannelAsync(CacheMode, RequestOptions)​

Gets the text channel where admins and moderators of Community guilds receive notices from Discord.

View Source​
Declaration
Task<ITextChannel> IGuild.GetPublicUpdatesChannelAsync(CacheMode mode, RequestOptions options)
Returns​

System.Threading.Tasks.Task<Discord.ITextChannel>: A task that represents the asynchronous get operation. The task result contains the text channel where admins and moderators of Community guilds receive notices from Discord; null if none is set.

Parameters​
TypeNameDescription
Discord.CacheModemodeThe Discord.CacheMode that determines whether the object should be fetched from cache.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

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

Creates a new text channel in this guild.

View Source​
Declaration
async Task<ITextChannel> IGuild.CreateTextChannelAsync(string name, Action<TextChannelProperties> func, RequestOptions options)
Returns​

System.Threading.Tasks.Task<Discord.ITextChannel>: A task that represents the asynchronous creation operation. The task result contains the newly created text channel.

Parameters​
TypeNameDescription
System.StringnameThe new name for the text channel.
System.Action<Discord.TextChannelProperties>funcThe delegate containing the properties to be applied to the channel upon its creation.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

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

Creates a new voice channel in this guild.

View Source​
Declaration
async Task<IVoiceChannel> IGuild.CreateVoiceChannelAsync(string name, Action<VoiceChannelProperties> func, RequestOptions options)
Returns​

System.Threading.Tasks.Task<Discord.IVoiceChannel>: A task that represents the asynchronous creation operation. The task result contains the newly created voice channel.

Parameters​
TypeNameDescription
System.StringnameThe new name for the voice channel.
System.Action<Discord.VoiceChannelProperties>funcThe delegate containing the properties to be applied to the channel upon its creation.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IGuild.CreateStageChannelAsync(String, Action<VoiceChannelProperties>, RequestOptions)​

Creates a new stage channel in this guild.

View Source​
Declaration
async Task<IStageChannel> IGuild.CreateStageChannelAsync(string name, Action<VoiceChannelProperties> func, RequestOptions options)
Returns​

System.Threading.Tasks.Task<Discord.IStageChannel>: A task that represents the asynchronous creation operation. The task result contains the newly created stage channel.

Parameters​
TypeNameDescription
System.StringnameThe new name for the stage channel.
System.Action<Discord.VoiceChannelProperties>funcThe delegate containing the properties to be applied to the channel upon its creation.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

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

Creates a new channel category in this guild.

View Source​
Declaration
async Task<ICategoryChannel> IGuild.CreateCategoryAsync(string name, Action<GuildChannelProperties> func, RequestOptions options)
Returns​

System.Threading.Tasks.Task<Discord.ICategoryChannel>: A task that represents the asynchronous creation operation. The task result contains the newly created category channel.

Parameters​
TypeNameDescription
System.StringnameThe new name for the category.
System.Action<Discord.GuildChannelProperties>funcThe delegate containing the properties to be applied to the channel upon its creation.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IGuild.GetVoiceRegionsAsync(RequestOptions)​

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

View Source​
Declaration
async Task<IReadOnlyCollection<IVoiceRegion>> IGuild.GetVoiceRegionsAsync(RequestOptions options)
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.IVoiceRegion>>: A task that represents the asynchronous get operation. The task result contains a read-only collection of voice regions the guild can access.

Parameters​
TypeNameDescription
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IGuild.GetIntegrationsAsync(RequestOptions)​

View Source​
Declaration
async Task<IReadOnlyCollection<IGuildIntegration>> IGuild.GetIntegrationsAsync(RequestOptions options)
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.IGuildIntegration>>

Parameters​
TypeName
Discord.RequestOptionsoptions

IGuild.CreateIntegrationAsync(UInt64, String, RequestOptions)​

View Source​
Declaration
async Task<IGuildIntegration> IGuild.CreateIntegrationAsync(ulong id, string type, RequestOptions options)
Returns​

System.Threading.Tasks.Task<Discord.IGuildIntegration>

Parameters​
TypeName
System.UInt64id
System.Stringtype
Discord.RequestOptionsoptions

IGuild.GetInvitesAsync(RequestOptions)​

Gets a collection of all invites in this guild.

View Source​
Declaration
async Task<IReadOnlyCollection<IInviteMetadata>> IGuild.GetInvitesAsync(RequestOptions options)
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.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.

Parameters​
TypeNameDescription
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IGuild.GetVanityInviteAsync(RequestOptions)​

Gets the vanity invite URL of this guild.

View Source​
Declaration
async Task<IInviteMetadata> IGuild.GetVanityInviteAsync(RequestOptions options)
Returns​

System.Threading.Tasks.Task<Discord.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.

Parameters​
TypeNameDescription
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IGuild.GetRole(UInt64)​

Gets a role in this guild.

View Source​
Declaration
IRole IGuild.GetRole(ulong id)
Returns​

Discord.IRole: A role that is associated with the specified <code data-dev-comment-type="paramref" class="paramref">id</code>; null if none is found.

Parameters​
TypeNameDescription
System.UInt64idThe snowflake identifier for the role.

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

Creates a new role with the provided name.

View Source​
Declaration
async Task<IRole> IGuild.CreateRoleAsync(string name, GuildPermissions? permissions, Color? color, bool isHoisted, RequestOptions options)
Returns​

System.Threading.Tasks.Task<Discord.IRole>: A task that represents the asynchronous creation operation. The task result contains the newly created role.

Parameters​
TypeNameDescription
System.StringnameThe new name for the role.
System.Nullable<Discord.GuildPermissions>permissionsThe guild permission that the role should possess.
System.Nullable<Discord.Color>colorThe color of the role.
System.BooleanisHoistedWhether the role is separated from others on the sidebar.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

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

Creates a new role with the provided name.

View Source​
Declaration
async Task<IRole> IGuild.CreateRoleAsync(string name, GuildPermissions? permissions, Color? color, bool isHoisted, bool isMentionable, RequestOptions options)
Returns​

System.Threading.Tasks.Task<Discord.IRole>: A task that represents the asynchronous creation operation. The task result contains the newly created role.

Parameters​
TypeNameDescription
System.StringnameThe new name for the role.
System.Nullable<Discord.GuildPermissions>permissionsThe guild permission that the role should possess.
System.Nullable<Discord.Color>colorThe color of the role.
System.BooleanisHoistedWhether the role is separated from others on the sidebar.
System.BooleanisMentionableWhether the role can be mentioned.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IGuild.GetUsersAsync(CacheMode, RequestOptions)​

Gets a collection of all users in this guild.

View Source​
Declaration
async Task<IReadOnlyCollection<IGuildUser>> IGuild.GetUsersAsync(CacheMode mode, RequestOptions options)
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.IGuildUser>>: A task that represents the asynchronous get operation. The task result contains a collection of guild users found within this guild.

Parameters​
TypeNameDescription
Discord.CacheModemodeThe Discord.CacheMode that determines whether the object should be fetched from cache.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

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

Adds a user to this guild.

View Source​
Declaration
async Task<IGuildUser> IGuild.AddGuildUserAsync(ulong userId, string accessToken, Action<AddGuildUserProperties> func, RequestOptions options)
Returns​

System.Threading.Tasks.Task<Discord.IGuildUser>: A guild user associated with the specified <code data-dev-comment-type="paramref" class="paramref">userId</code>; null if the user is already in the guild.

Parameters​
TypeNameDescription
System.UInt64userIdThe snowflake identifier of the user.
System.StringaccessTokenThe OAuth2 access token for the user, requested with the guilds.join scope.
System.Action<Discord.AddGuildUserProperties>funcThe delegate containing the properties to be applied to the user upon being added to the guild.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IGuild.GetUserAsync(UInt64, CacheMode, RequestOptions)​

Gets a user from this guild.

View Source​
Declaration
Task<IGuildUser> IGuild.GetUserAsync(ulong id, CacheMode mode, RequestOptions options)
Returns​

System.Threading.Tasks.Task<Discord.IGuildUser>: A task that represents the asynchronous get operation. The task result contains the guild user associated with the specified <code data-dev-comment-type="paramref" class="paramref">id</code>; null if none is found.

Parameters​
TypeNameDescription
System.UInt64idThe snowflake identifier of the user.
Discord.CacheModemodeThe Discord.CacheMode that determines whether the object should be fetched from cache.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IGuild.GetCurrentUserAsync(CacheMode, RequestOptions)​

Gets the current user for this guild.

View Source​
Declaration
Task<IGuildUser> IGuild.GetCurrentUserAsync(CacheMode mode, RequestOptions options)
Returns​

System.Threading.Tasks.Task<Discord.IGuildUser>: A task that represents the asynchronous get operation. The task result contains the currently logged-in user within this guild.

Parameters​
TypeNameDescription
Discord.CacheModemodeThe Discord.CacheMode that determines whether the object should be fetched from cache.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IGuild.GetOwnerAsync(CacheMode, RequestOptions)​

Gets the owner of this guild.

View Source​
Declaration
Task<IGuildUser> IGuild.GetOwnerAsync(CacheMode mode, RequestOptions options)
Returns​

System.Threading.Tasks.Task<Discord.IGuildUser>: A task that represents the asynchronous get operation. The task result contains the owner of this guild.

Parameters​
TypeNameDescription
Discord.CacheModemodeThe Discord.CacheMode that determines whether the object should be fetched from cache.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IGuild.SearchUsersAsync(String, Int32, CacheMode, RequestOptions)​

Gets a collection of users in this guild that the name or nickname starts with the provided System.String at <code data-dev-comment-type="paramref" class="paramref">query</code>.

View Source​
Declaration
async Task<IReadOnlyCollection<IGuildUser>> IGuild.SearchUsersAsync(string query, int limit, CacheMode mode, RequestOptions options)
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.IGuildUser>>: A task that represents the asynchronous get operation. The task result contains a collection of guild users that the name or nickname starts with the provided System.String at <code data-dev-comment-type="paramref" class="paramref">query</code>.

Parameters​
TypeNameDescription
System.StringqueryThe partial name or nickname to search.
System.Int32limitThe maximum number of users to be gotten.
Discord.CacheModemodeThe Discord.CacheMode that determines whether the object should be fetched from cache.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

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

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

View Source​
Declaration
async Task<IReadOnlyCollection<IAuditLogEntry>> IGuild.GetAuditLogsAsync(int limit, CacheMode cacheMode, RequestOptions options, ulong? beforeId, ulong? userId, ActionType? actionType)
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.IAuditLogEntry>>: A task that represents the asynchronous get operation. The task result contains a read-only collection of the requested audit log entries.

Parameters​
TypeNameDescription
System.Int32limitThe number of audit log entries to fetch.
Discord.CacheModecacheMode
Discord.RequestOptionsoptionsThe options to be used when sending the request.
System.Nullable<System.UInt64>beforeIdThe audit log entry ID to get entries before.
System.Nullable<System.UInt64>userIdThe user ID to filter entries for.
System.Nullable<Discord.ActionType>actionTypeThe type of actions to filter.

IGuild.GetWebhookAsync(UInt64, RequestOptions)​

Gets a webhook found within this guild.

View Source​
Declaration
async Task<IWebhook> IGuild.GetWebhookAsync(ulong id, RequestOptions options)
Returns​

System.Threading.Tasks.Task<Discord.IWebhook>: A task that represents the asynchronous get operation. The task result contains the webhook with the specified <code data-dev-comment-type="paramref" class="paramref">id</code>; null if none is found.

Parameters​
TypeNameDescription
System.UInt64idThe identifier for the webhook.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IGuild.GetWebhooksAsync(RequestOptions)​

Gets a collection of all webhook from this guild.

View Source​
Declaration
async Task<IReadOnlyCollection<IWebhook>> IGuild.GetWebhooksAsync(RequestOptions options)
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.IWebhook>>: A task that represents the asynchronous get operation. The task result contains a read-only collection of webhooks found within the guild.

Parameters​
TypeNameDescription
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IGuild.GetApplicationCommandsAsync(RequestOptions)​

Gets this guilds application commands.

View Source​
Declaration
async Task<IReadOnlyCollection<IApplicationCommand>> IGuild.GetApplicationCommandsAsync(RequestOptions options)
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.IApplicationCommand>>: A task that represents the asynchronous get operation. The task result contains a read-only collection of application commands found within the guild.

Parameters​
TypeNameDescription
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IGuild.CreateStickerAsync(String, String, IEnumerable<String>, Image, RequestOptions)​

Creates a new sticker in this guild.

View Source​
Declaration
async Task<ICustomSticker> IGuild.CreateStickerAsync(string name, string description, IEnumerable<string> tags, Image image, RequestOptions options)
Returns​

System.Threading.Tasks.Task<Discord.ICustomSticker>: A task that represents the asynchronous creation operation. The task result contains the created sticker.

Parameters​
TypeNameDescription
System.StringnameThe name of the sticker.
System.StringdescriptionThe description of the sticker.
System.Collections.Generic.IEnumerable<System.String>tagsThe tags of the sticker.
Discord.ImageimageThe image of the new emote.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IGuild.CreateStickerAsync(String, String, IEnumerable<String>, Stream, String, RequestOptions)​

Creates a new sticker in this guild.

View Source​
Declaration
async Task<ICustomSticker> IGuild.CreateStickerAsync(string name, string description, IEnumerable<string> tags, Stream stream, string filename, RequestOptions options)
Returns​

System.Threading.Tasks.Task<Discord.ICustomSticker>: A task that represents the asynchronous creation operation. The task result contains the created sticker.

Parameters​
TypeNameDescription
System.StringnameThe name of the sticker.
System.StringdescriptionThe description of the sticker.
System.Collections.Generic.IEnumerable<System.String>tagsThe tags of the sticker.
System.IO.StreamstreamThe stream containing the file data.
System.StringfilenameThe name of the file <strong>with</strong> the extension, ex: image.png.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IGuild.CreateStickerAsync(String, String, IEnumerable<String>, String, RequestOptions)​

Creates a new sticker in this guild.

View Source​
Declaration
async Task<ICustomSticker> IGuild.CreateStickerAsync(string name, string description, IEnumerable<string> tags, string path, RequestOptions options)
Returns​

System.Threading.Tasks.Task<Discord.ICustomSticker>: A task that represents the asynchronous creation operation. The task result contains the created sticker.

Parameters​
TypeNameDescription
System.StringnameThe name of the sticker.
System.StringdescriptionThe description of the sticker.
System.Collections.Generic.IEnumerable<System.String>tagsThe tags of the sticker.
System.StringpathThe path of the file to upload.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IGuild.GetStickerAsync(UInt64, CacheMode, RequestOptions)​

Gets a specific sticker within this guild.

View Source​
Declaration
async Task<ICustomSticker> IGuild.GetStickerAsync(ulong id, CacheMode mode, RequestOptions options)
Returns​

System.Threading.Tasks.Task<Discord.ICustomSticker>: A task that represents the asynchronous get operation. The task result contains the sticker found with the specified <code data-dev-comment-type="paramref" class="paramref">id</code>; null if none is found.

Parameters​
TypeNameDescription
System.UInt64idThe id of the sticker to get.
Discord.CacheModemodeThe Discord.CacheMode that determines whether the object should be fetched from cache.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IGuild.GetStickersAsync(CacheMode, RequestOptions)​

Gets a collection of all stickers within this guild.

View Source​
Declaration
async Task<IReadOnlyCollection<ICustomSticker>> IGuild.GetStickersAsync(CacheMode mode, RequestOptions options)
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.ICustomSticker>>: A task that represents the asynchronous get operation. The task result contains a read-only collection of stickers found within the guild.

Parameters​
TypeNameDescription
Discord.CacheModemodeThe Discord.CacheMode that determines whether the object should be fetched from cache.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IGuild.DeleteStickerAsync(ICustomSticker, RequestOptions)​

Deletes a sticker within this guild.

View Source​
Declaration
Task IGuild.DeleteStickerAsync(ICustomSticker sticker, RequestOptions options)
Returns​

System.Threading.Tasks.Task: A task that represents the asynchronous removal operation.

Parameters​
TypeNameDescription
Discord.ICustomStickerstickerThe sticker to delete.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IGuild.GetApplicationCommandAsync(UInt64, CacheMode, RequestOptions)​

Gets an application command within this guild with the specified id.

View Source​
Declaration
async Task<IApplicationCommand> IGuild.GetApplicationCommandAsync(ulong id, CacheMode mode, RequestOptions options)
Returns​

System.Threading.Tasks.Task<Discord.IApplicationCommand>: A ValueTask that represents the asynchronous get operation. The task result contains a Discord.IApplicationCommand if found, otherwise null.

Parameters​
TypeNameDescription
System.UInt64idThe id of the application command to get.
Discord.CacheModemodeThe Discord.CacheMode that determines whether the object should be fetched from cache.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IGuild.CreateApplicationCommandAsync(ApplicationCommandProperties, RequestOptions)​

Creates an application command within this guild.

View Source​
Declaration
async Task<IApplicationCommand> IGuild.CreateApplicationCommandAsync(ApplicationCommandProperties properties, RequestOptions options)
Returns​

System.Threading.Tasks.Task<Discord.IApplicationCommand>: A task that represents the asynchronous creation operation. The task result contains the command that was created.

Parameters​
TypeNameDescription
Discord.ApplicationCommandPropertiespropertiesThe properties to use when creating the command.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IGuild.BulkOverwriteApplicationCommandsAsync(ApplicationCommandProperties[], RequestOptions)​

Overwrites the application commands within this guild.

View Source​
Declaration
async Task<IReadOnlyCollection<IApplicationCommand>> IGuild.BulkOverwriteApplicationCommandsAsync(ApplicationCommandProperties[] properties, RequestOptions options)
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.IApplicationCommand>>: A task that represents the asynchronous creation operation. The task result contains a collection of commands that was created.

Parameters​
TypeNameDescription
Discord.ApplicationCommandProperties[]propertiesA collection of properties to use when creating the commands.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IDisposable.Dispose()​

View Source​
Declaration
void IDisposable.Dispose()

Implements​