Class RestGuild
Represents a REST-based guild/server.
Inherited Members
Namespace: Discord.Rest
Assembly: Discord.Net.Rest.dll
Syntax
public class RestGuild : RestEntity<ulong>, IGuild, IDeletable, ISnowflakeEntity, IEntity<ulong>, IUpdateable
Properties
| Improve this Doc View SourceAFKChannelId
Gets the ID of the AFK voice channel for this guild.
Declaration
public 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
public int AFKTimeout { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 | An System.Int32 representing the amount of time in seconds for a user to be marked as inactive and moved into the AFK voice channel. |
ApplicationId
Gets the application ID of the guild creator if it is bot-created.
Declaration
public ulong? ApplicationId { get; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<System.UInt64> | A System.UInt64 representing the snowflake identifier of the application ID that created this guild, or |
BannerId
Gets the identifier for this guilds banner image.
Declaration
public string BannerId { get; }
Property Value
| Type | Description |
|---|---|
| System.String | An identifier for the banner image; |
BannerUrl
Gets the URL of this guild's banner image.
Declaration
public string BannerUrl { get; }
Property Value
| Type | Description |
|---|---|
| System.String | A URL pointing to the guild's banner image; |
CreatedAt
Gets when the snowflake was created.
Declaration
public DateTimeOffset CreatedAt { get; }
Property Value
| Type | Description |
|---|---|
| System.DateTimeOffset | A System.DateTimeOffset representing when the entity was first created. |
DefaultChannelId
Declaration
[Obsolete("DefaultChannelId is deprecated, use GetDefaultChannelAsync")]
public ulong DefaultChannelId { get; }
Property Value
| Type | Description |
|---|---|
| System.UInt64 |
DefaultMessageNotifications
Gets the default message notifications for users who haven't explicitly set their notification settings.
Declaration
public DefaultMessageNotifications DefaultMessageNotifications { get; }
Property Value
| Type | Description |
|---|---|
| DefaultMessageNotifications |
Description
Gets the description for the guild.
Declaration
public 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
public 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
public IReadOnlyCollection<GuildEmote> Emotes { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IReadOnlyCollection<GuildEmote> | A read-only collection of all custom emotes for this guild. |
EveryoneRole
Gets the built-in role containing all users in this guild.
Declaration
public RestRole EveryoneRole { get; }
Property Value
| Type | Description |
|---|---|
| RestRole |
ExplicitContentFilter
Gets the level of content filtering applied to user's content in a Guild.
Declaration
public ExplicitContentFilterLevel ExplicitContentFilter { get; }
Property Value
| Type | Description |
|---|---|
| ExplicitContentFilterLevel | The level of explicit content filtering. |
Features
Gets a collection of all extra features added to this guild.
Declaration
public IReadOnlyCollection<string> Features { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IReadOnlyCollection<System.String> | A read-only collection of enabled features in this guild. |
IconId
Gets the ID of this guild's icon.
Declaration
public string IconId { get; }
Property Value
| Type | Description |
|---|---|
| System.String | An identifier for the splash image; |
IconUrl
Gets the URL of this guild's icon.
Declaration
public string IconUrl { get; }
Property Value
| Type | Description |
|---|---|
| System.String | A URL pointing to the guild's icon; |
IsEmbeddable
Gets a value that indicates whether this guild is embeddable (i.e. can use widget).
Declaration
public bool IsEmbeddable { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
|
MfaLevel
Gets the level of Multi-Factor Authentication requirements a user must fulfill before being allowed to perform administrative actions in this guild.
Declaration
public MfaLevel MfaLevel { get; }
Property Value
| Type | Description |
|---|---|
| MfaLevel | The level of MFA requirement. |
Name
Gets the name of this guild.
Declaration
public string Name { get; }
Property Value
| Type | Description |
|---|---|
| System.String | A string containing the name of this guild. |
OwnerId
Gets the ID of the user that owns this guild.
Declaration
public ulong OwnerId { get; }
Property Value
| Type | Description |
|---|---|
| System.UInt64 | A System.UInt64 representing the snowflake identifier of the user that owns this guild. |
PreferredCulture
Gets the preferred culture of this guild.
Declaration
public CultureInfo PreferredCulture { get; }
Property Value
| Type | Description |
|---|---|
| System.Globalization.CultureInfo | The preferred culture information of this guild. |
PreferredLocale
Gets the preferred locale of this guild in IETF BCP 47 language tag format.
Declaration
public string PreferredLocale { get; }
Property Value
| Type | Description |
|---|---|
| System.String | The preferred locale of the guild in IETF BCP 47 language tag format. |
PremiumSubscriptionCount
Gets the number of premium subscribers of this guild.
Declaration
public int PremiumSubscriptionCount { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 | The number of premium subscribers of this guild. |
Remarks
This is the number of users who have boosted this guild.
PremiumTier
Gets the tier of guild boosting in this guild.
Declaration
public PremiumTier PremiumTier { get; }
Property Value
| Type | Description |
|---|---|
| PremiumTier | The tier of guild boosting in this guild. |
Roles
Gets a collection of all roles in this guild.
Declaration
public IReadOnlyCollection<RestRole> Roles { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IReadOnlyCollection<RestRole> |
SplashId
Gets the ID of this guild's splash image.
Declaration
public string SplashId { get; }
Property Value
| Type | Description |
|---|---|
| System.String | An identifier for the splash image; |
SplashUrl
Gets the URL of this guild's splash image.
Declaration
public string SplashUrl { get; }
Property Value
| Type | Description |
|---|---|
| System.String | A URL pointing to the guild's splash image; |
SystemChannelFlags
Gets the flags for the types of system channel messages that are disabled.
Declaration
public SystemChannelMessageDeny SystemChannelFlags { get; }
Property Value
| Type | Description |
|---|---|
| SystemChannelMessageDeny | The flags for the types of system channel messages that are disabled. |
SystemChannelId
Gets the ID of the channel where randomized welcome messages are sent.
Declaration
public 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
public 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
public 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
public string VoiceRegionId { get; }
Property Value
| Type | Description |
|---|---|
| System.String | A string containing the identifier for the voice region that this guild uses (e.g. |
Methods
| Improve this Doc View SourceAddBanAsync(IUser, Int32, String, RequestOptions)
Bans the user from this guild and optionally prunes their recent messages.
Declaration
public Task AddBanAsync(IUser user, int pruneDays = 0, string reason = null, RequestOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IUser | user | The user to ban. |
| System.Int32 | pruneDays | The number of days to remove messages from this user for, and this number must be between [0, 7]. |
| System.String | reason | The reason of the ban to be written in the audit log. |
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task | A task that represents the asynchronous add operation for the ban. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException |
|
AddBanAsync(UInt64, Int32, String, RequestOptions)
Bans the user from this guild and optionally prunes their recent messages.
Declaration
public Task AddBanAsync(ulong userId, int pruneDays = 0, string reason = null, RequestOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt64 | userId | The snowflake ID of the user to ban. |
| System.Int32 | pruneDays | The number of days to remove messages from this user for, and this number must be between [0, 7]. |
| System.String | reason | The reason of the ban to be written in the audit log. |
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task | A task that represents the asynchronous add operation for the ban. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException |
|
AddGuildUserAsync(UInt64, String, Action<AddGuildUserProperties>, RequestOptions)
Declaration
public Task<RestGuildUser> AddGuildUserAsync(ulong id, string accessToken, Action<AddGuildUserProperties> func = null, RequestOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt64 | id | |
| System.String | accessToken | |
| System.Action<AddGuildUserProperties> | func | |
| RequestOptions | options |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<RestGuildUser> |
CreateCategoryChannelAsync(String, Action<GuildChannelProperties>, RequestOptions)
Creates a category channel with the provided name.
Declaration
public Task<RestCategoryChannel> CreateCategoryChannelAsync(string name, Action<GuildChannelProperties> func = null, RequestOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The name of the new channel. |
| System.Action<GuildChannelProperties> | func | The delegate containing the properties to be applied to the channel upon its creation. |
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<RestCategoryChannel> | The created category channel. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException |
|
CreateEmoteAsync(String, Image, Optional<IEnumerable<IRole>>, RequestOptions)
Creates a new GuildEmote in this guild.
Declaration
public Task<GuildEmote> CreateEmoteAsync(string name, Image image, Optional<IEnumerable<IRole>> roles = default(Optional<IEnumerable<IRole>>), RequestOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The name of the guild emote. |
| Image | image | The image of the new emote. |
| Optional<System.Collections.Generic.IEnumerable<IRole>> | roles | The roles to limit the emote usage to. |
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<GuildEmote> | A task that represents the asynchronous creation operation. The task result contains the created emote. |
CreateIntegrationAsync(UInt64, String, RequestOptions)
Declaration
public Task<RestGuildIntegration> CreateIntegrationAsync(ulong id, string type, RequestOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt64 | id | |
| System.String | type | |
| RequestOptions | options |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<RestGuildIntegration> |
CreateRoleAsync(String, Nullable<GuildPermissions>, Nullable<Color>, Boolean, RequestOptions)
Declaration
public Task<RestRole> CreateRoleAsync(string name, GuildPermissions? permissions = default(GuildPermissions? ), Color? color = default(Color? ), bool isHoisted = false, RequestOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | |
| System.Nullable<GuildPermissions> | permissions | |
| System.Nullable<Color> | color | |
| System.Boolean | isHoisted | |
| RequestOptions | options |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<RestRole> |
CreateRoleAsync(String, Nullable<GuildPermissions>, Nullable<Color>, Boolean, Boolean, RequestOptions)
Creates a new role with the provided name.
Declaration
public Task<RestRole> CreateRoleAsync(string name, GuildPermissions? permissions = default(GuildPermissions? ), Color? color = default(Color? ), bool isHoisted = false, bool isMentionable = false, RequestOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The new name for the role. |
| System.Nullable<GuildPermissions> | permissions | The guild permission that the role should possess. |
| System.Nullable<Color> | color | The color of the role. |
| System.Boolean | isHoisted | Whether the role is separated from others on the sidebar. |
| System.Boolean | isMentionable | Whether the role can be mentioned. |
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<RestRole> | A task that represents the asynchronous creation operation. The task result contains the newly created role. |
CreateTextChannelAsync(String, Action<TextChannelProperties>, RequestOptions)
Creates a new text channel in this guild.
Declaration
public Task<RestTextChannel> CreateTextChannelAsync(string name, Action<TextChannelProperties> func = null, RequestOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The new name for the text channel. |
| System.Action<TextChannelProperties> | func | The delegate containing the properties to be applied to the channel upon its creation. |
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<RestTextChannel> | A task that represents the asynchronous creation operation. The task result contains the newly created text channel. |
Examples
The following example creates a new text channel under an existing category named Wumpus with a set topic.
var categories = await guild.GetCategoriesAsync();
var targetCategory = categories.FirstOrDefault(x => x.Name == "wumpus");
if (targetCategory == null) return;
await Context.Guild.CreateTextChannelAsync(name, x =>
{
x.CategoryId = targetCategory.Id;
x.Topic = $"This channel was created at {DateTimeOffset.UtcNow} by {user}.";
});
|
Improve this Doc
View Source
CreateVoiceChannelAsync(String, Action<VoiceChannelProperties>, RequestOptions)
Creates a voice channel with the provided name.
Declaration
public Task<RestVoiceChannel> CreateVoiceChannelAsync(string name, Action<VoiceChannelProperties> func = null, RequestOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The name of the new channel. |
| System.Action<VoiceChannelProperties> | func | The delegate containing the properties to be applied to the channel upon its creation. |
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<RestVoiceChannel> | The created voice channel. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException |
|
DeleteAsync(RequestOptions)
Deletes this object and all its children.
Declaration
public Task DeleteAsync(RequestOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task |
DeleteEmoteAsync(GuildEmote, RequestOptions)
Deletes an existing GuildEmote from this guild.
Declaration
public Task DeleteEmoteAsync(GuildEmote emote, RequestOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| GuildEmote | emote | The emote to delete. |
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task | A task that represents the asynchronous removal operation. |
GetAFKChannelAsync(RequestOptions)
Gets the AFK voice channel in this guild.
Declaration
public Task<RestVoiceChannel> GetAFKChannelAsync(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<RestVoiceChannel> | 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, RequestOptions, Nullable<UInt64>, Nullable<UInt64>, Nullable<ActionType>)
Gets the specified number of audit log entries for this guild.
Declaration
public IAsyncEnumerable<IReadOnlyCollection<RestAuditLogEntry>> GetAuditLogsAsync(int limit, RequestOptions options = null, ulong? beforeId = default(ulong? ), ulong? userId = default(ulong? ), ActionType? actionType = default(ActionType? ))
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | limit | The number of audit log entries to fetch. |
| RequestOptions | options | The options to be used when sending the request. |
| System.Nullable<System.UInt64> | beforeId | The audit log entry ID to 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.Collections.Generic.IAsyncEnumerable<System.Collections.Generic.IReadOnlyCollection<RestAuditLogEntry>> | A task that represents the asynchronous get operation. The task result contains a read-only collection of the requested audit log entries. |
GetBanAsync(IUser, RequestOptions)
Gets a ban object for a banned user.
Declaration
public Task<RestBan> GetBanAsync(IUser user, RequestOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IUser | user | The banned user. |
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<RestBan> | A task that represents the asynchronous get operation. The task result contains a ban object, which
contains the user information and the reason for the ban; |
GetBanAsync(UInt64, RequestOptions)
Gets a ban object for a banned user.
Declaration
public Task<RestBan> GetBanAsync(ulong userId, RequestOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt64 | userId | The snowflake identifier for the banned user. |
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<RestBan> | A task that represents the asynchronous get operation. The task result contains a ban object, which
contains the user information and the reason for the ban; |
GetBansAsync(RequestOptions)
Gets a collection of all users banned in this guild.
Declaration
public Task<IReadOnlyCollection<RestBan>> GetBansAsync(RequestOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<RestBan>> | A task that represents the asynchronous get operation. The task result contains a read-only collection of ban objects that this guild currently possesses, with each object containing the user banned and reason behind the ban. |
GetCategoryChannelsAsync(RequestOptions)
Gets a collection of all category channels in this guild.
Declaration
public Task<IReadOnlyCollection<RestCategoryChannel>> GetCategoryChannelsAsync(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<RestCategoryChannel>> | 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, RequestOptions)
Gets a channel in this guild.
Declaration
public Task<RestGuildChannel> GetChannelAsync(ulong id, RequestOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt64 | id | The snowflake identifier for the channel. |
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<RestGuildChannel> | A task that represents the asynchronous get operation. The task result contains the generic channel
associated with the specified |
GetChannelsAsync(RequestOptions)
Gets a collection of all channels in this guild.
Declaration
public Task<IReadOnlyCollection<RestGuildChannel>> GetChannelsAsync(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<RestGuildChannel>> | A task that represents the asynchronous get operation. The task result contains a read-only collection of generic channels found within this guild. |
GetCurrentUserAsync(RequestOptions)
Gets the current user for this guild.
Declaration
public Task<RestGuildUser> GetCurrentUserAsync(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<RestGuildUser> | A task that represents the asynchronous get operation. The task result contains the currently logged-in user within this guild. |
GetDefaultChannelAsync(RequestOptions)
Gets the first viewable text channel in this guild.
Declaration
public Task<RestTextChannel> GetDefaultChannelAsync(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<RestTextChannel> | A task that represents the asynchronous get operation. The task result contains the first viewable text
channel in this guild; |
GetEmbedChannelAsync(RequestOptions)
Gets the embed channel (i.e. the channel set in the guild's widget settings) in this guild.
Declaration
public Task<RestGuildChannel> GetEmbedChannelAsync(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<RestGuildChannel> | 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
public Task<GuildEmote> GetEmoteAsync(ulong id, RequestOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt64 | id | The snowflake identifier for the guild emote. |
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<GuildEmote> | A task that represents the asynchronous get operation. The task result contains the emote found with the
specified |
GetIntegrationsAsync(RequestOptions)
Declaration
public Task<IReadOnlyCollection<RestGuildIntegration>> GetIntegrationsAsync(RequestOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| RequestOptions | options |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<RestGuildIntegration>> |
GetInvitesAsync(RequestOptions)
Gets a collection of all invites in this guild.
Declaration
public Task<IReadOnlyCollection<RestInviteMetadata>> GetInvitesAsync(RequestOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<RestInviteMetadata>> | A task that represents the asynchronous get operation. The task result contains a read-only collection of invite metadata, each representing information for an invite found within this guild. |
GetOwnerAsync(RequestOptions)
Gets the owner of this guild.
Declaration
public Task<RestGuildUser> GetOwnerAsync(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<RestGuildUser> | 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
public RestRole GetRole(ulong id)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt64 | id | The snowflake identifier for the role. |
Returns
| Type | Description |
|---|---|
| RestRole | A role that is associated with the specified |
GetSystemChannelAsync(RequestOptions)
Gets the first viewable text channel in this guild.
Declaration
public Task<RestTextChannel> GetSystemChannelAsync(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<RestTextChannel> | A task that represents the asynchronous get operation. The task result contains the first viewable text
channel in this guild; |
GetTextChannelAsync(UInt64, RequestOptions)
Gets a text channel in this guild.
Declaration
public Task<RestTextChannel> GetTextChannelAsync(ulong id, RequestOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt64 | id | The snowflake identifier for the text channel. |
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<RestTextChannel> | A task that represents the asynchronous get operation. The task result contains the text channel
associated with the specified |
GetTextChannelsAsync(RequestOptions)
Gets a collection of all text channels in this guild.
Declaration
public Task<IReadOnlyCollection<RestTextChannel>> GetTextChannelsAsync(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<RestTextChannel>> | 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, RequestOptions)
Gets a user from this guild.
Declaration
public Task<RestGuildUser> GetUserAsync(ulong id, RequestOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt64 | id | The snowflake identifier of the user. |
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<RestGuildUser> | 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.
GetUsersAsync(RequestOptions)
Gets a collection of all users in this guild.
Declaration
public IAsyncEnumerable<IReadOnlyCollection<RestGuildUser>> GetUsersAsync(RequestOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IAsyncEnumerable<System.Collections.Generic.IReadOnlyCollection<RestGuildUser>> | 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.
GetVanityInviteAsync(RequestOptions)
Gets the vanity invite URL of this guild.
Declaration
public Task<RestInviteMetadata> GetVanityInviteAsync(RequestOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<RestInviteMetadata> | A partial metadata of the vanity invite found within this guild. |
GetVoiceChannelAsync(UInt64, RequestOptions)
Gets a voice channel in this guild.
Declaration
public Task<RestVoiceChannel> GetVoiceChannelAsync(ulong id, RequestOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt64 | id | The snowflake identifier for the voice channel. |
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<RestVoiceChannel> | A task that represents the asynchronous get operation. The task result contains the voice channel associated
with the specified |
GetVoiceChannelsAsync(RequestOptions)
Gets a collection of all voice channels in this guild.
Declaration
public Task<IReadOnlyCollection<RestVoiceChannel>> GetVoiceChannelsAsync(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<RestVoiceChannel>> | 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
public Task<IReadOnlyCollection<RestVoiceRegion>> GetVoiceRegionsAsync(RequestOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<RestVoiceRegion>> | A task that represents the asynchronous get operation. The task result contains a read-only collection of voice regions the guild can access. |
GetWebhookAsync(UInt64, RequestOptions)
Gets a webhook found within this guild.
Declaration
public Task<RestWebhook> GetWebhookAsync(ulong id, RequestOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt64 | id | The identifier for the webhook. |
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<RestWebhook> | A task that represents the asynchronous get operation. The task result contains the webhook with the
specified |
GetWebhooksAsync(RequestOptions)
Gets a collection of all webhook from this guild.
Declaration
public Task<IReadOnlyCollection<RestWebhook>> GetWebhooksAsync(RequestOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<RestWebhook>> | A task that represents the asynchronous get operation. The task result contains a read-only collection of webhooks found within the guild. |
LeaveAsync(RequestOptions)
Leaves this guild.
Declaration
public Task LeaveAsync(RequestOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task | A task that represents the asynchronous leave operation. |
Remarks
This method will make the currently logged-in user leave the guild.
note
If the user is the owner of this guild, use DeleteAsync(RequestOptions) instead.
ModifyAsync(Action<GuildProperties>, RequestOptions)
Modifies this guild.
Declaration
public Task ModifyAsync(Action<GuildProperties> func, RequestOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Action<GuildProperties> | func | The delegate containing the properties to modify the guild with. |
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task | A task that represents the asynchronous modification operation. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException |
|
ModifyEmbedAsync(Action<GuildEmbedProperties>, RequestOptions)
Modifies this guild's embed channel.
Declaration
public Task ModifyEmbedAsync(Action<GuildEmbedProperties> func, RequestOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Action<GuildEmbedProperties> | func | The delegate containing the properties to modify the guild widget with. |
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task | A task that represents the asynchronous modification operation. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException |
|
ModifyEmoteAsync(GuildEmote, Action<EmoteProperties>, RequestOptions)
Modifies an existing GuildEmote in this guild.
Declaration
public Task<GuildEmote> ModifyEmoteAsync(GuildEmote emote, Action<EmoteProperties> func, RequestOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| GuildEmote | emote | The emote to be modified. |
| System.Action<EmoteProperties> | func | The delegate containing the properties to modify the emote with. |
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<GuildEmote> | A task that represents the asynchronous modification operation. The task result contains the modified emote. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException |
|
PruneUsersAsync(Int32, Boolean, RequestOptions)
Prunes inactive users.
Declaration
public Task<int> PruneUsersAsync(int days = 30, bool simulate = false, RequestOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | days | The number of days required for the users to be kicked. |
| System.Boolean | simulate | Whether this prune action is a simulation. |
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<System.Int32> | A task that represents the asynchronous prune operation. The task result contains the number of users to be or has been removed from this guild. |
Remarks
This method removes all users that have not logged on in the provided number of days.
If simulate is true, this method will only return the number of users that
would be removed without kicking the users.
RemoveBanAsync(IUser, RequestOptions)
Unbans the user if they are currently banned.
Declaration
public Task RemoveBanAsync(IUser user, RequestOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IUser | user | The user to be unbanned. |
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task | A task that represents the asynchronous removal operation for the ban. |
RemoveBanAsync(UInt64, RequestOptions)
Unbans the user if they are currently banned.
Declaration
public Task RemoveBanAsync(ulong userId, RequestOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt64 | userId | The snowflake identifier of the user to be unbanned. |
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task | A task that represents the asynchronous removal operation for the ban. |
ReorderChannelsAsync(IEnumerable<ReorderChannelProperties>, RequestOptions)
Bulk-modifies the order of channels in this guild.
Declaration
public Task ReorderChannelsAsync(IEnumerable<ReorderChannelProperties> args, RequestOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<ReorderChannelProperties> | args | The properties used to modify the channel positions with. |
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task | A task that represents the asynchronous reorder operation. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException |
|
ReorderRolesAsync(IEnumerable<ReorderRoleProperties>, RequestOptions)
Bulk-modifies the order of roles in this guild.
Declaration
public Task ReorderRolesAsync(IEnumerable<ReorderRoleProperties> args, RequestOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<ReorderRoleProperties> | args | The properties used to modify the role positions with. |
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task | A task that represents the asynchronous reorder operation. |
ToString()
Returns the name of the guild.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| System.String | The name of the guild. |
Overrides
UpdateAsync(RequestOptions)
Updates this object's properties with its current state.
Declaration
public Task UpdateAsync(RequestOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| RequestOptions | options |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task |
Explicit Interface Implementations
| Improve this Doc View SourceIGuild.AddGuildUserAsync(UInt64, String, Action<AddGuildUserProperties>, RequestOptions)
Adds a user to this guild.
Declaration
Task<IGuildUser> IGuild.AddGuildUserAsync(ulong userId, string accessToken, Action<AddGuildUserProperties> func, RequestOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt64 | userId | The snowflake identifier of the user. |
| System.String | accessToken | The OAuth2 access token for the user, requested with the guilds.join scope. |
| System.Action<AddGuildUserProperties> | func | The delegate containing the properties to be applied to the user upon being added to the guild. |
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<IGuildUser> | A guild user associated with the specified |
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.
IGuild.AudioClient
Gets the IAudioClient currently associated with this guild.
Declaration
IAudioClient IGuild.AudioClient { get; }
Returns
| Type | Description |
|---|---|
| IAudioClient | An IAudioClient currently associated with this guild. |
IGuild.Available
Determines if this guild is currently connected and ready to be used.
Declaration
bool IGuild.Available { get; }
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
Remarks
note
This property only applies to a WebSocket-based client.
IGuild.CreateCategoryAsync(String, Action<GuildChannelProperties>, RequestOptions)
Creates a new channel category in this guild.
Declaration
Task<ICategoryChannel> IGuild.CreateCategoryAsync(string name, Action<GuildChannelProperties> func, RequestOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The new name for the category. |
| System.Action<GuildChannelProperties> | func | The delegate containing the properties to be applied to the channel upon its creation. |
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<ICategoryChannel> | A task that represents the asynchronous creation operation. The task result contains the newly created category channel. |
IGuild.CreateIntegrationAsync(UInt64, String, RequestOptions)
Declaration
Task<IGuildIntegration> IGuild.CreateIntegrationAsync(ulong id, string type, RequestOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt64 | id | |
| System.String | type | |
| RequestOptions | options |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<IGuildIntegration> |
IGuild.CreateRoleAsync(String, Nullable<GuildPermissions>, Nullable<Color>, Boolean, RequestOptions)
Creates a new role with the provided name.
Declaration
Task<IRole> IGuild.CreateRoleAsync(string name, GuildPermissions? permissions, Color? color, bool isHoisted, RequestOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The new name for the role. |
| System.Nullable<GuildPermissions> | permissions | The guild permission that the role should possess. |
| System.Nullable<Color> | color | The color of the role. |
| System.Boolean | isHoisted | Whether the role is separated from others on the sidebar. |
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<IRole> | A task that represents the asynchronous creation operation. The task result contains the newly created role. |
IGuild.CreateRoleAsync(String, Nullable<GuildPermissions>, Nullable<Color>, Boolean, Boolean, RequestOptions)
Creates a new role with the provided name.
Declaration
Task<IRole> IGuild.CreateRoleAsync(string name, GuildPermissions? permissions, Color? color, bool isHoisted, bool isMentionable, RequestOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The new name for the role. |
| System.Nullable<GuildPermissions> | permissions | The guild permission that the role should possess. |
| System.Nullable<Color> | color | The color of the role. |
| System.Boolean | isHoisted | Whether the role is separated from others on the sidebar. |
| System.Boolean | isMentionable | Whether the role can be mentioned. |
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<IRole> | A task that represents the asynchronous creation operation. The task result contains the newly created role. |
IGuild.CreateTextChannelAsync(String, Action<TextChannelProperties>, RequestOptions)
Creates a new text channel in this guild.
Declaration
Task<ITextChannel> IGuild.CreateTextChannelAsync(string name, Action<TextChannelProperties> func, RequestOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The new name for the text channel. |
| System.Action<TextChannelProperties> | func | The delegate containing the properties to be applied to the channel upon its creation. |
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<ITextChannel> | A task that represents the asynchronous creation operation. The task result contains the newly created text channel. |
IGuild.CreateVoiceChannelAsync(String, Action<VoiceChannelProperties>, RequestOptions)
Creates a new voice channel in this guild.
Declaration
Task<IVoiceChannel> IGuild.CreateVoiceChannelAsync(string name, Action<VoiceChannelProperties> func, RequestOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The new name for the voice channel. |
| System.Action<VoiceChannelProperties> | func | The delegate containing the properties to be applied to the channel upon its creation. |
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<IVoiceChannel> | A task that represents the asynchronous creation operation. The task result contains the newly created voice channel. |
IGuild.DownloadUsersAsync()
Downloads all users for this guild if the current list is incomplete.
Declaration
Task IGuild.DownloadUsersAsync()
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task | A task that represents the asynchronous download operation. |
Exceptions
| Type | Condition |
|---|---|
| System.NotSupportedException | Downloading users is not supported for a REST-based guild. |
IGuild.EveryoneRole
Gets the built-in role containing all users in this guild.
Declaration
IRole IGuild.EveryoneRole { get; }
Returns
| Type | Description |
|---|---|
| IRole | A role object that represents an |
IGuild.GetAFKChannelAsync(CacheMode, RequestOptions)
Gets the AFK voice channel in this guild.
Declaration
Task<IVoiceChannel> IGuild.GetAFKChannelAsync(CacheMode mode, RequestOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| CacheMode | mode | The CacheMode that determines whether the object should be fetched from cache. |
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<IVoiceChannel> | A task that represents the asynchronous get operation. The task result contains the voice channel that the
AFK users will be moved to after they have idled for too long; |
IGuild.GetAuditLogsAsync(Int32, CacheMode, RequestOptions, Nullable<UInt64>, Nullable<UInt64>, Nullable<ActionType>)
Declaration
Task<IReadOnlyCollection<IAuditLogEntry>> IGuild.GetAuditLogsAsync(int limit, CacheMode cacheMode, RequestOptions options, ulong? beforeId, ulong? userId, ActionType? actionType)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | limit | |
| CacheMode | cacheMode | |
| RequestOptions | options | |
| System.Nullable<System.UInt64> | beforeId | |
| System.Nullable<System.UInt64> | userId | |
| System.Nullable<ActionType> | actionType |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<IAuditLogEntry>> |
IGuild.GetBanAsync(IUser, RequestOptions)
Gets a ban object for a banned user.
Declaration
Task<IBan> IGuild.GetBanAsync(IUser user, RequestOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| IUser | user | The banned user. |
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<IBan> | A task that represents the asynchronous get operation. The task result contains a ban object, which
contains the user information and the reason for the ban; |
IGuild.GetBanAsync(UInt64, RequestOptions)
Gets a ban object for a banned user.
Declaration
Task<IBan> IGuild.GetBanAsync(ulong userId, RequestOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt64 | userId | The snowflake identifier for the banned user. |
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<IBan> | A task that represents the asynchronous get operation. The task result contains a ban object, which
contains the user information and the reason for the ban; |
IGuild.GetBansAsync(RequestOptions)
Gets a collection of all users banned in this guild.
Declaration
Task<IReadOnlyCollection<IBan>> IGuild.GetBansAsync(RequestOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<IBan>> | A task that represents the asynchronous get operation. The task result contains a read-only collection of ban objects that this guild currently possesses, with each object containing the user banned and reason behind the ban. |
IGuild.GetCategoriesAsync(CacheMode, RequestOptions)
Gets a collection of all category channels in this guild.
Declaration
Task<IReadOnlyCollection<ICategoryChannel>> IGuild.GetCategoriesAsync(CacheMode mode, RequestOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| CacheMode | mode | The CacheMode that determines whether the object should be fetched from cache. |
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<ICategoryChannel>> | A task that represents the asynchronous get operation. The task result contains a read-only collection of category channels found within this guild. |
IGuild.GetChannelAsync(UInt64, CacheMode, RequestOptions)
Gets a channel in this guild.
Declaration
Task<IGuildChannel> IGuild.GetChannelAsync(ulong id, CacheMode mode, RequestOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt64 | id | The snowflake identifier for the channel. |
| CacheMode | mode | The CacheMode that determines whether the object should be fetched from cache. |
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<IGuildChannel> | A task that represents the asynchronous get operation. The task result contains the generic channel
associated with the specified |
IGuild.GetChannelsAsync(CacheMode, RequestOptions)
Gets a collection of all channels in this guild.
Declaration
Task<IReadOnlyCollection<IGuildChannel>> IGuild.GetChannelsAsync(CacheMode mode, RequestOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| CacheMode | mode | The CacheMode that determines whether the object should be fetched from cache. |
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<IGuildChannel>> | A task that represents the asynchronous get operation. The task result contains a read-only collection of generic channels found within this guild. |
IGuild.GetCurrentUserAsync(CacheMode, RequestOptions)
Gets the current user for this guild.
Declaration
Task<IGuildUser> IGuild.GetCurrentUserAsync(CacheMode mode, RequestOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| CacheMode | mode | The CacheMode that determines whether the object should be fetched from cache. |
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<IGuildUser> | A task that represents the asynchronous get operation. The task result contains the currently logged-in user within this guild. |
IGuild.GetDefaultChannelAsync(CacheMode, RequestOptions)
Gets the first viewable text channel in this guild.
Declaration
Task<ITextChannel> IGuild.GetDefaultChannelAsync(CacheMode mode, RequestOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| CacheMode | mode | The CacheMode that determines whether the object should be fetched from cache. |
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<ITextChannel> | A task that represents the asynchronous get operation. The task result contains the first viewable text
channel in this guild; |
IGuild.GetEmbedChannelAsync(CacheMode, RequestOptions)
Gets the embed channel (i.e. the channel set in the guild's widget settings) in this guild.
Declaration
Task<IGuildChannel> IGuild.GetEmbedChannelAsync(CacheMode mode, RequestOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| CacheMode | mode | The CacheMode that determines whether the object should be fetched from cache. |
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<IGuildChannel> | A task that represents the asynchronous get operation. The task result contains the embed channel set
within the server's widget settings; |
IGuild.GetIntegrationsAsync(RequestOptions)
Declaration
Task<IReadOnlyCollection<IGuildIntegration>> IGuild.GetIntegrationsAsync(RequestOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| RequestOptions | options |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<IGuildIntegration>> |
IGuild.GetInvitesAsync(RequestOptions)
Gets a collection of all invites in this guild.
Declaration
Task<IReadOnlyCollection<IInviteMetadata>> IGuild.GetInvitesAsync(RequestOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<IInviteMetadata>> | A task that represents the asynchronous get operation. The task result contains a read-only collection of invite metadata, each representing information for an invite found within this guild. |
IGuild.GetOwnerAsync(CacheMode, RequestOptions)
Gets the owner of this guild.
Declaration
Task<IGuildUser> IGuild.GetOwnerAsync(CacheMode mode, RequestOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| CacheMode | mode | The CacheMode that determines whether the object should be fetched from cache. |
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<IGuildUser> | A task that represents the asynchronous get operation. The task result contains the owner of this guild. |
IGuild.GetRole(UInt64)
Gets a role in this guild.
Declaration
IRole IGuild.GetRole(ulong id)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt64 | id | The snowflake identifier for the role. |
Returns
| Type | Description |
|---|---|
| IRole | A role that is associated with the specified |
IGuild.GetSystemChannelAsync(CacheMode, RequestOptions)
Gets the system channel where randomized welcome messages are sent in this guild.
Declaration
Task<ITextChannel> IGuild.GetSystemChannelAsync(CacheMode mode, RequestOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| CacheMode | mode | The CacheMode that determines whether the object should be fetched from cache. |
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<ITextChannel> | A task that represents the asynchronous get operation. The task result contains the text channel where
randomized welcome messages will be sent to; |
IGuild.GetTextChannelAsync(UInt64, CacheMode, RequestOptions)
Gets a text channel in this guild.
Declaration
Task<ITextChannel> IGuild.GetTextChannelAsync(ulong id, CacheMode mode, RequestOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt64 | id | The snowflake identifier for the text channel. |
| CacheMode | mode | The CacheMode that determines whether the object should be fetched from cache. |
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<ITextChannel> | A task that represents the asynchronous get operation. The task result contains the text channel
associated with the specified |
IGuild.GetTextChannelsAsync(CacheMode, RequestOptions)
Gets a collection of all text channels in this guild.
Declaration
Task<IReadOnlyCollection<ITextChannel>> IGuild.GetTextChannelsAsync(CacheMode mode, RequestOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| CacheMode | mode | The CacheMode that determines whether the object should be fetched from cache. |
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<ITextChannel>> | A task that represents the asynchronous get operation. The task result contains a read-only collection of message channels found within this guild. |
IGuild.GetUserAsync(UInt64, CacheMode, RequestOptions)
Gets a user from this guild.
Declaration
Task<IGuildUser> IGuild.GetUserAsync(ulong id, CacheMode mode, RequestOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt64 | id | The snowflake identifier of the user. |
| CacheMode | mode | The CacheMode that determines whether the object should be fetched from cache. |
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<IGuildUser> | A task that represents the asynchronous get operation. The task result contains the guild user
associated with the specified |
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.
IGuild.GetUsersAsync(CacheMode, RequestOptions)
Gets a collection of all users in this guild.
Declaration
Task<IReadOnlyCollection<IGuildUser>> IGuild.GetUsersAsync(CacheMode mode, RequestOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| CacheMode | mode | The CacheMode that determines whether the object should be fetched from cache. |
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<IGuildUser>> | A task that represents the asynchronous get operation. The task result contains a collection of guild users found within this guild. |
Remarks
This method retrieves all users found within this guild.
note
This may return an incomplete collection in the WebSocket implementation due to how Discord does not send a complete user list for large guilds.
IGuild.GetVanityInviteAsync(RequestOptions)
Gets the vanity invite URL of this guild.
Declaration
Task<IInviteMetadata> IGuild.GetVanityInviteAsync(RequestOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<IInviteMetadata> | A task that represents the asynchronous get operation. The task result contains the partial metadata of
the vanity invite found within this guild; |
IGuild.GetVoiceChannelAsync(UInt64, CacheMode, RequestOptions)
Gets a voice channel in this guild.
Declaration
Task<IVoiceChannel> IGuild.GetVoiceChannelAsync(ulong id, CacheMode mode, RequestOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt64 | id | The snowflake identifier for the voice channel. |
| CacheMode | mode | The CacheMode that determines whether the object should be fetched from cache. |
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<IVoiceChannel> | A task that represents the asynchronous get operation. The task result contains the voice channel associated
with the specified |
IGuild.GetVoiceChannelsAsync(CacheMode, RequestOptions)
Gets a collection of all voice channels in this guild.
Declaration
Task<IReadOnlyCollection<IVoiceChannel>> IGuild.GetVoiceChannelsAsync(CacheMode mode, RequestOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| CacheMode | mode | The CacheMode that determines whether the object should be fetched from cache. |
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<IVoiceChannel>> | A task that represents the asynchronous get operation. The task result contains a read-only collection of voice channels found within this guild. |
IGuild.GetVoiceRegionsAsync(RequestOptions)
Gets a collection of all the voice regions this guild can access.
Declaration
Task<IReadOnlyCollection<IVoiceRegion>> IGuild.GetVoiceRegionsAsync(RequestOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<IVoiceRegion>> | A task that represents the asynchronous get operation. The task result contains a read-only collection of voice regions the guild can access. |
IGuild.GetWebhookAsync(UInt64, RequestOptions)
Gets a webhook found within this guild.
Declaration
Task<IWebhook> IGuild.GetWebhookAsync(ulong id, RequestOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt64 | id | The identifier for the webhook. |
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<IWebhook> | A task that represents the asynchronous get operation. The task result contains the webhook with the
specified |
IGuild.GetWebhooksAsync(RequestOptions)
Gets a collection of all webhook from this guild.
Declaration
Task<IReadOnlyCollection<IWebhook>> IGuild.GetWebhooksAsync(RequestOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| RequestOptions | options | The options to be used when sending the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<IWebhook>> | A task that represents the asynchronous get operation. The task result contains a read-only collection of webhooks found within the guild. |
IGuild.Roles
Gets a collection of all roles in this guild.
Declaration
IReadOnlyCollection<IRole> IGuild.Roles { get; }
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IReadOnlyCollection<IRole> | A read-only collection of roles found within this guild. |