Class RestGuild
Represents a REST-based guild/server.
Inherited Members
Namespace: Discord.Rest
Assembly: Discord.Net.Rest.dll
Syntax
public class RestGuild : RestEntity<ulong>, IEntity<ulong>, IGuild, IDeletable, ISnowflakeEntity, IEntity<ulong>, IUpdateable
Properties
| Improve this Doc View SourceAFKChannelId
Declaration
public ulong? AFKChannelId { get; }
Property Value
Type | Description |
---|---|
Nullable<UInt64> |
AFKTimeout
Declaration
public int AFKTimeout { get; }
Property Value
Type | Description |
---|---|
Int32 |
ApplicationId
Declaration
public ulong? ApplicationId { get; }
Property Value
Type | Description |
---|---|
Nullable<UInt64> |
ApproximateMemberCount
Declaration
public int? ApproximateMemberCount { get; }
Property Value
Type | Description |
---|---|
Nullable<Int32> |
ApproximatePresenceCount
Declaration
public int? ApproximatePresenceCount { get; }
Property Value
Type | Description |
---|---|
Nullable<Int32> |
BannerId
Declaration
public string BannerId { get; }
Property Value
Type | Description |
---|---|
String |
BannerUrl
Declaration
public string BannerUrl { get; }
Property Value
Type | Description |
---|---|
String |
CreatedAt
Declaration
public DateTimeOffset CreatedAt { get; }
Property Value
Type | Description |
---|---|
DateTimeOffset |
DefaultMessageNotifications
Gets the default message notifications for users who haven't explicitly set their notification settings.
Declaration
public DefaultMessageNotifications DefaultMessageNotifications { get; }
Property Value
Type | Description |
---|---|
DefaultMessageNotifications |
Description
Declaration
public string Description { get; }
Property Value
Type | Description |
---|---|
String |
DiscoverySplashId
Declaration
public string DiscoverySplashId { get; }
Property Value
Type | Description |
---|---|
String |
DiscoverySplashUrl
Declaration
public string DiscoverySplashUrl { get; }
Property Value
Type | Description |
---|---|
String |
Emotes
Declaration
public IReadOnlyCollection<GuildEmote> Emotes { get; }
Property Value
Type | Description |
---|---|
IReadOnlyCollection<GuildEmote> |
EveryoneRole
Gets the built-in role containing all users in this guild.
Declaration
public RestRole EveryoneRole { get; }
Property Value
Type | Description |
---|---|
RestRole |
ExplicitContentFilter
Gets the level of content filtering applied to user's content in a Guild.
Declaration
public ExplicitContentFilterLevel ExplicitContentFilter { get; }
Property Value
Type | Description |
---|---|
ExplicitContentFilterLevel | The level of explicit content filtering. |
Features
Gets the features for this guild.
Declaration
public GuildFeatures Features { get; }
Property Value
Type | Description |
---|---|
GuildFeatures | A flags enum containing all the features for the guild. |
IconId
Declaration
public string IconId { get; }
Property Value
Type | Description |
---|---|
String |
IconUrl
Declaration
public string IconUrl { get; }
Property Value
Type | Description |
---|---|
String |
IsBoostProgressBarEnabled
Declaration
public bool IsBoostProgressBarEnabled { get; }
Property Value
Type | Description |
---|---|
Boolean |
IsWidgetEnabled
Declaration
public bool IsWidgetEnabled { get; }
Property Value
Type | Description |
---|---|
Boolean |
MaxBitrate
Declaration
public int MaxBitrate { get; }
Property Value
Type | Description |
---|---|
Int32 |
MaxMembers
Declaration
public int? MaxMembers { get; }
Property Value
Type | Description |
---|---|
Nullable<Int32> |
MaxPresences
Declaration
public int? MaxPresences { get; }
Property Value
Type | Description |
---|---|
Nullable<Int32> |
MaxUploadLimit
Declaration
public ulong MaxUploadLimit { get; }
Property Value
Type | Description |
---|---|
UInt64 |
MaxVideoChannelUsers
Declaration
public int? MaxVideoChannelUsers { get; }
Property Value
Type | Description |
---|---|
Nullable<Int32> |
MfaLevel
Gets the level of Multi-Factor Authentication requirements a user must fulfill before being allowed to perform administrative actions in this guild.
Declaration
public MfaLevel MfaLevel { get; }
Property Value
Type | Description |
---|---|
MfaLevel | The level of MFA requirement. |
Name
Declaration
public string Name { get; }
Property Value
Type | Description |
---|---|
String |
NsfwLevel
Gets the NSFW level of this guild.
Declaration
public NsfwLevel NsfwLevel { get; }
Property Value
Type | Description |
---|---|
NsfwLevel | The NSFW level of this guild. |
OwnerId
Declaration
public ulong OwnerId { get; }
Property Value
Type | Description |
---|---|
UInt64 |
PreferredCulture
Declaration
public CultureInfo PreferredCulture { get; }
Property Value
Type | Description |
---|---|
CultureInfo |
PreferredLocale
Declaration
public string PreferredLocale { get; }
Property Value
Type | Description |
---|---|
String |
PremiumSubscriptionCount
Declaration
public int PremiumSubscriptionCount { get; }
Property Value
Type | Description |
---|---|
Int32 |
PremiumTier
Gets the tier of guild boosting in this guild.
Declaration
public PremiumTier PremiumTier { get; }
Property Value
Type | Description |
---|---|
PremiumTier | The tier of guild boosting in this guild. |
PublicUpdatesChannelId
Declaration
public ulong? PublicUpdatesChannelId { get; }
Property Value
Type | Description |
---|---|
Nullable<UInt64> |
Roles
Gets a collection of all roles in this guild.
Declaration
public IReadOnlyCollection<RestRole> Roles { get; }
Property Value
Type | Description |
---|---|
IReadOnlyCollection<RestRole> |
RulesChannelId
Declaration
public ulong? RulesChannelId { get; }
Property Value
Type | Description |
---|---|
Nullable<UInt64> |
SplashId
Declaration
public string SplashId { get; }
Property Value
Type | Description |
---|---|
String |
SplashUrl
Declaration
public string SplashUrl { get; }
Property Value
Type | Description |
---|---|
String |
Stickers
Declaration
public IReadOnlyCollection<CustomSticker> Stickers { get; }
Property Value
Type | Description |
---|---|
IReadOnlyCollection<CustomSticker> |
SystemChannelFlags
Gets the flags for the types of system channel messages that are disabled.
Declaration
public SystemChannelMessageDeny SystemChannelFlags { get; }
Property Value
Type | Description |
---|---|
SystemChannelMessageDeny | The flags for the types of system channel messages that are disabled. |
SystemChannelId
Declaration
public ulong? SystemChannelId { get; }
Property Value
Type | Description |
---|---|
Nullable<UInt64> |
VanityURLCode
Declaration
public string VanityURLCode { get; }
Property Value
Type | Description |
---|---|
String |
VerificationLevel
Gets the level of requirements a user must fulfill before being allowed to post messages in this guild.
Declaration
public VerificationLevel VerificationLevel { get; }
Property Value
Type | Description |
---|---|
VerificationLevel | The level of requirements. |
VoiceRegionId
Declaration
public string VoiceRegionId { get; }
Property Value
Type | Description |
---|---|
String |
WidgetChannelId
Declaration
public ulong? WidgetChannelId { get; }
Property Value
Type | Description |
---|---|
Nullable<UInt64> |
Methods
| Improve this Doc View SourceAddBanAsync(IUser, Int32, String, RequestOptions)
Declaration
public Task AddBanAsync(IUser user, int pruneDays = 0, string reason = null, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
IUser | user | |
Int32 | pruneDays | |
String | reason | |
RequestOptions | options |
Returns
Type | Description |
---|---|
Task |
AddBanAsync(UInt64, Int32, String, RequestOptions)
Declaration
public Task AddBanAsync(ulong userId, int pruneDays = 0, string reason = null, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | userId | |
Int32 | pruneDays | |
String | reason | |
RequestOptions | options |
Returns
Type | Description |
---|---|
Task |
AddGuildUserAsync(UInt64, String, Action<AddGuildUserProperties>, RequestOptions)
Declaration
public Task<RestGuildUser> AddGuildUserAsync(ulong id, string accessToken, Action<AddGuildUserProperties> func = null, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | id | |
String | accessToken | |
Action<AddGuildUserProperties> | func | |
RequestOptions | options |
Returns
Type | Description |
---|---|
Task<RestGuildUser> |
BulkOverwriteApplicationCommandsAsync(ApplicationCommandProperties[], RequestOptions)
Overwrites the application commands within this guild.
Declaration
public async Task<IReadOnlyCollection<RestGuildCommand>> 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<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.
Declaration
public async Task<RestGuildCommand> 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<RestGuildCommand> | A task that represents the asynchronous creation operation. The task result contains the command that was created. |
CreateCategoryChannelAsync(String, Action<GuildChannelProperties>, RequestOptions)
Creates a category channel with the provided name.
Declaration
public Task<RestCategoryChannel> CreateCategoryChannelAsync(string name, Action<GuildChannelProperties> func = null, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
String | name | The name of the new channel. |
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<RestCategoryChannel> | The created category channel. |
CreateEmoteAsync(String, Image, Optional<IEnumerable<IRole>>, RequestOptions)
Declaration
public Task<GuildEmote> CreateEmoteAsync(string name, Image image, Optional<IEnumerable<IRole>> roles = default(Optional<IEnumerable<IRole>>), RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
String | name | |
Image | image | |
Optional<IEnumerable<IRole>> | roles | |
RequestOptions | options |
Returns
Type | Description |
---|---|
Task<GuildEmote> |
CreateEventAsync(String, DateTimeOffset, GuildScheduledEventType, GuildScheduledEventPrivacyLevel, String, Nullable<DateTimeOffset>, Nullable<UInt64>, String, Nullable<Image>, RequestOptions)
Creates an event within this guild.
Declaration
public Task<RestGuildEvent> 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<RestGuildEvent> | A task that represents the asynchronous create operation. |
CreateRoleAsync(String, Nullable<GuildPermissions>, Nullable<Color>, Boolean, Boolean, RequestOptions)
Creates a new role with the provided name.
Declaration
public async Task<RestRole> 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<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.
Declaration
public Task<RestStageChannel> 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<RestStageChannel> | A task that represents the asynchronous creation operation. The task result contains the newly created stage channel. |
CreateStickerAsync(String, String, IEnumerable<String>, Image, RequestOptions)
Creates a new sticker in this guild.
Declaration
public async Task<CustomSticker> CreateStickerAsync(string name, string description, IEnumerable<string> tags, Image image, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
String | name | The name of the sticker. |
String | description | The description of the sticker. |
IEnumerable<String> | tags | The tags of the sticker. |
Image | image | The image of the new emote. |
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
Task<CustomSticker> | A task that represents the asynchronous creation operation. The task result contains the created sticker. |
CreateStickerAsync(String, String, IEnumerable<String>, Stream, String, RequestOptions)
Creates a new sticker in this guild
Declaration
public async Task<CustomSticker> CreateStickerAsync(string name, string description, IEnumerable<string> tags, Stream stream, string filename, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
String | name | The name of the sticker. |
String | description | The description of the sticker. |
IEnumerable<String> | tags | The tags of the sticker. |
Stream | stream | The stream containing the file data. |
String | filename | The name of the file with the extension, ex: image.png. |
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
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
Declaration
public Task<CustomSticker> CreateStickerAsync(string name, string description, IEnumerable<string> tags, string path, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
String | name | The name of the sticker. |
String | description | The description of the sticker. |
IEnumerable<String> | tags | The tags of the sticker. |
String | path | The path of the file to upload. |
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
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.
Declaration
public Task<RestTextChannel> 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<RestTextChannel> | A task that represents the asynchronous creation operation. The task result contains the newly created text channel. |
Examples
The following example creates a new text channel under an existing category named Wumpus
with a set topic.
var categories = await guild.GetCategoriesAsync();
var targetCategory = categories.FirstOrDefault(x => x.Name == "wumpus");
if (targetCategory == null) return;
await Context.Guild.CreateTextChannelAsync(name, x =>
{
x.CategoryId = targetCategory.Id;
x.Topic = $"This channel was created at {DateTimeOffset.UtcNow} by {user}.";
});
|
Improve this Doc
View Source
CreateVoiceChannelAsync(String, Action<VoiceChannelProperties>, RequestOptions)
Creates a voice channel with the provided name.
Declaration
public Task<RestVoiceChannel> CreateVoiceChannelAsync(string name, Action<VoiceChannelProperties> func = null, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
String | name | The name of the new 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<RestVoiceChannel> | The created voice channel. |
DeleteAsync(RequestOptions)
Declaration
public Task DeleteAsync(RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
RequestOptions | options |
Returns
Type | Description |
---|---|
Task |
DeleteEmoteAsync(GuildEmote, RequestOptions)
Declaration
public Task DeleteEmoteAsync(GuildEmote emote, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
GuildEmote | emote | |
RequestOptions | options |
Returns
Type | Description |
---|---|
Task |
DeleteIntegrationAsync(UInt64, RequestOptions)
Declaration
public Task DeleteIntegrationAsync(ulong id, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | id | |
RequestOptions | options |
Returns
Type | Description |
---|---|
Task |
DeleteSlashCommandsAsync(RequestOptions)
Deletes all slash commands in the current guild.
Declaration
public Task DeleteSlashCommandsAsync(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 delete operation. |
DeleteStickerAsync(CustomSticker, RequestOptions)
Deletes a sticker within this guild.
Declaration
public Task DeleteStickerAsync(CustomSticker sticker, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
CustomSticker | 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. |
GetAFKChannelAsync(RequestOptions)
Gets the AFK voice channel in this guild.
Declaration
public async Task<RestVoiceChannel> GetAFKChannelAsync(RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
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(UInt64, RequestOptions)
Gets an application command within this guild with the specified id.
Declaration
public async Task<RestGuildCommand> GetApplicationCommandAsync(ulong id, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | id | The id of the application command to get. |
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
Task<RestGuildCommand> | A ValueTask that represents the asynchronous get operation. The task result contains a IApplicationCommand if found, otherwise null. |
GetApplicationCommandsAsync(RequestOptions)
Gets this guilds slash commands
Declaration
public async Task<IReadOnlyCollection<RestGuildCommand>> GetApplicationCommandsAsync(RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
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(Int32, RequestOptions, Nullable<UInt64>, Nullable<UInt64>, Nullable<ActionType>)
Gets the specified number of audit log entries for this guild.
Declaration
public IAsyncEnumerable<IReadOnlyCollection<RestAuditLogEntry>> GetAuditLogsAsync(int limit, RequestOptions options = null, ulong? beforeId = null, ulong? userId = null, ActionType? actionType = null)
Parameters
Type | Name | Description |
---|---|---|
Int32 | limit | The number of audit log entries to fetch. |
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. |
Returns
Type | Description |
---|---|
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. |
GetBanAsync(IUser, RequestOptions)
Gets a ban object for a banned user.
Declaration
public Task<RestBan> GetBanAsync(IUser user, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
IUser | user | The banned user. |
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
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(UInt64, RequestOptions)
Gets a ban object for a banned user.
Declaration
public Task<RestBan> 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<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, Int32, RequestOptions)
Declaration
public IAsyncEnumerable<IReadOnlyCollection<RestBan>> GetBansAsync(IUser fromUser, Direction dir, int limit = null, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
IUser | fromUser | |
Direction | dir | |
Int32 | limit | |
RequestOptions | options |
Returns
Type | Description |
---|---|
IAsyncEnumerable<IReadOnlyCollection<RestBan>> |
GetBansAsync(Int32, RequestOptions)
Declaration
public IAsyncEnumerable<IReadOnlyCollection<RestBan>> GetBansAsync(int limit = null, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
Int32 | limit | |
RequestOptions | options |
Returns
Type | Description |
---|---|
IAsyncEnumerable<IReadOnlyCollection<RestBan>> |
GetBansAsync(UInt64, Direction, Int32, RequestOptions)
Declaration
public IAsyncEnumerable<IReadOnlyCollection<RestBan>> GetBansAsync(ulong fromUserId, Direction dir, int limit = null, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | fromUserId | |
Direction | dir | |
Int32 | limit | |
RequestOptions | options |
Returns
Type | Description |
---|---|
IAsyncEnumerable<IReadOnlyCollection<RestBan>> |
GetCategoryChannelsAsync(RequestOptions)
Gets a collection of all category channels in this guild.
Declaration
public async Task<IReadOnlyCollection<RestCategoryChannel>> GetCategoryChannelsAsync(RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
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(UInt64, RequestOptions)
Gets a channel in this guild.
Declaration
public Task<RestGuildChannel> GetChannelAsync(ulong id, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | id | The snowflake identifier for the channel. |
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
Task<RestGuildChannel> | A task that represents the asynchronous get operation. The task result contains the generic channel
associated with the specified |
GetChannelsAsync(RequestOptions)
Gets a collection of all channels in this guild.
Declaration
public Task<IReadOnlyCollection<RestGuildChannel>> GetChannelsAsync(RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
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.
Declaration
public Task<RestGuildUser> GetCurrentUserAsync(RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
Task<RestGuildUser> | A task that represents the asynchronous get operation. The task result contains the currently logged-in user within this guild. |
GetDefaultChannelAsync(RequestOptions)
Gets the first viewable text channel in this guild.
Declaration
public async Task<RestTextChannel> GetDefaultChannelAsync(RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
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(UInt64, RequestOptions)
Declaration
public Task<GuildEmote> GetEmoteAsync(ulong id, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | id | |
RequestOptions | options |
Returns
Type | Description |
---|---|
Task<GuildEmote> |
GetEmotesAsync(RequestOptions)
Declaration
public Task<IReadOnlyCollection<GuildEmote>> GetEmotesAsync(RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
RequestOptions | options |
Returns
Type | Description |
---|---|
Task<IReadOnlyCollection<GuildEmote>> |
GetEventAsync(UInt64, RequestOptions)
Gets an event within this guild.
Declaration
public Task<RestGuildEvent> GetEventAsync(ulong id, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | id | The snowflake identifier for the event. |
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
Task<RestGuildEvent> | A task that represents the asynchronous get operation. |
GetEventsAsync(RequestOptions)
Gets all active events within this guild.
Declaration
public Task<IReadOnlyCollection<RestGuildEvent>> GetEventsAsync(RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
Task<IReadOnlyCollection<RestGuildEvent>> | A task that represents the asynchronous get operation. |
GetIntegrationsAsync(RequestOptions)
Declaration
public Task<IReadOnlyCollection<RestIntegration>> GetIntegrationsAsync(RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
RequestOptions | options |
Returns
Type | Description |
---|---|
Task<IReadOnlyCollection<RestIntegration>> |
GetInvitesAsync(RequestOptions)
Gets a collection of all invites in this guild.
Declaration
public Task<IReadOnlyCollection<RestInviteMetadata>> GetInvitesAsync(RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
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. |
GetOwnerAsync(RequestOptions)
Gets the owner of this guild.
Declaration
public Task<RestGuildUser> GetOwnerAsync(RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
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.
Declaration
public async Task<RestTextChannel> GetPublicUpdatesChannelAsync(RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
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(UInt64)
Gets a role in this guild.
Declaration
public RestRole GetRole(ulong id)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | id | The snowflake identifier for the role. |
Returns
Type | Description |
---|---|
RestRole | A role that is associated with the specified |
GetRulesChannelAsync(RequestOptions)
Gets the text channel where Community guilds can display rules and/or guidelines.
Declaration
public async Task<RestTextChannel> GetRulesChannelAsync(RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
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(UInt64, RequestOptions)
Gets a slash command in the current guild.
Declaration
public Task<RestGuildCommand> GetSlashCommandAsync(ulong id, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | id | The unique identifier of the slash command. |
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
Task<RestGuildCommand> | A task that represents the asynchronous get operation. The task result contains a slash command created by the current user. |
GetSlashCommandsAsync(RequestOptions)
Gets a collection of slash commands created by the current user in this guild.
Declaration
public Task<IReadOnlyCollection<RestGuildCommand>> GetSlashCommandsAsync(RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
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(UInt64, RequestOptions)
Gets a stage channel in this guild
Declaration
public async Task<RestStageChannel> GetStageChannelAsync(ulong id, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | id | The snowflake identifier for the stage channel. |
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
Task<RestStageChannel> | A task that represents the asynchronous get operation. The task result contains the stage channel associated
with the specified |
GetStageChannelsAsync(RequestOptions)
Gets a collection of all stage channels in this guild.
Declaration
public async Task<IReadOnlyCollection<RestStageChannel>> GetStageChannelsAsync(RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
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(UInt64, RequestOptions)
Gets a specific sticker within this guild.
Declaration
public async Task<CustomSticker> GetStickerAsync(ulong id, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | id | The id of the sticker to get. |
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
Task<CustomSticker> | A task that represents the asynchronous get operation. The task result contains the sticker found with the
specified |
GetStickersAsync(RequestOptions)
Gets a collection of all stickers within this guild.
Declaration
public async Task<IReadOnlyCollection<CustomSticker>> GetStickersAsync(RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
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.
Declaration
public async Task<RestTextChannel> GetSystemChannelAsync(RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
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(UInt64, RequestOptions)
Gets a text channel in this guild.
Declaration
public async Task<RestTextChannel> GetTextChannelAsync(ulong id, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | id | The snowflake identifier for the text channel. |
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
Task<RestTextChannel> | A task that represents the asynchronous get operation. The task result contains the text channel
associated with the specified |
GetTextChannelsAsync(RequestOptions)
Gets a collection of all text channels in this guild.
Declaration
public async Task<IReadOnlyCollection<RestTextChannel>> GetTextChannelsAsync(RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
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(UInt64, RequestOptions)
Gets a thread channel in this guild.
Declaration
public async Task<RestThreadChannel> GetThreadChannelAsync(ulong id, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | id | The snowflake identifier for the thread channel. |
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
Task<RestThreadChannel> | A task that represents the asynchronous get operation. The task result contains the thread channel associated
with the specified |
GetThreadChannelsAsync(RequestOptions)
Gets a collection of all thread in this guild.
Declaration
public async Task<IReadOnlyCollection<RestThreadChannel>> GetThreadChannelsAsync(RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
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(UInt64, RequestOptions)
Gets a user from this guild.
Declaration
public Task<RestGuildUser> GetUserAsync(ulong id, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | id | The snowflake identifier of the user. |
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
Task<RestGuildUser> | A task that represents the asynchronous get operation. The task result contains the guild user
associated with the specified |
Remarks
This method retrieves a user found within this guild.
GetUsersAsync(RequestOptions)
Gets a collection of all users in this guild.
Declaration
public IAsyncEnumerable<IReadOnlyCollection<RestGuildUser>> GetUsersAsync(RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
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.
Declaration
public Task<RestInviteMetadata> GetVanityInviteAsync(RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
Task<RestInviteMetadata> | A partial metadata of the vanity invite found within this guild. |
GetVoiceChannelAsync(UInt64, RequestOptions)
Gets a voice channel in this guild.
Declaration
public async Task<RestVoiceChannel> GetVoiceChannelAsync(ulong id, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | id | The snowflake identifier for the voice channel. |
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
Task<RestVoiceChannel> | A task that represents the asynchronous get operation. The task result contains the voice channel associated
with the specified |
GetVoiceChannelsAsync(RequestOptions)
Gets a collection of all voice channels in this guild.
Declaration
public async Task<IReadOnlyCollection<RestVoiceChannel>> GetVoiceChannelsAsync(RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
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.
Declaration
public Task<IReadOnlyCollection<RestVoiceRegion>> GetVoiceRegionsAsync(RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
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(UInt64, RequestOptions)
Gets a webhook found within this guild.
Declaration
public Task<RestWebhook> 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<RestWebhook> | A task that represents the asynchronous get operation. The task result contains the webhook with the
specified |
GetWebhooksAsync(RequestOptions)
Gets a collection of all webhook from this guild.
Declaration
public Task<IReadOnlyCollection<RestWebhook>> GetWebhooksAsync(RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
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. |
GetWidgetChannelAsync(RequestOptions)
Gets the widget channel (i.e. the channel set in the guild's widget settings) in this guild.
Declaration
public async Task<RestGuildChannel> GetWidgetChannelAsync(RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
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)
Declaration
public Task LeaveAsync(RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
RequestOptions | options |
Returns
Type | Description |
---|---|
Task |
ModifyAsync(Action<GuildProperties>, RequestOptions)
Declaration
public async Task ModifyAsync(Action<GuildProperties> func, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
Action<GuildProperties> | func | |
RequestOptions | options |
Returns
Type | Description |
---|---|
Task |
ModifyEmoteAsync(GuildEmote, Action<EmoteProperties>, RequestOptions)
Declaration
public Task<GuildEmote> ModifyEmoteAsync(GuildEmote emote, Action<EmoteProperties> func, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
GuildEmote | emote | |
Action<EmoteProperties> | func | |
RequestOptions | options |
Returns
Type | Description |
---|---|
Task<GuildEmote> |
ModifyWidgetAsync(Action<GuildWidgetProperties>, RequestOptions)
Declaration
public async Task ModifyWidgetAsync(Action<GuildWidgetProperties> func, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
Action<GuildWidgetProperties> | func | |
RequestOptions | options |
Returns
Type | Description |
---|---|
Task |
MoveAsync(IGuildUser, IVoiceChannel)
Moves the user to the voice channel.
Declaration
public 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
public 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 |
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)
Declaration
public Task RemoveBanAsync(IUser user, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
IUser | user | |
RequestOptions | options |
Returns
Type | Description |
---|---|
Task |
RemoveBanAsync(UInt64, RequestOptions)
Declaration
public Task RemoveBanAsync(ulong userId, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | userId | |
RequestOptions | options |
Returns
Type | Description |
---|---|
Task |
ReorderChannelsAsync(IEnumerable<ReorderChannelProperties>, RequestOptions)
Declaration
public async Task ReorderChannelsAsync(IEnumerable<ReorderChannelProperties> args, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<ReorderChannelProperties> | args | |
RequestOptions | options |
Returns
Type | Description |
---|---|
Task |
ReorderRolesAsync(IEnumerable<ReorderRoleProperties>, RequestOptions)
Declaration
public async Task ReorderRolesAsync(IEnumerable<ReorderRoleProperties> args, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<ReorderRoleProperties> | args | |
RequestOptions | options |
Returns
Type | Description |
---|---|
Task |
SearchUsersAsync(String, Int32, RequestOptions)
Gets a collection of users in this guild that the name or nickname starts with the
provided query
.
Declaration
public Task<IReadOnlyCollection<RestGuildUser>> SearchUsersAsync(string query, int limit = null, 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. |
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
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 |
Remarks
The limit
can not be higher than MaxUsersPerBatch.
ToString()
Returns the name of the guild.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String | The name of the guild. |
UpdateAsync(RequestOptions)
Declaration
public async Task UpdateAsync(RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
RequestOptions | options |
Returns
Type | Description |
---|---|
Task |
UpdateAsync(Boolean, RequestOptions)
Updates this object's properties with its current state.
Declaration
public async Task UpdateAsync(bool withCounts, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
Boolean | withCounts | If true, ApproximateMemberCount and ApproximatePresenceCount will be updated as well. |
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
Task |
Remarks
If withCounts
is true, ApproximateMemberCount and
ApproximatePresenceCount will be updated as well.
Explicit Interface Implementations
| Improve this Doc View SourceIGuild.AudioClient
Gets the IAudioClient currently associated with this guild.
Declaration
IAudioClient IGuild.AudioClient { get; }
Returns
Type | Description |
---|---|
IAudioClient | An IAudioClient currently associated with this guild. |
IGuild.EveryoneRole
Gets the built-in role containing all users in this guild.
Declaration
IRole IGuild.EveryoneRole { get; }
Returns
Type | Description |
---|---|
IRole | A role object that represents an |