Class RestGuild
Represents a REST-based guild/server.
public class RestGuild : RestEntity<ulong>, IGuild, IDeletable, ISnowflakeEntity, IEntity<ulong>, IUpdateable
- Inheritance
-
RestGuild
- Implements
- Inherited Members
- Extension Methods
Properties
AFKChannelId
Gets the ID of the AFK voice channel for this guild.
public ulong? AFKChannelId { get; }
Property Value
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.
public int AFKTimeout { get; }
Property Value
- int
An 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.
public ulong? ApplicationId { get; }
Property Value
- ulong?
A 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.
public int? ApproximateMemberCount { get; }
Property Value
- int?
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.
public int? ApproximatePresenceCount { get; }
Property Value
- int?
The approximate number of non-offline members in this guild.
Remarks
Only available when getting a guild via REST when with_counts is true.
BannerId
Gets the identifier for this guilds banner image.
public string BannerId { get; }
Property Value
BannerUrl
Gets the URL of this guild's banner image.
public string BannerUrl { get; }
Property Value
CreatedAt
Gets when the snowflake was created.
public DateTimeOffset CreatedAt { get; }
Property Value
- DateTimeOffset
A DateTimeOffset representing when the entity was first created.
DefaultMessageNotifications
Gets the default message notifications for users who haven't explicitly set their notification settings.
public DefaultMessageNotifications DefaultMessageNotifications { get; }
Property Value
Description
Gets the description for the guild.
public string Description { get; }
Property Value
DiscoverySplashId
Gets the ID of this guild's discovery splash image.
public string DiscoverySplashId { get; }
Property Value
DiscoverySplashUrl
Gets the URL of this guild's discovery splash image.
public string DiscoverySplashUrl { get; }
Property Value
Emotes
Gets a collection of all custom emotes for this guild.
public IReadOnlyCollection<GuildEmote> Emotes { get; }
Property Value
- 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.
public RestRole EveryoneRole { get; }
Property Value
ExplicitContentFilter
Gets the level of content filtering applied to user's content in a Guild.
public ExplicitContentFilterLevel ExplicitContentFilter { get; }
Property Value
- ExplicitContentFilterLevel
The level of explicit content filtering.
Features
Gets the features for this guild.
public GuildFeatures Features { get; }
Property Value
- GuildFeatures
A flags enum containing all the features for the guild.
IconId
Gets the ID of this guild's icon.
public string IconId { get; }
Property Value
IconUrl
Gets the URL of this guild's icon.
public string IconUrl { get; }
Property Value
IncidentsData
Gets the incidents data for this guild.
public GuildIncidentsData IncidentsData { get; }
Property Value
InventorySettings
Get the inventory settings on the guild. null if not available in the guild.
public GuildInventorySettings? InventorySettings { get; }
Property Value
IsBoostProgressBarEnabled
Gets whether the guild has the boost progress bar enabled.
public bool IsBoostProgressBarEnabled { get; }
Property Value
IsWidgetEnabled
Gets a value that indicates whether this guild has the widget enabled.
public bool IsWidgetEnabled { get; }
Property Value
MaxBitrate
Gets the max bitrate for voice channels in this guild.
public int MaxBitrate { get; }
Property Value
MaxMembers
Gets the maximum number of members for the guild.
public int? MaxMembers { get; }
Property Value
- int?
The maximum number of members for the guild.
MaxPresences
Gets the maximum number of presences for the guild.
public int? MaxPresences { get; }
Property Value
- int?
The maximum number of presences for the guild.
MaxStageVideoChannelUsers
Gets the maximum amount of users in a stage video channel.
public int? MaxStageVideoChannelUsers { get; }
Property Value
- int?
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.
public ulong MaxUploadLimit { get; }
Property Value
MaxVideoChannelUsers
Gets the maximum amount of users in a video channel.
public int? MaxVideoChannelUsers { get; }
Property Value
- int?
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.
public MfaLevel MfaLevel { get; }
Property Value
- MfaLevel
The level of MFA requirement.
Name
Gets the name of this guild.
public string Name { get; }
Property Value
- string
A string containing the name of this guild.
NsfwLevel
Gets the NSFW level of this guild.
public NsfwLevel NsfwLevel { get; }
Property Value
- NsfwLevel
The NSFW level of this guild.
OwnerId
Gets the ID of the user that owns this guild.
public ulong OwnerId { get; }
Property Value
PreferredCulture
Gets the preferred culture of this guild.
public CultureInfo PreferredCulture { get; }
Property Value
- CultureInfo
The preferred culture information of this guild.
PreferredLocale
Gets the preferred locale of this guild in IETF BCP 47 language tag format.
public string PreferredLocale { get; }
Property Value
- string
The preferred locale of the guild in IETF BCP 47 language tag format.
PremiumSubscriptionCount
Gets the number of premium subscribers of this guild.
public int PremiumSubscriptionCount { get; }
Property Value
- int
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.
public PremiumTier PremiumTier { get; }
Property Value
- 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.
public ulong? PublicUpdatesChannelId { get; }
Property Value
- ulong?
A 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.
public IReadOnlyCollection<RestRole> Roles { get; }
Property Value
RulesChannelId
Gets the ID of the channel with the rules.
public ulong? RulesChannelId { get; }
Property Value
- ulong?
A 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.
public ulong? SafetyAlertsChannelId { get; }
Property Value
- ulong?
A 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.
public string SplashId { get; }
Property Value
SplashUrl
Gets the URL of this guild's splash image.
public string SplashUrl { get; }
Property Value
Stickers
public IReadOnlyCollection<CustomSticker> Stickers { get; }
Property Value
SystemChannelFlags
Gets the flags for the types of system channel messages that are disabled.
public SystemChannelMessageDeny SystemChannelFlags { get; }
Property Value
- 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.
public ulong? SystemChannelId { get; }
Property Value
- ulong?
A 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.
public string VanityURLCode { get; }
Property Value
VerificationLevel
Gets the level of requirements a user must fulfill before being allowed to post messages in this guild.
public VerificationLevel VerificationLevel { get; }
Property Value
- VerificationLevel
The level of requirements.
VoiceRegionId
Gets the ID of the region hosting this guild's voice channels.
public string VoiceRegionId { get; }
Property Value
- string
A string containing the identifier for the voice region that this guild uses (e.g.
eu-central).
WidgetChannelId
Gets the ID of the channel assigned to the widget of this guild.
public ulong? WidgetChannelId { get; }
Property Value
- ulong?
A 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
AddBanAsync(IUser, int, string, RequestOptions)
Bans the user from this guild and optionally prunes their recent messages.
public Task AddBanAsync(IUser user, int pruneDays = 0, string reason = null, RequestOptions options = null)
Parameters
userIUserThe user to ban.
pruneDaysintThe number of days to remove messages from this user for, and this number must be between [0, 7].
reasonstringThe reason of the ban to be written in the audit log.
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task
A task that represents the asynchronous add operation for the ban.
Exceptions
- ArgumentException
pruneDaysis not between 0 to 7.
AddBanAsync(ulong, int, string, RequestOptions)
Bans the user from this guild and optionally prunes their recent messages.
public Task AddBanAsync(ulong userId, int pruneDays = 0, string reason = null, RequestOptions options = null)
Parameters
userIdulongThe snowflake ID of the user to ban.
pruneDaysintThe number of days to remove messages from this user for, and this number must be between [0, 7].
reasonstringThe reason of the ban to be written in the audit log.
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task
A task that represents the asynchronous add operation for the ban.
Exceptions
- ArgumentException
pruneDaysis not between 0 to 7.
AddGuildUserAsync(ulong, string, Action<AddGuildUserProperties>, RequestOptions)
public Task<RestGuildUser> AddGuildUserAsync(ulong id, string accessToken, Action<AddGuildUserProperties> func = null, RequestOptions options = null)
Parameters
idulongaccessTokenstringfuncAction<AddGuildUserProperties>optionsRequestOptions
Returns
BanUserAsync(IUser, uint, RequestOptions)
Bans the user from this guild and optionally prunes their recent messages.
public Task BanUserAsync(IUser user, uint pruneSeconds = 0, RequestOptions options = null)
Parameters
userIUserThe user to ban.
pruneSecondsuintThe number of seconds to remover messages from this user for, between 0 and 604800
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task
A task that represents the asynchronous add operation for the ban.
BanUserAsync(ulong, uint, RequestOptions)
Bans the user from this guild and optionally prunes their recent messages.
public Task BanUserAsync(ulong userId, uint pruneSeconds = 0, RequestOptions options = null)
Parameters
userIdulongThe ID of the user to ban.
pruneSecondsuintThe number of seconds to remover messages from this user for, between 0 and 604800
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task
A task that represents the asynchronous add operation for the ban.
BulkBanAsync(IEnumerable<ulong>, int?, RequestOptions)
Executes a bulk ban on the specified users.
public Task<BulkBanResult> BulkBanAsync(IEnumerable<ulong> userIds, int? deleteMessageSeconds = null, RequestOptions options = null)
Parameters
userIdsIEnumerable<ulong>A collection of user ids to ban.
deleteMessageSecondsint?The number of seconds to delete messages for. Max 604800.
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task<BulkBanResult>
A task that represents the asynchronous creation operation. The task result contains a BulkBanResult.
BulkOverwriteApplicationCommandsAsync(ApplicationCommandProperties[], RequestOptions)
Overwrites the application commands within this guild.
public Task<IReadOnlyCollection<RestGuildCommand>> BulkOverwriteApplicationCommandsAsync(ApplicationCommandProperties[] properties, RequestOptions options = null)
Parameters
propertiesApplicationCommandProperties[]A collection of properties to use when creating the commands.
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task<IReadOnlyCollection<RestGuildCommand>>
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.
public Task<RestGuildCommand> CreateApplicationCommandAsync(ApplicationCommandProperties properties, RequestOptions options = null)
Parameters
propertiesApplicationCommandPropertiesThe properties to use when creating the command.
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task<RestGuildCommand>
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.
public Task<RestAutoModRule> CreateAutoModRuleAsync(Action<AutoModRuleProperties> props, RequestOptions options = null)
Parameters
propsAction<AutoModRuleProperties>optionsRequestOptions
Returns
- Task<RestAutoModRule>
A task that represents the asynchronous creation operation. The task result contains the created IAutoModRule.
CreateCategoryChannelAsync(string, Action<GuildChannelProperties>, RequestOptions)
Creates a category channel with the provided name.
public Task<RestCategoryChannel> CreateCategoryChannelAsync(string name, Action<GuildChannelProperties> func = null, RequestOptions options = null)
Parameters
namestringThe name of the new channel.
funcAction<GuildChannelProperties>The delegate containing the properties to be applied to the channel upon its creation.
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task<RestCategoryChannel>
The created category channel.
Exceptions
- ArgumentNullException
nameis null.
CreateEmoteAsync(string, Image, Optional<IEnumerable<IRole>>, RequestOptions)
Creates a new GuildEmote in this guild.
public Task<GuildEmote> CreateEmoteAsync(string name, Image image, Optional<IEnumerable<IRole>> roles = default, RequestOptions options = null)
Parameters
namestringThe name of the guild emote.
imageImageThe image of the new emote.
rolesOptional<IEnumerable<IRole>>The roles to limit the emote usage to.
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task<GuildEmote>
A task that represents the asynchronous creation operation. The task result contains the created emote.
CreateEventAsync(string, DateTimeOffset, GuildScheduledEventType, GuildScheduledEventPrivacyLevel, string, DateTimeOffset?, ulong?, string, Image?, RequestOptions, GuildScheduledEventRecurrenceRuleProperties)
Creates an event within this guild.
public Task<RestGuildEvent> CreateEventAsync(string name, DateTimeOffset startTime, GuildScheduledEventType type, GuildScheduledEventPrivacyLevel privacyLevel = GuildScheduledEventPrivacyLevel.Private, string description = null, DateTimeOffset? endTime = null, ulong? channelId = null, string location = null, Image? coverImage = null, RequestOptions options = null, GuildScheduledEventRecurrenceRuleProperties recurrenceRule = null)
Parameters
namestringThe name of the event.
startTimeDateTimeOffsetThe start time of the event.
typeGuildScheduledEventTypeThe type of the event.
privacyLevelGuildScheduledEventPrivacyLevelThe privacy level of the event.
descriptionstringThe description of the event.
endTimeDateTimeOffset?The end time of the event.
channelIdulong?The channel id of the event.
The event must have a type of Stage or Voice in order to use this property. locationstringThe location of the event; links are supported
coverImageImage?The optional banner image for the event.
optionsRequestOptionsThe options to be used when sending the request.
recurrenceRuleGuildScheduledEventRecurrenceRulePropertiesThe definition for how often this event should recur.
Returns
- Task<RestGuildEvent>
A task that represents the asynchronous create operation.
CreateForumChannelAsync(string, Action<ForumChannelProperties>, RequestOptions)
Creates a new forum channel with the provided name.
public Task<RestForumChannel> CreateForumChannelAsync(string name, Action<ForumChannelProperties> func = null, RequestOptions options = null)
Parameters
namestringThe name of the new channel.
funcAction<ForumChannelProperties>The delegate containing the properties to be applied to the channel upon its creation.
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task<RestForumChannel>
The created forum channel.
Exceptions
- ArgumentNullException
nameis null.
CreateMediaChannelAsync(string, Action<ForumChannelProperties>, RequestOptions)
Creates a new media channel in this guild.
public Task<RestMediaChannel> CreateMediaChannelAsync(string name, Action<ForumChannelProperties> func = null, RequestOptions options = null)
Parameters
namestringThe new name for the media channel.
funcAction<ForumChannelProperties>The delegate containing the properties to be applied to the channel upon its creation.
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task<RestMediaChannel>
A task that represents the asynchronous creation operation. The task result contains the newly created media channel.
CreateNewsChannelAsync(string, Action<TextChannelProperties>, RequestOptions)
Creates a new announcement channel in this guild.
public Task<RestNewsChannel> CreateNewsChannelAsync(string name, Action<TextChannelProperties> func = null, RequestOptions options = null)
Parameters
namestringThe new name for the announcement channel.
funcAction<TextChannelProperties>The delegate containing the properties to be applied to the channel upon its creation.
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task<RestNewsChannel>
A task that represents the asynchronous creation operation. The task result contains the newly created announcement channel.
Remarks
Announcement channels are only available in Community guilds.
CreateRoleAsync(string, GuildPermissions?, Color?, bool, bool, RequestOptions, Image?, Emoji)
Creates a new role with the provided name.
public Task<RestRole> CreateRoleAsync(string name, GuildPermissions? permissions = null, Color? color = null, bool isHoisted = false, bool isMentionable = false, RequestOptions options = null, Image? icon = null, Emoji emoji = null)
Parameters
namestringThe new name for the role.
permissionsGuildPermissions?The guild permission that the role should possess.
colorColor?The color of the role.
isHoistedboolWhether the role is separated from others on the sidebar.
isMentionableboolWhether the role can be mentioned.
optionsRequestOptionsThe options to be used when sending the request.
iconImage?The icon for the role.
emojiEmojiThe unicode emoji to be used as an icon for the role.
Returns
- Task<RestRole>
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.
public Task<RestStageChannel> CreateStageChannelAsync(string name, Action<VoiceChannelProperties> func = null, RequestOptions options = null)
Parameters
namestringThe new name for the stage channel.
funcAction<VoiceChannelProperties>The delegate containing the properties to be applied to the channel upon its creation.
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task<RestStageChannel>
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.
public Task<CustomSticker> CreateStickerAsync(string name, Image image, IEnumerable<string> tags, string description = null, RequestOptions options = null)
Parameters
namestringThe name of the sticker.
imageImageThe image of the new emote.
tagsIEnumerable<string>The tags of the sticker.
descriptionstringThe description of the sticker.
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task<CustomSticker>
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
public Task<CustomSticker> CreateStickerAsync(string name, Stream stream, string filename, IEnumerable<string> tags, string description = null, RequestOptions options = null)
Parameters
namestringThe name of the sticker.
streamStreamThe stream containing the file data.
filenamestringThe name of the file with the extension, ex: image.png.
tagsIEnumerable<string>The tags of the sticker.
descriptionstringThe description of the sticker.
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task<CustomSticker>
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
public Task<CustomSticker> CreateStickerAsync(string name, string path, IEnumerable<string> tags, string description = null, RequestOptions options = null)
Parameters
namestringThe name of the sticker.
pathstringThe path of the file to upload.
tagsIEnumerable<string>The tags of the sticker.
descriptionstringThe description of the sticker.
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task<CustomSticker>
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.
public Task<RestTextChannel> CreateTextChannelAsync(string name, Action<TextChannelProperties> func = null, RequestOptions options = null)
Parameters
namestringThe new name for the text channel.
funcAction<TextChannelProperties>The delegate containing the properties to be applied to the channel upon its creation.
optionsRequestOptionsThe options to be used when sending the request.
Returns
- 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}.";
});
CreateVoiceChannelAsync(string, Action<VoiceChannelProperties>, RequestOptions)
Creates a voice channel with the provided name.
public Task<RestVoiceChannel> CreateVoiceChannelAsync(string name, Action<VoiceChannelProperties> func = null, RequestOptions options = null)
Parameters
namestringThe name of the new channel.
funcAction<VoiceChannelProperties>The delegate containing the properties to be applied to the channel upon its creation.
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task<RestVoiceChannel>
The created voice channel.
Exceptions
- ArgumentNullException
nameis null.
DeleteAsync(RequestOptions)
Deletes this object and all its children.
public Task DeleteAsync(RequestOptions options = null)
Parameters
optionsRequestOptionsThe options to be used when sending the request.
Returns
DeleteEmoteAsync(GuildEmote, RequestOptions)
Deletes an existing GuildEmote from this guild.
public Task DeleteEmoteAsync(GuildEmote emote, RequestOptions options = null)
Parameters
emoteGuildEmoteThe emote to delete.
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task
A task that represents the asynchronous removal operation.
DeleteIntegrationAsync(ulong, RequestOptions)
public Task DeleteIntegrationAsync(ulong id, RequestOptions options = null)
Parameters
idulongoptionsRequestOptions
Returns
DeleteSlashCommandsAsync(RequestOptions)
Deletes all slash commands in the current guild.
public Task DeleteSlashCommandsAsync(RequestOptions options = null)
Parameters
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task
A task that represents the asynchronous delete operation.
DeleteStickerAsync(CustomSticker, RequestOptions)
Deletes a sticker within this guild.
public Task DeleteStickerAsync(CustomSticker sticker, RequestOptions options = null)
Parameters
stickerCustomStickerThe sticker to delete.
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task
A task that represents the asynchronous removal operation.
GetAFKChannelAsync(RequestOptions)
Gets the AFK voice channel in this guild.
public Task<RestVoiceChannel> GetAFKChannelAsync(RequestOptions options = null)
Parameters
optionsRequestOptionsThe options to be used when sending the request.
Returns
- 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; null if none is set.
GetApplicationCommandAsync(ulong, RequestOptions)
Gets an application command within this guild with the specified id.
public Task<RestGuildCommand> GetApplicationCommandAsync(ulong id, RequestOptions options = null)
Parameters
idulongThe id of the application command to get.
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task<RestGuildCommand>
A ValueTask that represents the asynchronous get operation. The task result contains a IApplicationCommand if found, otherwise null.
GetApplicationCommandsAsync(bool, string, RequestOptions)
Gets this guilds slash commands
public Task<IReadOnlyCollection<RestGuildCommand>> GetApplicationCommandsAsync(bool withLocalizations = false, string locale = null, RequestOptions options = null)
Parameters
withLocalizationsboolWhether to include full localization dictionaries in the returned objects, instead of the name localized and description localized fields.
localestringThe target locale of the localized name and description fields. Sets
X-Discord-Localeheader, which takes precedence overAccept-Language.optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task<IReadOnlyCollection<RestGuildCommand>>
A task that represents the asynchronous get operation. The task result contains a read-only collection of application commands found within the guild.
GetAuditLogsAsync(int, RequestOptions, ulong?, ulong?, ActionType?, ulong?)
Gets the specified number of audit log entries for this guild.
public IAsyncEnumerable<IReadOnlyCollection<RestAuditLogEntry>> GetAuditLogsAsync(int limit, RequestOptions options = null, ulong? beforeId = null, ulong? userId = null, ActionType? actionType = null, ulong? afterId = null)
Parameters
limitintThe number of audit log entries to fetch.
optionsRequestOptionsThe options to be used when sending the request.
beforeIdulong?The audit log entry ID to get entries before.
userIdulong?The user ID to filter entries for.
actionTypeActionType?The type of actions to filter.
afterIdulong?The audit log entry ID to get entries after.
Returns
- IAsyncEnumerable<IReadOnlyCollection<RestAuditLogEntry>>
A task that represents the asynchronous get operation. The task result contains a read-only collection of the requested audit log entries.
GetAutoModRuleAsync(ulong, RequestOptions)
Gets a single rule configured in a guild. Returns null if the rule was not found.
public Task<RestAutoModRule> GetAutoModRuleAsync(ulong ruleId, RequestOptions options = null)
Parameters
ruleIdulongoptionsRequestOptions
Returns
- Task<RestAutoModRule>
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.
public Task<RestAutoModRule[]> GetAutoModRulesAsync(RequestOptions options = null)
Parameters
optionsRequestOptions
Returns
- Task<RestAutoModRule[]>
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.
public Task<RestBan> GetBanAsync(IUser user, RequestOptions options = null)
Parameters
userIUserThe banned user.
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task<RestBan>
A task that represents the asynchronous get operation. The task result contains a ban object, which contains the user information and the reason for the ban; null if the ban entry cannot be found.
GetBanAsync(ulong, RequestOptions)
Gets a ban object for a banned user.
public Task<RestBan> GetBanAsync(ulong userId, RequestOptions options = null)
Parameters
userIdulongThe snowflake identifier for the banned user.
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task<RestBan>
A task that represents the asynchronous get operation. The task result contains a ban object, which contains the user information and the reason for the ban; null if the ban entry cannot be found.
GetBansAsync(IUser, Direction, int, RequestOptions)
Gets limit amount of bans from the guild starting at the provided fromUser ordered by user ID.
public IAsyncEnumerable<IReadOnlyCollection<RestBan>> GetBansAsync(IUser fromUser, Direction dir, int limit = 1000, RequestOptions options = null)
Parameters
fromUserIUserThe user to start to get bans from.
dirDirectionThe direction of the bans to be gotten.
limitintThe number of bans to get.
optionsRequestOptionsThe options to be used when sending the request.
Returns
- IAsyncEnumerable<IReadOnlyCollection<RestBan>>
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(int, RequestOptions)
Gets limit amount of bans from the guild ordered by user ID.
public IAsyncEnumerable<IReadOnlyCollection<RestBan>> GetBansAsync(int limit = 1000, RequestOptions options = null)
Parameters
limitintThe amount of bans to get from the guild.
optionsRequestOptionsThe options to be used when sending the request.
Returns
- IAsyncEnumerable<IReadOnlyCollection<RestBan>>
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(ulong, Direction, int, RequestOptions)
Gets limit amount of bans from the guild starting at the provided fromUserId ordered by user ID.
public IAsyncEnumerable<IReadOnlyCollection<RestBan>> GetBansAsync(ulong fromUserId, Direction dir, int limit = 1000, RequestOptions options = null)
Parameters
fromUserIdulongThe ID of the user to start to get bans from.
dirDirectionThe direction of the bans to be gotten.
limitintThe number of bans to get.
optionsRequestOptionsThe options to be used when sending the request.
Returns
- IAsyncEnumerable<IReadOnlyCollection<RestBan>>
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!
GetCategoryChannelsAsync(RequestOptions)
Gets a collection of all category channels in this guild.
public Task<IReadOnlyCollection<RestCategoryChannel>> GetCategoryChannelsAsync(RequestOptions options = null)
Parameters
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task<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(ulong, RequestOptions)
Gets a channel in this guild.
public Task<RestGuildChannel> GetChannelAsync(ulong id, RequestOptions options = null)
Parameters
idulongThe snowflake identifier for the channel.
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task<RestGuildChannel>
A task that represents the asynchronous get operation. The task result contains the generic channel associated with the specified
id; null if none is found.
GetChannelsAsync(RequestOptions)
Gets a collection of all channels in this guild.
public Task<IReadOnlyCollection<RestGuildChannel>> GetChannelsAsync(RequestOptions options = null)
Parameters
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task<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.
public Task<RestGuildUser> GetCurrentUserAsync(RequestOptions options = null)
Parameters
optionsRequestOptionsThe options to be used when sending the request.
Returns
- 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.
public Task<RestTextChannel> GetDefaultChannelAsync(RequestOptions options = null)
Parameters
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task<RestTextChannel>
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(ulong, RequestOptions)
Gets a specific emote from this guild.
public Task<GuildEmote> GetEmoteAsync(ulong id, RequestOptions options = null)
Parameters
idulongThe snowflake identifier for the guild emote.
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task<GuildEmote>
A task that represents the asynchronous get operation. The task result contains the emote found with the specified
id; null if none is found.
GetEmotesAsync(RequestOptions)
Gets a collection of emotes from this guild.
public Task<IReadOnlyCollection<GuildEmote>> GetEmotesAsync(RequestOptions options = null)
Parameters
optionsRequestOptionsThe options to be used when sending the request.
Returns
- 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(ulong, RequestOptions)
Gets an event within this guild.
public Task<RestGuildEvent> GetEventAsync(ulong id, RequestOptions options = null)
Parameters
idulongThe snowflake identifier for the event.
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task<RestGuildEvent>
A task that represents the asynchronous get operation.
GetEventsAsync(RequestOptions)
Gets all active events within this guild.
public Task<IReadOnlyCollection<RestGuildEvent>> GetEventsAsync(RequestOptions options = null)
Parameters
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task<IReadOnlyCollection<RestGuildEvent>>
A task that represents the asynchronous get operation.
GetForumChannelAsync(ulong, RequestOptions)
Gets a forum channel in this guild.
public Task<RestForumChannel> GetForumChannelAsync(ulong id, RequestOptions options = null)
Parameters
idulongThe snowflake identifier for the forum channel.
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task<RestForumChannel>
A task that represents the asynchronous get operation. The task result contains the text channel associated with the specified
id; null if none is found.
GetForumChannelsAsync(RequestOptions)
Gets a collection of all forum channels in this guild.
public Task<IReadOnlyCollection<RestForumChannel>> GetForumChannelsAsync(RequestOptions options = null)
Parameters
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task<IReadOnlyCollection<RestForumChannel>>
A task that represents the asynchronous get operation. The task result contains a read-only collection of forum channels found within this guild.
GetIntegrationsAsync(RequestOptions)
public Task<IReadOnlyCollection<RestIntegration>> GetIntegrationsAsync(RequestOptions options = null)
Parameters
optionsRequestOptions
Returns
GetInvitesAsync(RequestOptions)
Gets a collection of all invites in this guild.
public Task<IReadOnlyCollection<RestInviteMetadata>> GetInvitesAsync(RequestOptions options = null)
Parameters
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task<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.
GetMediaChannelAsync(ulong, RequestOptions)
Gets a media channel in this guild.
public Task<RestMediaChannel> GetMediaChannelAsync(ulong id, RequestOptions options = null)
Parameters
idulongThe snowflake identifier for the text channel.
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task<RestMediaChannel>
A task that represents the asynchronous get operation. The task result contains the media channel associated with the specified
id; null if none is found.
GetMediaChannelsAsync(RequestOptions)
Gets a collection of all media channels in this guild.
public Task<IReadOnlyCollection<RestMediaChannel>> GetMediaChannelsAsync(RequestOptions options = null)
Parameters
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task<IReadOnlyCollection<RestMediaChannel>>
A task that represents the asynchronous get operation. The task result contains a read-only collection of media channels found within this guild.
GetOnboardingAsync(RequestOptions)
Gets the onboarding object configured for the guild.
public Task<RestGuildOnboarding> GetOnboardingAsync(RequestOptions options = null)
Parameters
optionsRequestOptions
Returns
- Task<RestGuildOnboarding>
A task that represents the asynchronous creation operation. The task result contains the created IGuildOnboarding.
GetOwnerAsync(RequestOptions)
Gets the owner of this guild.
public Task<RestGuildUser> GetOwnerAsync(RequestOptions options = null)
Parameters
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task<RestGuildUser>
A task that represents the asynchronous get operation. The task result contains the owner of this guild.
GetPublicUpdatesChannelAsync(RequestOptions)
Gets the text channel where admins and moderators of Community guilds receive notices from Discord.
public Task<RestTextChannel> GetPublicUpdatesChannelAsync(RequestOptions options = null)
Parameters
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task<RestTextChannel>
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(ulong)
Gets a role in this guild.
public RestRole GetRole(ulong id)
Parameters
idulongThe snowflake identifier for the role.
Returns
GetRoleAsync(ulong, RequestOptions)
Gets a role in this guild.
public Task<RestRole> GetRoleAsync(ulong id, RequestOptions options = null)
Parameters
idulongThe snowflake identifier for the role.
optionsRequestOptions
Returns
GetRulesChannelAsync(RequestOptions)
Gets the text channel where Community guilds can display rules and/or guidelines.
public Task<RestTextChannel> GetRulesChannelAsync(RequestOptions options = null)
Parameters
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task<RestTextChannel>
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.
GetSlashCommandAsync(ulong, RequestOptions)
Gets a slash command in the current guild.
public Task<RestGuildCommand> GetSlashCommandAsync(ulong id, RequestOptions options = null)
Parameters
idulongThe unique identifier of the slash command.
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task<RestGuildCommand>
A task that represents the asynchronous get operation. The task result contains a slash command created by the current user.
GetSlashCommandsAsync(bool, string, RequestOptions)
Gets a collection of slash commands created by the current user in this guild.
public Task<IReadOnlyCollection<RestGuildCommand>> GetSlashCommandsAsync(bool withLocalizations = false, string locale = null, RequestOptions options = null)
Parameters
withLocalizationsboolWhether to include full localization dictionaries in the returned objects, instead of the name localized and description localized fields.
localestringThe target locale of the localized name and description fields. Sets
X-Discord-Localeheader, which takes precedence overAccept-Language.optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task<IReadOnlyCollection<RestGuildCommand>>
A task that represents the asynchronous get operation. The task result contains a read-only collection of slash commands created by the current user.
GetStageChannelAsync(ulong, RequestOptions)
Gets a stage channel in this guild
public Task<RestStageChannel> GetStageChannelAsync(ulong id, RequestOptions options = null)
Parameters
idulongThe snowflake identifier for the stage channel.
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task<RestStageChannel>
A task that represents the asynchronous get operation. The task result contains the stage channel associated with the specified
id; null if none is found.
GetStageChannelsAsync(RequestOptions)
Gets a collection of all stage channels in this guild.
public Task<IReadOnlyCollection<RestStageChannel>> GetStageChannelsAsync(RequestOptions options = null)
Parameters
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task<IReadOnlyCollection<RestStageChannel>>
A task that represents the asynchronous get operation. The task result contains a read-only collection of stage channels found within this guild.
GetStickerAsync(ulong, RequestOptions)
Gets a specific sticker within this guild.
public Task<CustomSticker> GetStickerAsync(ulong id, RequestOptions options = null)
Parameters
idulongThe id of the sticker to get.
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task<CustomSticker>
A task that represents the asynchronous get operation. The task result contains the sticker found with the specified
id; null if none is found.
GetStickersAsync(RequestOptions)
Gets a collection of all stickers within this guild.
public Task<IReadOnlyCollection<CustomSticker>> GetStickersAsync(RequestOptions options = null)
Parameters
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task<IReadOnlyCollection<CustomSticker>>
A task that represents the asynchronous get operation. The task result contains a read-only collection of stickers found within the guild.
GetSystemChannelAsync(RequestOptions)
Gets the text channel where guild notices such as welcome messages and boost events are posted.
public Task<RestTextChannel> GetSystemChannelAsync(RequestOptions options = null)
Parameters
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task<RestTextChannel>
A task that represents the asynchronous get operation. The task result contains the text channel where guild notices such as welcome messages and boost events are post; null if none is found.
GetTextChannelAsync(ulong, RequestOptions)
Gets a text channel in this guild.
public Task<RestTextChannel> GetTextChannelAsync(ulong id, RequestOptions options = null)
Parameters
idulongThe snowflake identifier for the text channel.
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task<RestTextChannel>
A task that represents the asynchronous get operation. The task result contains the text channel associated with the specified
id; null if none is found.
GetTextChannelsAsync(RequestOptions)
Gets a collection of all text channels in this guild.
public Task<IReadOnlyCollection<RestTextChannel>> GetTextChannelsAsync(RequestOptions options = null)
Parameters
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task<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.
GetThreadChannelAsync(ulong, RequestOptions)
Gets a thread channel in this guild.
public Task<RestThreadChannel> GetThreadChannelAsync(ulong id, RequestOptions options = null)
Parameters
idulongThe snowflake identifier for the thread channel.
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task<RestThreadChannel>
A task that represents the asynchronous get operation. The task result contains the thread channel associated with the specified
id; null if none is found.
GetThreadChannelsAsync(RequestOptions)
Gets a collection of all thread in this guild.
public Task<IReadOnlyCollection<RestThreadChannel>> GetThreadChannelsAsync(RequestOptions options = null)
Parameters
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task<IReadOnlyCollection<RestThreadChannel>>
A task that represents the asynchronous get operation. The task result contains a read-only collection of threads found within this guild.
GetUserAsync(ulong, RequestOptions)
Gets a user from this guild.
public Task<RestGuildUser> GetUserAsync(ulong id, RequestOptions options = null)
Parameters
idulongThe snowflake identifier of the user.
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task<RestGuildUser>
A task that represents the asynchronous get operation. The task result contains the guild user associated with the specified
id; null if none is found.
Remarks
This method retrieves a user found within this guild.
GetUsersAsync(RequestOptions)
Gets a collection of all users in this guild.
public IAsyncEnumerable<IReadOnlyCollection<RestGuildUser>> GetUsersAsync(RequestOptions options = null)
Parameters
optionsRequestOptionsThe options to be used when sending the request.
Returns
- IAsyncEnumerable<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.
public Task<RestInviteMetadata> GetVanityInviteAsync(RequestOptions options = null)
Parameters
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task<RestInviteMetadata>
A partial metadata of the vanity invite found within this guild.
GetVoiceChannelAsync(ulong, RequestOptions)
Gets a voice channel in this guild.
public Task<RestVoiceChannel> GetVoiceChannelAsync(ulong id, RequestOptions options = null)
Parameters
idulongThe snowflake identifier for the voice channel.
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task<RestVoiceChannel>
A task that represents the asynchronous get operation. The task result contains the voice channel associated with the specified
id; null if none is found.
GetVoiceChannelsAsync(RequestOptions)
Gets a collection of all voice channels in this guild.
public Task<IReadOnlyCollection<RestVoiceChannel>> GetVoiceChannelsAsync(RequestOptions options = null)
Parameters
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task<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.
public Task<IReadOnlyCollection<RestVoiceRegion>> GetVoiceRegionsAsync(RequestOptions options = null)
Parameters
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task<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(ulong, RequestOptions)
Gets a webhook found within this guild.
public Task<RestWebhook> GetWebhookAsync(ulong id, RequestOptions options = null)
Parameters
idulongThe identifier for the webhook.
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task<RestWebhook>
A task that represents the asynchronous get operation. The task result contains the webhook with the specified
id; null if none is found.
GetWebhooksAsync(RequestOptions)
Gets a collection of all webhook from this guild.
public Task<IReadOnlyCollection<RestWebhook>> GetWebhooksAsync(RequestOptions options = null)
Parameters
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task<IReadOnlyCollection<RestWebhook>>
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.
public Task<WelcomeScreen> GetWelcomeScreenAsync(RequestOptions options = null)
Parameters
optionsRequestOptions
Returns
- Task<WelcomeScreen>
A task that represents the asynchronous creation operation. The task result contains a WelcomeScreen.
GetWidgetChannelAsync(RequestOptions)
Gets the widget channel (i.e. the channel set in the guild's widget settings) in this guild.
public Task<RestGuildChannel> GetWidgetChannelAsync(RequestOptions options = null)
Parameters
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task<RestGuildChannel>
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.
public Task LeaveAsync(RequestOptions options = null)
Parameters
optionsRequestOptionsThe options to be used when sending the request.
Returns
- 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.
public Task ModifyAsync(Action<GuildProperties> func, RequestOptions options = null)
Parameters
funcAction<GuildProperties>The delegate containing the properties to modify the guild with.
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task
A task that represents the asynchronous modification operation.
Exceptions
- ArgumentNullException
funcis null.
ModifyEmoteAsync(GuildEmote, Action<EmoteProperties>, RequestOptions)
Modifies an existing GuildEmote in this guild.
public Task<GuildEmote> ModifyEmoteAsync(GuildEmote emote, Action<EmoteProperties> func, RequestOptions options = null)
Parameters
emoteGuildEmoteThe emote to be modified.
funcAction<EmoteProperties>The delegate containing the properties to modify the emote with.
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task<GuildEmote>
A task that represents the asynchronous modification operation. The task result contains the modified emote.
Exceptions
- ArgumentNullException
funcis null.
ModifyIncidentActionsAsync(Action<GuildIncidentsDataProperties>, RequestOptions)
Modifies the incident actions of the guild.
public Task<GuildIncidentsData> ModifyIncidentActionsAsync(Action<GuildIncidentsDataProperties> props, RequestOptions options = null)
Parameters
propsAction<GuildIncidentsDataProperties>optionsRequestOptions
Returns
- Task<GuildIncidentsData>
A task that represents the asynchronous creation operation. The task result contains the modified IncidentsData.
ModifyOnboardingAsync(Action<GuildOnboardingProperties>, RequestOptions)
Modifies the onboarding object configured for the guild.
public Task<RestGuildOnboarding> ModifyOnboardingAsync(Action<GuildOnboardingProperties> props, RequestOptions options = null)
Parameters
propsAction<GuildOnboardingProperties>optionsRequestOptions
Returns
- Task<RestGuildOnboarding>
A task that represents the asynchronous creation operation. The task result contains the modified IGuildOnboarding.
ModifyWelcomeScreenAsync(bool, WelcomeScreenChannelProperties[], string, RequestOptions)
Modifies the welcome screen of the guild. Returns null if welcome screen is removed.
public Task<WelcomeScreen> ModifyWelcomeScreenAsync(bool enabled, WelcomeScreenChannelProperties[] channels, string description = null, RequestOptions options = null)
Parameters
enabledboolchannelsWelcomeScreenChannelProperties[]descriptionstringoptionsRequestOptions
Returns
- 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.
public Task ModifyWidgetAsync(Action<GuildWidgetProperties> func, RequestOptions options = null)
Parameters
funcAction<GuildWidgetProperties>The delegate containing the properties to modify the guild widget with.
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task
A task that represents the asynchronous modification operation.
Exceptions
- ArgumentNullException
funcis null.
MoveAsync(IGuildUser, IVoiceChannel)
Moves the user to the voice channel.
public Task MoveAsync(IGuildUser user, IVoiceChannel targetChannel)
Parameters
userIGuildUserThe user to move.
targetChannelIVoiceChannelthe channel where the user gets moved to.
Returns
- Task
A task that represents the asynchronous operation for moving a user.
PruneUsersAsync(int, bool, RequestOptions, IEnumerable<ulong>)
Prunes inactive users.
public Task<int> PruneUsersAsync(int days = 30, bool simulate = false, RequestOptions options = null, IEnumerable<ulong> includeRoleIds = null)
Parameters
daysintThe number of days required for the users to be kicked.
simulateboolWhether this prune action is a simulation.
optionsRequestOptionsThe options to be used when sending the request.
includeRoleIdsIEnumerable<ulong>An array of role IDs to be included in the prune of users who do not have any additional roles.
Returns
- Task<int>
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.
public Task RemoveBanAsync(IUser user, RequestOptions options = null)
Parameters
userIUserThe user to be unbanned.
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task
A task that represents the asynchronous removal operation for the ban.
RemoveBanAsync(ulong, RequestOptions)
Unbans the user if they are currently banned.
public Task RemoveBanAsync(ulong userId, RequestOptions options = null)
Parameters
userIdulongThe snowflake identifier of the user to be unbanned.
optionsRequestOptionsThe options to be used when sending the request.
Returns
- 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.
public Task ReorderChannelsAsync(IEnumerable<ReorderChannelProperties> args, RequestOptions options = null)
Parameters
argsIEnumerable<ReorderChannelProperties>The properties used to modify the channel positions with.
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task
A task that represents the asynchronous reorder operation.
Exceptions
- ArgumentNullException
argsis null.
ReorderRolesAsync(IEnumerable<ReorderRoleProperties>, RequestOptions)
Bulk-modifies the order of roles in this guild.
public Task ReorderRolesAsync(IEnumerable<ReorderRoleProperties> args, RequestOptions options = null)
Parameters
argsIEnumerable<ReorderRoleProperties>The properties used to modify the role positions with.
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task
A task that represents the asynchronous reorder operation.
SearchUsersAsync(string, int, RequestOptions)
Gets a collection of users in this guild that the name or nickname starts with the
provided string at query.
public Task<IReadOnlyCollection<RestGuildUser>> SearchUsersAsync(string query, int limit = 1000, RequestOptions options = null)
Parameters
querystringThe partial name or nickname to search.
limitintThe maximum number of users to be gotten.
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task<IReadOnlyCollection<RestGuildUser>>
A task that represents the asynchronous get operation. The task result contains a collection of guild users that the name or nickname starts with the provided string at
query.
Remarks
The limit can not be higher than MaxUsersPerBatch.
SearchUsersAsyncV2(int, MemberSearchPropertiesV2, RequestOptions)
Gets a collection of users in this guild that match the provided search criteria.
public Task<MemberSearchResult> SearchUsersAsyncV2(int limit = 1000, MemberSearchPropertiesV2 args = null, RequestOptions options = null)
Parameters
limitintargsMemberSearchPropertiesV2optionsRequestOptions
Returns
ToString()
Returns the name of the guild.
public override string ToString()
Returns
- string
The name of the guild.
UpdateAsync(RequestOptions)
Updates this object's properties with its current state.
public Task UpdateAsync(RequestOptions options = null)
Parameters
optionsRequestOptionsThe options to be used when sending the request.
Returns
UpdateAsync(bool, RequestOptions)
Updates this object's properties with its current state.
public Task UpdateAsync(bool withCounts, RequestOptions options = null)
Parameters
withCountsboolIf true, ApproximateMemberCount and ApproximatePresenceCount will be updated as well.
optionsRequestOptionsThe options to be used when sending the request.
Returns
Remarks
If withCounts is true, ApproximateMemberCount and
ApproximatePresenceCount will be updated as well.