Interface IGuild
Represents a generic guild/server.
Inherited Members
Namespace: Discord
Assembly: Discord.Net.Core.dll
Syntax
public interface IGuild : IDeletable, ISnowflakeEntity, IEntity<ulong>
Properties
| Improve this Doc View SourceAFKChannelId
Gets the ID of the AFK voice channel for this guild.
Declaration
ulong? AFKChannelId { get; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<System.UInt64> | A System.UInt64 representing the snowflake identifier of the AFK voice channel; |
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
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. |
ApplicationId
Gets the application ID of the guild creator if it is bot-created.
Declaration
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 |
AudioClient
Gets the IAudioClient currently associated with this guild.
Declaration
IAudioClient AudioClient { get; }
Property Value
| Type | Description |
|---|---|
| IAudioClient | An IAudioClient currently associated with this guild. |
Available
Determines if this guild is currently connected and ready to be used.
Declaration
bool Available { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
|
Remarks
note
This property only applies to a WebSocket-based client.
BannerId
Gets the identifier for this guilds banner image.
Declaration
string BannerId { get; }
Property Value
| Type | Description |
|---|---|
| System.String | An identifier for the banner image; |
BannerUrl
Gets the URL of this guild's banner image.
Declaration
string BannerUrl { get; }
Property Value
| Type | Description |
|---|---|
| System.String | A URL pointing to the guild's banner image; |
DefaultChannelId
Gets the ID of the default channel for this guild.
Declaration
ulong DefaultChannelId { get; }
Property Value
| Type | Description |
|---|---|
| System.UInt64 | A System.UInt64 representing the snowflake identifier of the default text channel; |
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.
DefaultMessageNotifications
Gets the default message notifications for users who haven't explicitly set their notification settings.
Declaration
DefaultMessageNotifications DefaultMessageNotifications { get; }
Property Value
| Type | Description |
|---|---|
| DefaultMessageNotifications |
Description
Gets the description for the guild.
Declaration
string Description { get; }
Property Value
| Type | Description |
|---|---|
| System.String | The description for the guild; |
EmbedChannelId
Gets the ID of the widget embed channel of this guild.
Declaration
ulong? EmbedChannelId { get; }
Property Value
| 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; |
Emotes
Gets a collection of all custom emotes for this guild.
Declaration
IReadOnlyCollection<GuildEmote> Emotes { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IReadOnlyCollection<GuildEmote> | A read-only collection of all custom emotes for this guild. |
EveryoneRole
Gets the built-in role containing all users in this guild.
Declaration
IRole EveryoneRole { get; }
Property Value
| Type | Description |
|---|---|
| IRole | A role object that represents an |
ExplicitContentFilter
Gets the level of content filtering applied to user's content in a Guild.
Declaration
ExplicitContentFilterLevel ExplicitContentFilter { get; }
Property Value
| Type | Description |
|---|---|
| ExplicitContentFilterLevel | The level of explicit content filtering. |
Features
Gets a collection of all extra features added to this guild.
Declaration
IReadOnlyCollection<string> Features { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IReadOnlyCollection<System.String> | A read-only collection of enabled features in this guild. |
IconId
Gets the ID of this guild's icon.
Declaration
string IconId { get; }
Property Value
| Type | Description |
|---|---|
| System.String | An identifier for the splash image; |
IconUrl
Gets the URL of this guild's icon.
Declaration
string IconUrl { get; }
Property Value
| Type | Description |
|---|---|
| System.String | A URL pointing to the guild's icon; |
IsEmbeddable
Gets a value that indicates whether this guild is embeddable (i.e. can use widget).
Declaration
bool IsEmbeddable { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
|
MfaLevel
Gets the level of Multi-Factor Authentication requirements a user must fulfill before being allowed to perform administrative actions in this guild.
Declaration
MfaLevel MfaLevel { get; }
Property Value
| Type | Description |
|---|---|
| MfaLevel | The level of MFA requirement. |
Name
Gets the name of this guild.
Declaration
string Name { get; }
Property Value
| Type | Description |
|---|---|
| System.String | A string containing the name of this guild. |
OwnerId
Gets the ID of the user that owns this guild.
Declaration
ulong OwnerId { get; }
Property Value
| Type | Description |
|---|---|
| System.UInt64 | A System.UInt64 representing the snowflake identifier of the user that owns this guild. |
PreferredCulture
Gets the preferred culture of this guild.
Declaration
CultureInfo PreferredCulture { get; }
Property Value
| Type | Description |
|---|---|
| System.Globalization.CultureInfo | The preferred culture information of this guild. |
PreferredLocale
Gets the preferred locale of this guild in IETF BCP 47 language tag format.
Declaration
string PreferredLocale { get; }
Property Value
| Type | Description |
|---|---|
| System.String | The preferred locale of the guild in IETF BCP 47 language tag format. |
PremiumSubscriptionCount
Gets the number of premium subscribers of this guild.
Declaration
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.
PremiumTier
Gets the tier of guild boosting in this guild.
Declaration
PremiumTier PremiumTier { get; }
Property Value
| Type | Description |
|---|---|
| PremiumTier | The tier of guild boosting in this guild. |
Roles
Gets a collection of all roles in this guild.
Declaration
IReadOnlyCollection<IRole> Roles { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IReadOnlyCollection<IRole> | A read-only collection of roles found within this guild. |
SplashId
Gets the ID of this guild's splash image.
Declaration
string SplashId { get; }
Property Value
| Type | Description |
|---|---|
| System.String | An identifier for the splash image; |
SplashUrl
Gets the URL of this guild's splash image.
Declaration
string SplashUrl { get; }
Property Value
| Type | Description |
|---|---|
| System.String | A URL pointing to the guild's splash image; |
SystemChannelFlags
Gets the flags for the types of system channel messages that are disabled.
Declaration
SystemChannelMessageDeny SystemChannelFlags { get; }
Property Value
| Type | Description |
|---|---|
| SystemChannelMessageDeny | The flags for the types of system channel messages that are disabled. |
SystemChannelId
Gets the ID of the channel where randomized welcome messages are sent.
Declaration
ulong? SystemChannelId { get; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<System.UInt64> | A System.UInt64 representing the snowflake identifier of the system channel where randomized
welcome messages are sent; |
VanityURLCode
Gets the code for this guild's vanity invite URL.
Declaration
string VanityURLCode { get; }
Property Value
| Type | Description |
|---|---|
| System.String | A string containing the vanity invite code for this guild; |
VerificationLevel
Gets the level of requirements a user must fulfill before being allowed to post messages in this guild.
Declaration
VerificationLevel VerificationLevel { get; }
Property Value
| Type | Description |
|---|---|
| VerificationLevel | The level of requirements. |
VoiceRegionId
Gets the ID of the region hosting this guild's voice channels.
Declaration
string VoiceRegionId { get; }
Property Value
| Type | Description |
|---|---|
| System.String | A string containing the identifier for the voice region that this guild uses (e.g. |
Methods
| Improve this Doc View SourceAddBanAsync(IUser, Int32, String, RequestOptions)
Bans the user from this guild and optionally prunes their recent messages.
Declaration
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 |
|
AddBanAsync(UInt64, Int32, String, RequestOptions)
Bans the user from this guild and optionally prunes their recent messages.
Declaration
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 |
|
AddGuildUserAsync(UInt64, String, Action<AddGuildUserProperties>, RequestOptions)
Adds a user to this guild.
Declaration
Task<IGuildUser> AddGuildUserAsync(ulong userId, string accessToken, Action<AddGuildUserProperties> func = null, RequestOptions options = null)
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 |
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.
CreateCategoryAsync(String, Action<GuildChannelProperties>, RequestOptions)
Creates a new channel category in this guild.
Declaration
Task<ICategoryChannel> CreateCategoryAsync(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<ICategoryChannel> | A task that represents the asynchronous creation operation. The task result contains the newly created category channel. |
CreateEmoteAsync(String, Image, Optional<IEnumerable<IRole>>, RequestOptions)
Creates a new GuildEmote in this guild.
Declaration
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. |
CreateIntegrationAsync(UInt64, String, RequestOptions)
Declaration
Task<IGuildIntegration> 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<IGuildIntegration> |
CreateRoleAsync(String, Nullable<GuildPermissions>, Nullable<Color>, Boolean, RequestOptions)
Creates a new role with the provided name.
Declaration
Task<IRole> CreateRoleAsync(string name, GuildPermissions? permissions = default(GuildPermissions? ), Color? color = default(Color? ), bool isHoisted = 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. |
| 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. |
CreateRoleAsync(String, Nullable<GuildPermissions>, Nullable<Color>, Boolean, Boolean, RequestOptions)
Creates a new role with the provided name.
Declaration
Task<IRole> 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<IRole> | A task that represents the asynchronous creation operation. The task result contains the newly created role. |
CreateTextChannelAsync(String, Action<TextChannelProperties>, RequestOptions)
Creates a new text channel in this guild.
Declaration
Task<ITextChannel> 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<ITextChannel> | 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 <code>Wumpus</code> with a set topic.
public async Task CreateTextChannelUnderWumpus(IGuild guild, string name)
{
var categories = await guild.GetCategoriesAsync();
var targetCategory = categories.FirstOrDefault(x => x.Name == "wumpus");
if (targetCategory == null) return;
await guild.CreateTextChannelAsync(name, x =>
{
x.CategoryId = targetCategory.Id;
x.Topic = $"This channel was created at {DateTimeOffset.UtcNow}.";
});
}
|
Improve this Doc
View Source
CreateVoiceChannelAsync(String, Action<VoiceChannelProperties>, RequestOptions)
Creates a new voice channel in this guild.
Declaration
Task<IVoiceChannel> 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<IVoiceChannel> | A task that represents the asynchronous creation operation. The task result contains the newly created voice channel. |
DeleteEmoteAsync(GuildEmote, RequestOptions)
Deletes an existing GuildEmote from this guild.
Declaration
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. |
DownloadUsersAsync()
Downloads all users for this guild if the current list is incomplete.
Declaration
Task DownloadUsersAsync()
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task | A task that represents the asynchronous download operation. |
GetAFKChannelAsync(CacheMode, RequestOptions)
Gets the AFK voice channel in this guild.
Declaration
Task<IVoiceChannel> GetAFKChannelAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)
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; |
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>> GetAuditLogsAsync(int limit = 100, CacheMode mode = CacheMode.AllowDownload, 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. |
| 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. |
| 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. |
GetBanAsync(IUser, RequestOptions)
Gets a ban object for a banned user.
Declaration
Task<IBan> 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<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; |
GetBanAsync(UInt64, RequestOptions)
Gets a ban object for a banned user.
Declaration
Task<IBan> 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<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; |
GetBansAsync(RequestOptions)
Gets a collection of all users banned in this guild.
Declaration
Task<IReadOnlyCollection<IBan>> 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<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. |
GetCategoriesAsync(CacheMode, RequestOptions)
Gets a collection of all category channels in this guild.
Declaration
Task<IReadOnlyCollection<ICategoryChannel>> GetCategoriesAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)
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. |
GetChannelAsync(UInt64, CacheMode, RequestOptions)
Gets a channel in this guild.
Declaration
Task<IGuildChannel> GetChannelAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)
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 |
GetChannelsAsync(CacheMode, RequestOptions)
Gets a collection of all channels in this guild.
Declaration
Task<IReadOnlyCollection<IGuildChannel>> GetChannelsAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)
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. |
GetCurrentUserAsync(CacheMode, RequestOptions)
Gets the current user for this guild.
Declaration
Task<IGuildUser> GetCurrentUserAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)
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. |
GetDefaultChannelAsync(CacheMode, RequestOptions)
Gets the first viewable text channel in this guild.
Declaration
Task<ITextChannel> GetDefaultChannelAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)
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; |
GetEmbedChannelAsync(CacheMode, RequestOptions)
Gets the embed channel (i.e. the channel set in the guild's widget settings) in this guild.
Declaration
Task<IGuildChannel> GetEmbedChannelAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)
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; |
GetEmoteAsync(UInt64, RequestOptions)
Gets a specific emote from this guild.
Declaration
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 |
GetIntegrationsAsync(RequestOptions)
Declaration
Task<IReadOnlyCollection<IGuildIntegration>> GetIntegrationsAsync(RequestOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| RequestOptions | options |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<IGuildIntegration>> |
GetInvitesAsync(RequestOptions)
Gets a collection of all invites in this guild.
Declaration
Task<IReadOnlyCollection<IInviteMetadata>> 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<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. |
GetOwnerAsync(CacheMode, RequestOptions)
Gets the owner of this guild.
Declaration
Task<IGuildUser> GetOwnerAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)
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. |
GetRole(UInt64)
Gets a role in this guild.
Declaration
IRole 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 |
GetSystemChannelAsync(CacheMode, RequestOptions)
Gets the system channel where randomized welcome messages are sent in this guild.
Declaration
Task<ITextChannel> GetSystemChannelAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)
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; |
GetTextChannelAsync(UInt64, CacheMode, RequestOptions)
Gets a text channel in this guild.
Declaration
Task<ITextChannel> GetTextChannelAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)
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 |
GetTextChannelsAsync(CacheMode, RequestOptions)
Gets a collection of all text channels in this guild.
Declaration
Task<IReadOnlyCollection<ITextChannel>> GetTextChannelsAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)
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. |
GetUserAsync(UInt64, CacheMode, RequestOptions)
Gets a user from this guild.
Declaration
Task<IGuildUser> GetUserAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)
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 |
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.
GetUsersAsync(CacheMode, RequestOptions)
Gets a collection of all users in this guild.
Declaration
Task<IReadOnlyCollection<IGuildUser>> GetUsersAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)
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.
GetVanityInviteAsync(RequestOptions)
Gets the vanity invite URL of this guild.
Declaration
Task<IInviteMetadata> 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<IInviteMetadata> | A task that represents the asynchronous get operation. The task result contains the partial metadata of
the vanity invite found within this guild; |
GetVoiceChannelAsync(UInt64, CacheMode, RequestOptions)
Gets a voice channel in this guild.
Declaration
Task<IVoiceChannel> GetVoiceChannelAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)
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 |
GetVoiceChannelsAsync(CacheMode, RequestOptions)
Gets a collection of all voice channels in this guild.
Declaration
Task<IReadOnlyCollection<IVoiceChannel>> GetVoiceChannelsAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)
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. |
GetVoiceRegionsAsync(RequestOptions)
Gets a collection of all the voice regions this guild can access.
Declaration
Task<IReadOnlyCollection<IVoiceRegion>> 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<IVoiceRegion>> | A task that represents the asynchronous get operation. The task result contains a read-only collection of voice regions the guild can access. |
GetWebhookAsync(UInt64, RequestOptions)
Gets a webhook found within this guild.
Declaration
Task<IWebhook> 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<IWebhook> | A task that represents the asynchronous get operation. The task result contains the webhook with the
specified |
GetWebhooksAsync(RequestOptions)
Gets a collection of all webhook from this guild.
Declaration
Task<IReadOnlyCollection<IWebhook>> 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<IWebhook>> | A task that represents the asynchronous get operation. The task result contains a read-only collection of webhooks found within the guild. |
LeaveAsync(RequestOptions)
Leaves this guild.
Declaration
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.
ModifyAsync(Action<GuildProperties>, RequestOptions)
Modifies this guild.
Declaration
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. |
ModifyEmbedAsync(Action<GuildEmbedProperties>, RequestOptions)
Modifies this guild's embed channel.
Declaration
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. |
ModifyEmoteAsync(GuildEmote, Action<EmoteProperties>, RequestOptions)
Modifies an existing GuildEmote in this guild.
Declaration
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. |
PruneUsersAsync(Int32, Boolean, RequestOptions)
Prunes inactive users.
Declaration
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.
RemoveBanAsync(IUser, RequestOptions)
Unbans the user if they are currently banned.
Declaration
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. |
RemoveBanAsync(UInt64, RequestOptions)
Unbans the user if they are currently banned.
Declaration
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. |
ReorderChannelsAsync(IEnumerable<ReorderChannelProperties>, RequestOptions)
Bulk-modifies the order of channels in this guild.
Declaration
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. |
ReorderRolesAsync(IEnumerable<ReorderRoleProperties>, RequestOptions)
Bulk-modifies the order of roles in this guild.
Declaration
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. |