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 |
---|---|
Nullable<UInt64> | A langword_csharp_ulong representing the snowflake identifier of the AFK voice channel; null if none is set. |
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 |
---|---|
Int32 | An langword_csharp_int 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 |
---|---|
Nullable<UInt64> | A langword_csharp_ulong representing the snowflake identifier of the application ID that created this guild, or null if it was not bot-created. |
ApproximateMemberCount
Gets the approximate number of members in this guild.
Declaration
int? ApproximateMemberCount { get; }
Property Value
Type | Description |
---|---|
Nullable<Int32> | The approximate number of members in this guild. |
Remarks
Only available when getting a guild via REST when with_counts
is true.
ApproximatePresenceCount
Gets the approximate number of non-offline members in this guild.
Declaration
int? ApproximatePresenceCount { get; }
Property Value
Type | Description |
---|---|
Nullable<Int32> | The approximate number of non-offline members in this guild. |
Remarks
Only available when getting a guild via REST when with_counts
is true.
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 |
---|---|
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 |
---|---|
String | An identifier for the banner image; null if none is set. |
BannerUrl
Gets the URL of this guild's banner image.
Declaration
string BannerUrl { get; }
Property Value
Type | Description |
---|---|
String | A URL pointing to the guild's banner image; null if none is set. |
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 |
---|---|
String | The description for the guild; null if none is set. |
DiscoverySplashId
Gets the ID of this guild's discovery splash image.
Declaration
string DiscoverySplashId { get; }
Property Value
Type | Description |
---|---|
String | An identifier for the discovery splash image; null if none is set. |
DiscoverySplashUrl
Gets the URL of this guild's discovery splash image.
Declaration
string DiscoverySplashUrl { get; }
Property Value
Type | Description |
---|---|
String | A URL pointing to the guild's discovery splash image; null if none is set. |
Emotes
Gets a collection of all custom emotes for this guild.
Declaration
IReadOnlyCollection<GuildEmote> Emotes { get; }
Property Value
Type | Description |
---|---|
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 the features for this guild.
Declaration
GuildFeatures Features { get; }
Property Value
Type | Description |
---|---|
GuildFeatures | A flags enum containing all the features for the guild. |
IconId
Gets the ID of this guild's icon.
Declaration
string IconId { get; }
Property Value
Type | Description |
---|---|
String | An identifier for the splash image; null if none is set. |
IconUrl
Gets the URL of this guild's icon.
Declaration
string IconUrl { get; }
Property Value
Type | Description |
---|---|
String | A URL pointing to the guild's icon; null if none is set. |
IsBoostProgressBarEnabled
Gets whether the guild has the boost progress bar enabled.
Declaration
bool IsBoostProgressBarEnabled { get; }
Property Value
Type | Description |
---|---|
Boolean | true if the boost progress bar is enabled; otherwise false. |
IsWidgetEnabled
Gets a value that indicates whether this guild has the widget enabled.
Declaration
bool IsWidgetEnabled { get; }
Property Value
Type | Description |
---|---|
Boolean | true if this guild has a widget enabled; otherwise false. |
MaxBitrate
Gets the max bitrate for voice channels in this guild.
Declaration
int MaxBitrate { get; }
Property Value
Type | Description |
---|---|
Int32 | A |
MaxMembers
Gets the maximum number of members for the guild.
Declaration
int? MaxMembers { get; }
Property Value
Type | Description |
---|---|
Nullable<Int32> | The maximum number of members for the guild. |
MaxPresences
Gets the maximum number of presences for the guild.
Declaration
int? MaxPresences { get; }
Property Value
Type | Description |
---|---|
Nullable<Int32> | The maximum number of presences for the guild. |
MaxStageVideoChannelUsers
Gets the maximum amount of users in a stage video channel.
Declaration
int? MaxStageVideoChannelUsers { get; }
Property Value
Type | Description |
---|---|
Nullable<Int32> | The maximum amount of users in a stage video channel. |
MaxUploadLimit
Gets the upload limit in bytes for this guild. This number is dependent on the guild's boost status.
Declaration
ulong MaxUploadLimit { get; }
Property Value
Type | Description |
---|---|
UInt64 |
MaxVideoChannelUsers
Gets the maximum amount of users in a video channel.
Declaration
int? MaxVideoChannelUsers { get; }
Property Value
Type | Description |
---|---|
Nullable<Int32> | The maximum amount of users in a video channel. |
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 |
---|---|
String | A string containing the name of this guild. |
NsfwLevel
Gets the NSFW level of this guild.
Declaration
NsfwLevel NsfwLevel { get; }
Property Value
Type | Description |
---|---|
NsfwLevel | The NSFW level of this guild. |
OwnerId
Gets the ID of the user that owns this guild.
Declaration
ulong OwnerId { get; }
Property Value
Type | Description |
---|---|
UInt64 | A langword_csharp_ulong 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 |
---|---|
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 |
---|---|
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 |
---|---|
Int32 | The number of premium subscribers of this guild; null if not available. |
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. |
PublicUpdatesChannelId
Gets the ID of the channel where admins and moderators of Community guilds receive notices from Discord.
Declaration
ulong? PublicUpdatesChannelId { get; }
Property Value
Type | Description |
---|---|
Nullable<UInt64> | A langword_csharp_ulong representing the snowflake identifier of the channel where admins and moderators of Community guilds receive notices from Discord; null if none is set. |
Roles
Gets a collection of all roles in this guild.
Declaration
IReadOnlyCollection<IRole> Roles { get; }
Property Value
Type | Description |
---|---|
IReadOnlyCollection<IRole> | A read-only collection of roles found within this guild. |
RulesChannelId
Gets the ID of the channel with the rules.
Declaration
ulong? RulesChannelId { get; }
Property Value
Type | Description |
---|---|
Nullable<UInt64> | A langword_csharp_ulong representing the snowflake identifier of the channel that contains the rules; null if none is set. |
SafetyAlertsChannelId
Gets the ID of the channel assigned to the safety alerts channel of this guild.
Declaration
ulong? SafetyAlertsChannelId { get; }
Property Value
Type | Description |
---|---|
Nullable<UInt64> | A langword_csharp_ulong representing the snowflake identifier of the safety alerts channel; null if none is set. |
SplashId
Gets the ID of this guild's splash image.
Declaration
string SplashId { get; }
Property Value
Type | Description |
---|---|
String | An identifier for the splash image; null if none is set. |
SplashUrl
Gets the URL of this guild's splash image.
Declaration
string SplashUrl { get; }
Property Value
Type | Description |
---|---|
String | A URL pointing to the guild's splash image; null if none is set. |
Stickers
Gets a collection of all custom stickers for this guild.
Declaration
IReadOnlyCollection<ICustomSticker> Stickers { get; }
Property Value
Type | Description |
---|---|
IReadOnlyCollection<ICustomSticker> | A read-only collection of all custom stickers for this guild. |
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 |
---|---|
Nullable<UInt64> | A langword_csharp_ulong representing the snowflake identifier of the system channel where randomized welcome messages are sent; null if none is set. |
VanityURLCode
Gets the code for this guild's vanity invite URL.
Declaration
string VanityURLCode { get; }
Property Value
Type | Description |
---|---|
String | A string containing the vanity invite code for this guild; null if none is set. |
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 |
---|---|
String | A string containing the identifier for the voice region that this guild uses (e.g. |
WidgetChannelId
Gets the ID of the channel assigned to the widget of this guild.
Declaration
ulong? WidgetChannelId { get; }
Property Value
Type | Description |
---|---|
Nullable<UInt64> | A langword_csharp_ulong representing the snowflake identifier of the channel assigned to the widget found within the widget settings of this guild; null if none is set. |
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. |
Int32 | pruneDays | The number of days to remove messages from this user for, and this number must be between [0, 7]. |
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 |
---|---|
Task | A task that represents the asynchronous add operation for the ban. |
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 |
---|---|---|
UInt64 | userId | The snowflake ID of the user to ban. |
Int32 | pruneDays | The number of days to remove messages from this user for, and this number must be between [0, 7]. |
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 |
---|---|
Task | A task that represents the asynchronous add operation for the ban. |
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 |
---|---|---|
UInt64 | userId | The snowflake identifier of the user. |
String | accessToken | The OAuth2 access token for the user, requested with the guilds.join scope. |
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 |
---|---|
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.
BulkOverwriteApplicationCommandsAsync(ApplicationCommandProperties[], RequestOptions)
Overwrites the application commands within this guild.
Declaration
Task<IReadOnlyCollection<IApplicationCommand>> BulkOverwriteApplicationCommandsAsync(ApplicationCommandProperties[] properties, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
ApplicationCommandProperties[] | properties | A collection of properties to use when creating the commands. |
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
Task<IReadOnlyCollection<IApplicationCommand>> | A task that represents the asynchronous creation operation. The task result contains a collection of commands that was created. |
CreateApplicationCommandAsync(ApplicationCommandProperties, RequestOptions)
Creates an application command within this guild.
Declaration
Task<IApplicationCommand> CreateApplicationCommandAsync(ApplicationCommandProperties properties, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
ApplicationCommandProperties | properties | The properties to use when creating the command. |
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
Task<IApplicationCommand> | A task that represents the asynchronous creation operation. The task result contains the command that was created. |
CreateAutoModRuleAsync(Action<AutoModRuleProperties>, RequestOptions)
Creates a new auto moderation rule.
Declaration
Task<IAutoModRule> CreateAutoModRuleAsync(Action<AutoModRuleProperties> props, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
Action<AutoModRuleProperties> | props | |
RequestOptions | options |
Returns
Type | Description |
---|---|
Task<IAutoModRule> | A task that represents the asynchronous creation operation. The task result contains the created IAutoModRule. |
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 |
---|---|---|
String | name | The new name for the category. |
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 |
---|---|
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 |
---|---|---|
String | name | The name of the guild emote. |
Image | image | The image of the new emote. |
Optional<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 |
---|---|
Task<GuildEmote> | A task that represents the asynchronous creation operation. The task result contains the created emote. |
CreateEventAsync(String, DateTimeOffset, GuildScheduledEventType, GuildScheduledEventPrivacyLevel, String, Nullable<DateTimeOffset>, Nullable<UInt64>, String, Nullable<Image>, RequestOptions)
Creates an event within this guild.
Declaration
Task<IGuildScheduledEvent> CreateEventAsync(string name, DateTimeOffset startTime, GuildScheduledEventType type, GuildScheduledEventPrivacyLevel privacyLevel = default(GuildScheduledEventPrivacyLevel), string description = null, DateTimeOffset? endTime = null, ulong? channelId = null, string location = null, Image? coverImage = null, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
String | name | The name of the event. |
DateTimeOffset | startTime | The start time of the event. |
GuildScheduledEventType | type | The type of the event. |
GuildScheduledEventPrivacyLevel | privacyLevel | The privacy level of the event. |
String | description | The description of the event. |
Nullable<DateTimeOffset> | endTime | The end time of the event. |
Nullable<UInt64> | channelId | The channel id of the event.
|
String | location | The location of the event; links are supported |
Nullable<Image> | coverImage | The optional banner image for the event. |
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
Task<IGuildScheduledEvent> | A task that represents the asynchronous create operation. |
CreateForumChannelAsync(String, Action<ForumChannelProperties>, RequestOptions)
Creates a new channel forum in this guild.
Declaration
Task<IForumChannel> CreateForumChannelAsync(string name, Action<ForumChannelProperties> func = null, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
String | name | The new name for the forum. |
Action<ForumChannelProperties> | 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 |
---|---|
Task<IForumChannel> | A task that represents the asynchronous creation operation. The task result contains the newly created forum channel. |
CreateRoleAsync(String, Nullable<GuildPermissions>, Nullable<Color>, Boolean, RequestOptions)
Creates a new role with the provided name.
Declaration
Task<IRole> CreateRoleAsync(string name, GuildPermissions? permissions = null, Color? color = null, bool isHoisted = false, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
String | name | The new name for the role. |
Nullable<GuildPermissions> | permissions | The guild permission that the role should possess. |
Nullable<Color> | color | The color of the role. |
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 |
---|---|
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 = null, Color? color = null, bool isHoisted = false, bool isMentionable = false, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
String | name | The new name for the role. |
Nullable<GuildPermissions> | permissions | The guild permission that the role should possess. |
Nullable<Color> | color | The color of the role. |
Boolean | isHoisted | Whether the role is separated from others on the sidebar. |
Boolean | isMentionable | Whether the role can be mentioned. |
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
Task<IRole> | A task that represents the asynchronous creation operation. The task result contains the newly created role. |
CreateStageChannelAsync(String, Action<VoiceChannelProperties>, RequestOptions)
Creates a new stage channel in this guild.
Declaration
Task<IStageChannel> CreateStageChannelAsync(string name, Action<VoiceChannelProperties> func = null, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
String | name | The new name for the stage channel. |
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 |
---|---|
Task<IStageChannel> | A task that represents the asynchronous creation operation. The task result contains the newly created stage channel. |
CreateStickerAsync(String, Image, IEnumerable<String>, String, RequestOptions)
Creates a new sticker in this guild.
Declaration
Task<ICustomSticker> CreateStickerAsync(string name, Image image, IEnumerable<string> tags, string description = null, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
String | name | The name of the sticker. |
Image | image | The image of the new emote. |
IEnumerable<String> | tags | The tags of the sticker. |
String | description | The description of the sticker. |
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
Task<ICustomSticker> | A task that represents the asynchronous creation operation. The task result contains the created sticker. |
CreateStickerAsync(String, Stream, String, IEnumerable<String>, String, RequestOptions)
Creates a new sticker in this guild.
Declaration
Task<ICustomSticker> CreateStickerAsync(string name, Stream stream, string filename, IEnumerable<string> tags, string description = null, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
String | name | The name of the sticker. |
Stream | stream | The stream containing the file data. |
String | filename | The name of the file with the extension, ex: image.png. |
IEnumerable<String> | tags | The tags of the sticker. |
String | description | The description of the sticker. |
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
Task<ICustomSticker> | A task that represents the asynchronous creation operation. The task result contains the created sticker. |
CreateStickerAsync(String, String, IEnumerable<String>, String, RequestOptions)
Creates a new sticker in this guild.
Declaration
Task<ICustomSticker> CreateStickerAsync(string name, string path, IEnumerable<string> tags, string description = null, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
String | name | The name of the sticker. |
String | path | The path of the file to upload. |
IEnumerable<String> | tags | The tags of the sticker. |
String | description | The description of the sticker. |
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
Task<ICustomSticker> | A task that represents the asynchronous creation operation. The task result contains the created sticker. |
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 |
---|---|---|
String | name | The new name for the text channel. |
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 |
---|---|
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 Wumpus
with a set topic.
|
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 |
---|---|---|
String | name | The new name for the voice channel. |
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 |
---|---|
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 |
---|---|
Task | A task that represents the asynchronous removal operation. |
DeleteIntegrationAsync(UInt64, RequestOptions)
Deletes an integration.
Declaration
Task DeleteIntegrationAsync(ulong id, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | id | The id for the integration. |
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
Task | A task that represents the asynchronous removal operation. |
DeleteStickerAsync(ICustomSticker, RequestOptions)
Deletes a sticker within this guild.
Declaration
Task DeleteStickerAsync(ICustomSticker sticker, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
ICustomSticker | sticker | The sticker to delete. |
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
Task | A task that represents the asynchronous removal operation. |
DisconnectAsync(IGuildUser)
Disconnects the user from its current voice channel.
Declaration
Task DisconnectAsync(IGuildUser user)
Parameters
Type | Name | Description |
---|---|---|
IGuildUser | user | The user to disconnect. |
Returns
Type | Description |
---|---|
Task | A task that represents the asynchronous operation for disconnecting a user. |
DownloadUsersAsync()
Downloads all users for this guild if the current list is incomplete.
Declaration
Task DownloadUsersAsync()
Returns
Type | Description |
---|---|
Task | A task that represents the asynchronous download operation. |
Remarks
This method downloads all users found within this guild through the Gateway and caches them.
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 |
---|---|
Task<IVoiceChannel> | A task that represents the asynchronous get operation. The task result contains the voice channel that the AFK users will be moved to after they have idled for too long; null if none is set. |
GetApplicationCommandAsync(UInt64, CacheMode, RequestOptions)
Gets an application command within this guild with the specified id.
Declaration
Task<IApplicationCommand> GetApplicationCommandAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | id | The id of the application command to get. |
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 |
---|---|
Task<IApplicationCommand> | A ValueTask that represents the asynchronous get operation. The task result contains a IApplicationCommand if found, otherwise null. |
GetApplicationCommandsAsync(Boolean, String, RequestOptions)
Gets this guilds application commands.
Declaration
Task<IReadOnlyCollection<IApplicationCommand>> GetApplicationCommandsAsync(bool withLocalizations = false, string locale = null, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
Boolean | withLocalizations | Whether to include full localization dictionaries in the returned objects, instead of the localized name and description fields. |
String | locale | The target locale of the localized name and description fields. Sets the |
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
Task<IReadOnlyCollection<IApplicationCommand>> | A task that represents the asynchronous get operation. The task result contains a read-only collection of application commands found within the guild. |
GetAuditLogsAsync(Int32, CacheMode, RequestOptions, Nullable<UInt64>, Nullable<UInt64>, Nullable<ActionType>, Nullable<UInt64>)
Gets the specified number of audit log entries for this guild.
Declaration
Task<IReadOnlyCollection<IAuditLogEntry>> GetAuditLogsAsync(int limit = null, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null, ulong? beforeId = null, ulong? userId = null, ActionType? actionType = null, ulong? afterId = null)
Parameters
Type | Name | Description |
---|---|---|
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. |
Nullable<UInt64> | beforeId | The audit log entry ID to get entries before. |
Nullable<UInt64> | userId | The user ID to filter entries for. |
Nullable<ActionType> | actionType | The type of actions to filter. |
Nullable<UInt64> | afterId | The audit log entry ID to get entries after. |
Returns
Type | Description |
---|---|
Task<IReadOnlyCollection<IAuditLogEntry>> | A task that represents the asynchronous get operation. The task result contains a read-only collection of the requested audit log entries. |
GetAutoModRuleAsync(UInt64, RequestOptions)
Gets a single rule configured in a guild. Returns null if the rule was not found.
Declaration
Task<IAutoModRule> GetAutoModRuleAsync(ulong ruleId, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | ruleId | |
RequestOptions | options |
Returns
Type | Description |
---|---|
Task<IAutoModRule> | A task that represents the asynchronous creation operation. The task result contains a IAutoModRule. |
GetAutoModRulesAsync(RequestOptions)
Get a list of all rules currently configured for the guild.
Declaration
Task<IAutoModRule[]> GetAutoModRulesAsync(RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
RequestOptions | options |
Returns
Type | Description |
---|---|
Task<IAutoModRule[]> | A task that represents the asynchronous creation operation. The task result contains a collection of IAutoModRule. |
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 |
---|---|
Task<IBan> | A task that represents the asynchronous get operation. The task result contains a ban object, which contains the user information and the reason for the ban; null if the ban entry cannot be found. |
GetBanAsync(UInt64, RequestOptions)
Gets a ban object for a banned user.
Declaration
Task<IBan> GetBanAsync(ulong userId, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | userId | The snowflake identifier for the banned user. |
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
Task<IBan> | A task that represents the asynchronous get operation. The task result contains a ban object, which contains the user information and the reason for the ban; null if the ban entry cannot be found. |
GetBansAsync(IUser, Direction, Int32, RequestOptions)
Gets limit
amount of bans from the guild starting at the provided fromUser
ordered by user ID.
Declaration
IAsyncEnumerable<IReadOnlyCollection<IBan>> GetBansAsync(IUser fromUser, Direction dir, int limit = null, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
IUser | fromUser | The user to start to get bans from. |
Direction | dir | The direction of the bans to be gotten. |
Int32 | limit | The number of bans to get. |
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
IAsyncEnumerable<IReadOnlyCollection<IBan>> | A paged collection of bans. |
Remarks
important
The returned collection is an asynchronous enumerable object; one must call FlattenAsync<T>(IAsyncEnumerable<IEnumerable<T>>) to access the individual messages as a collection.
warning
Do not fetch too many bans at once! This may cause unwanted preemptive rate limit or even actual rate limit, causing your bot to freeze!
GetBansAsync(Int32, RequestOptions)
Gets limit
amount of bans from the guild ordered by user ID.
Declaration
IAsyncEnumerable<IReadOnlyCollection<IBan>> GetBansAsync(int limit = null, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
Int32 | limit | The amount of bans to get from the guild. |
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
IAsyncEnumerable<IReadOnlyCollection<IBan>> | A paged collection of bans. |
Remarks
important
The returned collection is an asynchronous enumerable object; one must call FlattenAsync<T>(IAsyncEnumerable<IEnumerable<T>>) to access the individual messages as a collection.
warning
Do not fetch too many bans at once! This may cause unwanted preemptive rate limit or even actual rate limit, causing your bot to freeze!
GetBansAsync(UInt64, Direction, Int32, RequestOptions)
Gets limit
amount of bans from the guild starting at the provided fromUserId
ordered by user ID.
Declaration
IAsyncEnumerable<IReadOnlyCollection<IBan>> GetBansAsync(ulong fromUserId, Direction dir, int limit = null, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | fromUserId | The ID of the user to start to get bans from. |
Direction | dir | The direction of the bans to be gotten. |
Int32 | limit | The number of bans to get. |
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
IAsyncEnumerable<IReadOnlyCollection<IBan>> | A paged collection of bans. |
Remarks
important
The returned collection is an asynchronous enumerable object; one must call FlattenAsync<T>(IAsyncEnumerable<IEnumerable<T>>) to access the individual messages as a collection.
warning
Do not fetch too many bans at once! This may cause unwanted preemptive rate limit or even actual rate limit, causing your bot to freeze!
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 |
---|---|
Task<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 |
---|---|---|
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 |
---|---|
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 |
---|---|
Task<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 |
---|---|
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 |
---|---|
Task<ITextChannel> | A task that represents the asynchronous get operation. The task result contains the first viewable text channel in this guild; null if none is found. |
GetEmoteAsync(UInt64, RequestOptions)
Gets a specific emote from this guild.
Declaration
Task<GuildEmote> GetEmoteAsync(ulong id, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | id | The snowflake identifier for the guild emote. |
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
Task<GuildEmote> | A task that represents the asynchronous get operation. The task result contains the emote found with the
specified |
GetEmotesAsync(RequestOptions)
Gets a collection of emotes from this guild.
Declaration
Task<IReadOnlyCollection<GuildEmote>> GetEmotesAsync(RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
Task<IReadOnlyCollection<GuildEmote>> | A task that represents the asynchronous get operation. The task result contains a read-only collection of emotes found within the guild. |
GetEventAsync(UInt64, RequestOptions)
Gets a event within this guild.
Declaration
Task<IGuildScheduledEvent> GetEventAsync(ulong id, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | id | The id of the event. |
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
Task<IGuildScheduledEvent> | A task that represents the asynchronous get operation. |
GetEventsAsync(RequestOptions)
Gets a collection of events within this guild.
Declaration
Task<IReadOnlyCollection<IGuildScheduledEvent>> GetEventsAsync(RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
Task<IReadOnlyCollection<IGuildScheduledEvent>> | A task that represents the asynchronous get operation. |
GetIntegrationsAsync(RequestOptions)
Gets a collection of all the integrations this guild contains.
Declaration
Task<IReadOnlyCollection<IIntegration>> GetIntegrationsAsync(RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
Task<IReadOnlyCollection<IIntegration>> | A task that represents the asynchronous get operation. The task result contains a read-only collection of integrations the guild can has. |
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 |
---|---|
Task<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. |
GetOnboardingAsync(RequestOptions)
Gets the onboarding object configured for the guild.
Declaration
Task<IGuildOnboarding> GetOnboardingAsync(RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
RequestOptions | options |
Returns
Type | Description |
---|---|
Task<IGuildOnboarding> | A task that represents the asynchronous creation operation. The task result contains the created IGuildOnboarding. |
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 |
---|---|
Task<IGuildUser> | A task that represents the asynchronous get operation. The task result contains the owner of this guild. |
GetPublicUpdatesChannelAsync(CacheMode, RequestOptions)
Gets the text channel where admins and moderators of Community guilds receive notices from Discord.
Declaration
Task<ITextChannel> GetPublicUpdatesChannelAsync(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 |
---|---|
Task<ITextChannel> | A task that represents the asynchronous get operation. The task result contains the text channel where admins and moderators of Community guilds receive notices from Discord; null if none is set. |
GetRole(UInt64)
Gets a role in this guild.
Declaration
IRole GetRole(ulong id)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | id | The snowflake identifier for the role. |
Returns
Type | Description |
---|---|
IRole | A role that is associated with the specified |
GetRulesChannelAsync(CacheMode, RequestOptions)
Gets the text channel where Community guilds can display rules and/or guidelines.
Declaration
Task<ITextChannel> GetRulesChannelAsync(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 |
---|---|
Task<ITextChannel> | A task that represents the asynchronous get operation. The task result contains the text channel where Community guilds can display rules and/or guidelines; null if none is set. |
GetStageChannelAsync(UInt64, CacheMode, RequestOptions)
Gets a stage channel in this guild.
Declaration
Task<IStageChannel> GetStageChannelAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | id | The snowflake identifier for the stage 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 |
---|---|
Task<IStageChannel> | A task that represents the asynchronous get operation. The task result contains the stage channel associated
with the specified |
GetStageChannelsAsync(CacheMode, RequestOptions)
Gets a collection of all stage channels in this guild.
Declaration
Task<IReadOnlyCollection<IStageChannel>> GetStageChannelsAsync(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 |
---|---|
Task<IReadOnlyCollection<IStageChannel>> | A task that represents the asynchronous get operation. The task result contains a read-only collection of stage channels found within this guild. |
GetStickerAsync(UInt64, CacheMode, RequestOptions)
Gets a specific sticker within this guild.
Declaration
Task<ICustomSticker> GetStickerAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | id | The id of the sticker to get. |
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 |
---|---|
Task<ICustomSticker> | A task that represents the asynchronous get operation. The task result contains the sticker found with the
specified |
GetStickersAsync(CacheMode, RequestOptions)
Gets a collection of all stickers within this guild.
Declaration
Task<IReadOnlyCollection<ICustomSticker>> GetStickersAsync(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 |
---|---|
Task<IReadOnlyCollection<ICustomSticker>> | A task that represents the asynchronous get operation. The task result contains a read-only collection of stickers found within the guild. |
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 |
---|---|
Task<ITextChannel> | A task that represents the asynchronous get operation. The task result contains the text channel where randomized welcome messages will be sent to; null if none is set. |
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 |
---|---|---|
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 |
---|---|
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 |
---|---|
Task<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. |
GetThreadChannelAsync(UInt64, CacheMode, RequestOptions)
Gets a thread channel within this guild.
Declaration
Task<IThreadChannel> GetThreadChannelAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | id | The id of the thread 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 |
---|---|
Task<IThreadChannel> | A task that represents the asynchronous get operation. The task result contains the thread channel. |
GetThreadChannelsAsync(CacheMode, RequestOptions)
Gets a collection of all thread channels in this guild.
Declaration
Task<IReadOnlyCollection<IThreadChannel>> GetThreadChannelsAsync(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 |
---|---|
Task<IReadOnlyCollection<IThreadChannel>> | A task that represents the asynchronous get operation. The task result contains a read-only collection of thread 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 |
---|---|---|
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 |
---|---|
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 |
---|---|
Task<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 |
---|---|
Task<IInviteMetadata> | A task that represents the asynchronous get operation. The task result contains the partial metadata of the vanity invite found within this guild; null if none is found. |
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 |
---|---|---|
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 |
---|---|
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 |
---|---|
Task<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 |
---|---|
Task<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 |
---|---|---|
UInt64 | id | The identifier for the webhook. |
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
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 |
---|---|
Task<IReadOnlyCollection<IWebhook>> | A task that represents the asynchronous get operation. The task result contains a read-only collection of webhooks found within the guild. |
GetWelcomeScreenAsync(RequestOptions)
Gets the welcome screen of the guild. Returns null if the welcome channel is not set.
Declaration
Task<WelcomeScreen> GetWelcomeScreenAsync(RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
RequestOptions | options |
Returns
Type | Description |
---|---|
Task<WelcomeScreen> | A task that represents the asynchronous creation operation. The task result contains a WelcomeScreen. |
GetWidgetChannelAsync(CacheMode, RequestOptions)
Gets the widget channel (i.e. the channel set in the guild's widget settings) in this guild.
Declaration
Task<IGuildChannel> GetWidgetChannelAsync(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 |
---|---|
Task<IGuildChannel> | A task that represents the asynchronous get operation. The task result contains the widget channel set within the server's widget settings; null if none is set. |
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 |
---|---|
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 |
---|---|---|
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 |
---|---|
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. |
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 |
---|---|
Task<GuildEmote> | A task that represents the asynchronous modification operation. The task result contains the modified emote. |
ModifyWelcomeScreenAsync(Boolean, WelcomeScreenChannelProperties[], String, RequestOptions)
Modifies the welcome screen of the guild. Returns null if welcome screen is removed.
Declaration
Task<WelcomeScreen> ModifyWelcomeScreenAsync(bool enabled, WelcomeScreenChannelProperties[] channels, string description = null, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
Boolean | enabled | |
WelcomeScreenChannelProperties[] | channels | |
String | description | |
RequestOptions | options |
Returns
Type | Description |
---|---|
Task<WelcomeScreen> | A task that represents the asynchronous creation operation. The task result contains a WelcomeScreen. |
ModifyWidgetAsync(Action<GuildWidgetProperties>, RequestOptions)
Modifies this guild's widget.
Declaration
Task ModifyWidgetAsync(Action<GuildWidgetProperties> func, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
Action<GuildWidgetProperties> | 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 |
---|---|
Task | A task that represents the asynchronous modification operation. |
MoveAsync(IGuildUser, IVoiceChannel)
Moves the user to the voice channel.
Declaration
Task MoveAsync(IGuildUser user, IVoiceChannel targetChannel)
Parameters
Type | Name | Description |
---|---|---|
IGuildUser | user | The user to move. |
IVoiceChannel | targetChannel | the channel where the user gets moved to. |
Returns
Type | Description |
---|---|
Task | A task that represents the asynchronous operation for moving a user. |
PruneUsersAsync(Int32, Boolean, RequestOptions, IEnumerable<UInt64>)
Prunes inactive users.
Declaration
Task<int> PruneUsersAsync(int days = 30, bool simulate = false, RequestOptions options = null, IEnumerable<ulong> includeRoleIds = null)
Parameters
Type | Name | Description |
---|---|---|
Int32 | days | The number of days required for the users to be kicked. |
Boolean | simulate | Whether this prune action is a simulation. |
RequestOptions | options | The options to be used when sending the request. |
IEnumerable<UInt64> | includeRoleIds | An array of role IDs to be included in the prune of users who do not have any additional roles. |
Returns
Type | Description |
---|---|
Task<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 |
---|---|
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 |
---|---|---|
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 |
---|---|
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 |
---|---|---|
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 |
---|---|
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 |
---|---|---|
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 |
---|---|
Task | A task that represents the asynchronous reorder operation. |
SearchUsersAsync(String, Int32, CacheMode, RequestOptions)
Gets a collection of users in this guild that the name or nickname starts with the
provided query
.
Declaration
Task<IReadOnlyCollection<IGuildUser>> SearchUsersAsync(string query, int limit = null, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
String | query | The partial name or nickname to search. |
Int32 | limit | The maximum number of users to be gotten. |
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 |
---|---|
Task<IReadOnlyCollection<IGuildUser>> | A task that represents the asynchronous get operation. The task result contains a collection of guild
users that the name or nickname starts with the provided |
Remarks
The limit
can not be higher than MaxUsersPerBatch.