Class SocketGuild
Represents a WebSocket-based guild object.
Inherited Members
Namespace: Discord.WebSocket
Assembly: Discord.Net.WebSocket.dll
Syntax
public class SocketGuild : SocketEntity<ulong>, IEntity<ulong>, IGuild, IDeletable, ISnowflakeEntity, IEntity<ulong>, IDisposable
Properties
| Improve this Doc View SourceAFKChannel
Gets the AFK voice channel in this guild.
Declaration
public SocketVoiceChannel AFKChannel { get; }
Property Value
Type | Description |
---|---|
SocketVoiceChannel | A SocketVoiceChannel that the AFK users will be moved to after they have idled for too long; null if none is set. |
AFKTimeout
Declaration
public int AFKTimeout { get; }
Property Value
Type | Description |
---|---|
Int32 |
ApplicationId
Declaration
public ulong? ApplicationId { get; }
Property Value
Type | Description |
---|---|
Nullable<UInt64> |
AudioClient
Gets the IAudioClient associated with this guild.
Declaration
public IAudioClient AudioClient { get; }
Property Value
Type | Description |
---|---|
IAudioClient |
AutoModRules
Gets the auto moderation rules defined in this guild.
Declaration
public IReadOnlyCollection<SocketAutoModRule> AutoModRules { get; }
Property Value
Type | Description |
---|---|
IReadOnlyCollection<SocketAutoModRule> |
Remarks
This property may not always return all auto moderation rules if they haven't been cached.
BannerId
Declaration
public string BannerId { get; }
Property Value
Type | Description |
---|---|
String |
BannerUrl
Declaration
public string BannerUrl { get; }
Property Value
Type | Description |
---|---|
String |
CachedAuditLogs
Gets all cached audit log entries from this guild.
Declaration
public IReadOnlyCollection<SocketAuditLogEntry> CachedAuditLogs { get; }
Property Value
Type | Description |
---|---|
IReadOnlyCollection<SocketAuditLogEntry> |
CategoryChannels
Gets a collection of all category channels in this guild.
Declaration
public IReadOnlyCollection<SocketCategoryChannel> CategoryChannels { get; }
Property Value
Type | Description |
---|---|
IReadOnlyCollection<SocketCategoryChannel> | A read-only collection of category channels found within this guild. |
Channels
Gets a collection of all channels in this guild.
Declaration
public IReadOnlyCollection<SocketGuildChannel> Channels { get; }
Property Value
Type | Description |
---|---|
IReadOnlyCollection<SocketGuildChannel> | A read-only collection of generic channels found within this guild. |
CreatedAt
Declaration
public DateTimeOffset CreatedAt { get; }
Property Value
Type | Description |
---|---|
DateTimeOffset |
CurrentUser
Gets the current logged-in user.
Declaration
public SocketGuildUser CurrentUser { get; }
Property Value
Type | Description |
---|---|
SocketGuildUser |
DefaultChannel
Gets the default channel in this guild.
Declaration
public SocketTextChannel DefaultChannel { get; }
Property Value
Type | Description |
---|---|
SocketTextChannel | A SocketTextChannel representing the first viewable channel that the user has access to. |
Remarks
This property retrieves the first viewable text channel for this guild.
warning
This channel does not guarantee the user can send message to it, as it only looks for the first viewable text channel.
DefaultMessageNotifications
Gets the default message notifications for users who haven't explicitly set their notification settings.
Declaration
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 |
DownloadedMemberCount
Gets the number of members downloaded to the local guild cache.
Declaration
public int DownloadedMemberCount { get; }
Property Value
Type | Description |
---|---|
Int32 |
DownloaderPromise
Declaration
public Task DownloaderPromise { get; }
Property Value
Type | Description |
---|---|
Task |
Emotes
Declaration
public IReadOnlyCollection<GuildEmote> Emotes { get; }
Property Value
Type | Description |
---|---|
IReadOnlyCollection<GuildEmote> |
Events
Gets a collection of all events within this guild.
Declaration
public IReadOnlyCollection<SocketGuildEvent> Events { get; }
Property Value
Type | Description |
---|---|
IReadOnlyCollection<SocketGuildEvent> | A read-only collection of guild events found within this guild. |
Remarks
This field is based off of caching alone, since there is no events returned on the guild model.
EveryoneRole
Gets the built-in role containing all users in this guild.
Declaration
public SocketRole EveryoneRole { get; }
Property Value
Type | Description |
---|---|
SocketRole | A role object that represents an |
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. |
ForumChannels
Gets a collection of all forum channels in this guild.
Declaration
public IReadOnlyCollection<SocketForumChannel> ForumChannels { get; }
Property Value
Type | Description |
---|---|
IReadOnlyCollection<SocketForumChannel> | A read-only collection of forum channels found within this guild. |
HasAllMembers
Indicates whether the client has all the members downloaded to the local guild cache.
Declaration
public bool HasAllMembers { get; }
Property Value
Type | Description |
---|---|
Boolean |
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 |
IsConnected
Indicates whether the client is connected to this guild.
Declaration
public bool IsConnected { get; }
Property Value
Type | Description |
---|---|
Boolean |
IsSynced
Indicates whether the guild cache is synced to this guild.
Declaration
public bool IsSynced { 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> |
MaxStageVideoChannelUsers
Declaration
public int? MaxStageVideoChannelUsers { 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> |
MemberCount
Gets the number of members.
Declaration
public int MemberCount { get; }
Property Value
Type | Description |
---|---|
Int32 |
Remarks
This property retrieves the number of members returned by Discord.
tip
Due to how this property is returned by Discord instead of relying on the WebSocket cache, the number here is the most accurate in terms of counting the number of users within this guild.
Use this instead of enumerating the count of the Users collection, as you may see discrepancy between that and this property.
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. |
Owner
Gets the user that owns this guild.
Declaration
public SocketGuildUser Owner { get; }
Property Value
Type | Description |
---|---|
SocketGuildUser |
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. |
PublicUpdatesChannel
Gets the channel where admins and moderators of Community guilds receive notices from Discord.
Declaration
public SocketTextChannel PublicUpdatesChannel { get; }
Property Value
Type | Description |
---|---|
SocketTextChannel | A text channel where admins and moderators of Community guilds receive notices from Discord; null if none is set. |
Roles
Gets a collection of all roles in this guild.
Declaration
public IReadOnlyCollection<SocketRole> Roles { get; }
Property Value
Type | Description |
---|---|
IReadOnlyCollection<SocketRole> | A read-only collection of roles found within this guild. |
RulesChannel
Gets the channel with the guild rules.
Declaration
public SocketTextChannel RulesChannel { get; }
Property Value
Type | Description |
---|---|
SocketTextChannel | A text channel with the guild rules; null if none is set. |
SafetyAlertsChannel
Gets the safety alerts channel in this guild.
Declaration
public SocketGuildChannel SafetyAlertsChannel { get; }
Property Value
Type | Description |
---|---|
SocketGuildChannel | The channel set for receiving safety alerts channel; null if none is set. |
SplashId
Declaration
public string SplashId { get; }
Property Value
Type | Description |
---|---|
String |
SplashUrl
Declaration
public string SplashUrl { get; }
Property Value
Type | Description |
---|---|
String |
StageChannels
Gets a collection of all stage channels in this guild.
Declaration
public IReadOnlyCollection<SocketStageChannel> StageChannels { get; }
Property Value
Type | Description |
---|---|
IReadOnlyCollection<SocketStageChannel> | A read-only collection of stage channels found within this guild. |
Stickers
Gets a collection of all custom stickers for this guild.
Declaration
public IReadOnlyCollection<SocketCustomSticker> Stickers { get; }
Property Value
Type | Description |
---|---|
IReadOnlyCollection<SocketCustomSticker> |
SyncPromise
Declaration
public Task SyncPromise { get; }
Property Value
Type | Description |
---|---|
Task |
SystemChannel
Gets the system channel where randomized welcome messages are sent in this guild.
Declaration
public SocketTextChannel SystemChannel { get; }
Property Value
Type | Description |
---|---|
SocketTextChannel | A text channel where randomized welcome messages will be sent to; null if none is set. |
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. |
TextChannels
Gets a collection of all text channels in this guild.
Declaration
public IReadOnlyCollection<SocketTextChannel> TextChannels { get; }
Property Value
Type | Description |
---|---|
IReadOnlyCollection<SocketTextChannel> | A read-only collection of message channels found within this guild. |
ThreadChannels
Gets a collection of all thread channels in this guild.
Declaration
public IReadOnlyCollection<SocketThreadChannel> ThreadChannels { get; }
Property Value
Type | Description |
---|---|
IReadOnlyCollection<SocketThreadChannel> | A read-only collection of thread channels found within this guild. |
Users
Gets a collection of users in this guild.
Declaration
public IReadOnlyCollection<SocketGuildUser> Users { get; }
Property Value
Type | Description |
---|---|
IReadOnlyCollection<SocketGuildUser> | A collection of guild users found within this guild. |
Remarks
This property retrieves all users found within this guild.
warning
This property may not always return all the members for large guilds (i.e. guilds containing 100+ users). If you are simply looking to get the number of users present in this guild, consider using MemberCount instead.
Otherwise, you may need to enable AlwaysDownloadUsers to fetch the full user list upon startup, or use DownloadUsersAsync() to manually download the users.
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. |
VoiceChannels
Gets a collection of all voice channels in this guild.
Declaration
public IReadOnlyCollection<SocketVoiceChannel> VoiceChannels { get; }
Property Value
Type | Description |
---|---|
IReadOnlyCollection<SocketVoiceChannel> | A read-only collection of voice channels found within this guild. |
VoiceRegionId
Declaration
public string VoiceRegionId { get; }
Property Value
Type | Description |
---|---|
String |
WidgetChannel
Gets the widget channel (i.e. the channel set in the guild's widget settings) in this guild.
Declaration
public SocketGuildChannel WidgetChannel { get; }
Property Value
Type | Description |
---|---|
SocketGuildChannel | A channel set within the server's widget settings; null if none is set. |
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> |
BulkOverwriteApplicationCommandAsync(ApplicationCommandProperties[], RequestOptions)
Overwrites the application commands within this guild.
Declaration
public async Task<IReadOnlyCollection<SocketApplicationCommand>> BulkOverwriteApplicationCommandAsync(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<SocketApplicationCommand>> | 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<SocketApplicationCommand> 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<SocketApplicationCommand> | A task that represents the asynchronous creation operation. The task result contains the command that was created. |
CreateAutoModRuleAsync(Action<AutoModRuleProperties>, RequestOptions)
Declaration
public async Task<SocketAutoModRule> CreateAutoModRuleAsync(Action<AutoModRuleProperties> props, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
Action<AutoModRuleProperties> | props | |
RequestOptions | options |
Returns
Type | Description |
---|---|
Task<SocketAutoModRule> |
CreateCategoryChannelAsync(String, Action<GuildChannelProperties>, RequestOptions)
Creates a new channel category in this guild.
Declaration
public Task<RestCategoryChannel> CreateCategoryChannelAsync(string name, Action<GuildChannelProperties> func = null, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
String | name | The new name for the category. |
Action<GuildChannelProperties> | func | The delegate containing the properties to be applied to the channel upon its creation. |
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
Task<RestCategoryChannel> | A task that represents the asynchronous creation operation. The task result contains the newly 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. |
CreateForumChannelAsync(String, Action<ForumChannelProperties>, RequestOptions)
Creates a new channel forum in this guild.
Declaration
public Task<RestForumChannel> CreateForumChannelAsync(string name, Action<ForumChannelProperties> func = null, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
String | name | The new name for the forum. |
Action<ForumChannelProperties> | func | The delegate containing the properties to be applied to the channel upon its creation. |
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
Task<RestForumChannel> | A task that represents the asynchronous creation operation. The task result contains the newly created forum channel. |
CreateRoleAsync(String, Nullable<GuildPermissions>, Nullable<Color>, Boolean, Boolean, RequestOptions)
Creates a new role with the provided name.
Declaration
public Task<RestRole> CreateRoleAsync(string name, GuildPermissions? permissions = 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, Image, IEnumerable<String>, String, RequestOptions)
Creates a new sticker in this guild.
Declaration
public async Task<SocketCustomSticker> CreateStickerAsync(string name, Image image, IEnumerable<string> tags, string description = null, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
String | name | The name of the sticker. |
Image | image | The image of the new emote. |
IEnumerable<String> | tags | The tags of the sticker. |
String | description | The description of the sticker. |
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
Task<SocketCustomSticker> | A task that represents the asynchronous creation operation. The task result contains the created sticker. |
CreateStickerAsync(String, Stream, String, IEnumerable<String>, String, RequestOptions)
Creates a new sticker in this guild
Declaration
public async Task<SocketCustomSticker> CreateStickerAsync(string name, Stream stream, string filename, IEnumerable<string> tags, string description = null, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
String | name | The name of the sticker. |
Stream | stream | The stream containing the file data. |
String | filename | The name of the file with the extension, ex: image.png. |
IEnumerable<String> | tags | The tags of the sticker. |
String | description | The description of the sticker. |
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
Task<SocketCustomSticker> | 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 async Task<SocketCustomSticker> CreateStickerAsync(string name, string path, IEnumerable<string> tags, string description = null, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
String | name | The name of the sticker. |
String | path | The path of the file to upload. |
IEnumerable<String> | tags | The tags of the sticker. |
String | description | The description of the sticker. |
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
Task<SocketCustomSticker> | 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 new voice channel in this guild.
Declaration
public Task<RestVoiceChannel> CreateVoiceChannelAsync(string name, Action<VoiceChannelProperties> func = null, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
String | name | The new name for the voice channel. |
Action<VoiceChannelProperties> | func | The delegate containing the properties to be applied to the channel upon its creation. |
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
Task<RestVoiceChannel> | A task that represents the asynchronous creation operation. The task result contains the newly created voice channel. |
DeleteApplicationCommandsAsync(RequestOptions)
Deletes all application commands in the current guild.
Declaration
public Task DeleteApplicationCommandsAsync(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. |
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 |
DeleteStickerAsync(SocketCustomSticker, RequestOptions)
Deletes a sticker within this guild.
Declaration
public Task DeleteStickerAsync(SocketCustomSticker sticker, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
SocketCustomSticker | 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. |
DownloadUsersAsync()
Declaration
public async Task DownloadUsersAsync()
Returns
Type | Description |
---|---|
Task |
GetApplicationCommandAsync(UInt64, CacheMode, RequestOptions)
Gets an application command within this guild with the specified id.
Declaration
public async ValueTask<SocketApplicationCommand> GetApplicationCommandAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | id | The id of the application command to get. |
CacheMode | mode | The CacheMode that determines whether the object should be fetched from cache. |
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
ValueTask<SocketApplicationCommand> | A ValueTask that represents the asynchronous get operation. The task result contains a IApplicationCommand if found, otherwise null. |
GetApplicationCommandsAsync(Boolean, String, RequestOptions)
Gets a collection of slash commands created by the current user in this guild.
Declaration
public async Task<IReadOnlyCollection<SocketApplicationCommand>> GetApplicationCommandsAsync(bool withLocalizations = false, string locale = null, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
Boolean | withLocalizations | Whether to include full localization dictionaries in the returned objects, instead of the name localized and description localized fields. |
String | locale | The target locale of the localized name and description fields. Sets |
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
Task<IReadOnlyCollection<SocketApplicationCommand>> | A task that represents the asynchronous get operation. The task result contains a read-only collection of slash commands created by the current user. |
GetAuditLogsAsync(Int32, RequestOptions, Nullable<UInt64>, Nullable<UInt64>, Nullable<ActionType>, Nullable<UInt64>)
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, ulong? afterId = 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 filter entries before. |
Nullable<UInt64> | userId | The user ID to filter entries for. |
Nullable<ActionType> | actionType | The type of actions to filter. |
Nullable<UInt64> | afterId | The audit log entry ID to filter entries after. |
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. |
GetAutoModRule(UInt64)
Gets a single rule configured in a guild from cache. Returns null if the rule was not found.
Declaration
public SocketAutoModRule GetAutoModRule(ulong id)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | id |
Returns
Type | Description |
---|---|
SocketAutoModRule |
GetAutoModRuleAsync(UInt64, RequestOptions)
Gets a single rule configured in a guild. Returns null if the rule was not found.
Declaration
public async Task<SocketAutoModRule> GetAutoModRuleAsync(ulong ruleId, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | ruleId | |
RequestOptions | options |
Returns
Type | Description |
---|---|
Task<SocketAutoModRule> | A task that represents the asynchronous creation operation. The task result contains a IAutoModRule. |
GetAutoModRulesAsync(RequestOptions)
Get a list of all rules currently configured for the guild.
Declaration
public async Task<SocketAutoModRule[]> GetAutoModRulesAsync(RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
RequestOptions | options |
Returns
Type | Description |
---|---|
Task<SocketAutoModRule[]> | A task that represents the asynchronous creation operation. The task result contains a collection of IAutoModRule. |
GetBanAsync(IUser, RequestOptions)
Gets a ban object for a banned user.
Declaration
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>> |
GetCachedAuditLog(UInt64)
Gets cached audit log entry with the provided id.
Declaration
public SocketAuditLogEntry GetCachedAuditLog(ulong id)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | id |
Returns
Type | Description |
---|---|
SocketAuditLogEntry |
Remarks
Returns null if no entry with provided id was found in cache.
GetCachedAuditLogs(Int32, Nullable<ActionType>, Nullable<UInt64>, Direction)
Gets audit log entries with the specified type from cache.
Declaration
public IReadOnlyCollection<SocketAuditLogEntry> GetCachedAuditLogs(int limit = null, ActionType? action = null, ulong? fromEntryId = null, Direction direction = Direction.Before)
Parameters
Type | Name | Description |
---|---|---|
Int32 | limit | |
Nullable<ActionType> | action | |
Nullable<UInt64> | fromEntryId | |
Direction | direction |
Returns
Type | Description |
---|---|
IReadOnlyCollection<SocketAuditLogEntry> |
GetCategoryChannel(UInt64)
Gets a category channel in this guild.
Declaration
public SocketCategoryChannel GetCategoryChannel(ulong id)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | id | The snowflake identifier for the category channel. |
Returns
Type | Description |
---|---|
SocketCategoryChannel | A category channel associated with the specified |
GetChannel(UInt64)
Gets a channel in this guild.
Declaration
public SocketGuildChannel GetChannel(ulong id)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | id | The snowflake identifier for the channel. |
Returns
Type | Description |
---|---|
SocketGuildChannel | A generic channel associated with the specified |
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>> |
GetEvent(UInt64)
Gets an event in this guild.
Declaration
public SocketGuildEvent GetEvent(ulong id)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | id | The snowflake identifier for the event. |
Returns
Type | Description |
---|---|
SocketGuildEvent | An event that is associated with the specified |
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. |
GetForumChannel(UInt64)
Gets a forum channel in this guild.
Declaration
public SocketForumChannel GetForumChannel(ulong id)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | id | The snowflake identifier for the forum channel. |
Returns
Type | Description |
---|---|
SocketForumChannel | A forum channel associated with the specified |
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. |
GetOnboardingAsync(RequestOptions)
Gets the onboarding object configured for the guild.
Declaration
public async Task<SocketGuildOnboarding> GetOnboardingAsync(RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
RequestOptions | options |
Returns
Type | Description |
---|---|
Task<SocketGuildOnboarding> | A task that represents the asynchronous creation operation. The task result contains the created IGuildOnboarding. |
GetRole(UInt64)
Gets a role in this guild.
Declaration
public SocketRole GetRole(ulong id)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | id | The snowflake identifier for the role. |
Returns
Type | Description |
---|---|
SocketRole | A role that is associated with the specified |
GetStageChannel(UInt64)
Gets a stage channel in this guild.
Declaration
public SocketStageChannel GetStageChannel(ulong id)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | id | The snowflake identifier for the stage channel. |
Returns
Type | Description |
---|---|
SocketStageChannel | A stage channel associated with the specified |
GetSticker(UInt64)
Gets a specific sticker within this guild.
Declaration
public SocketCustomSticker GetSticker(ulong id)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | id | The id of the sticker to get. |
Returns
Type | Description |
---|---|
SocketCustomSticker | A sticker, if none is found then null. |
GetStickerAsync(UInt64, CacheMode, RequestOptions)
Gets a specific sticker within this guild.
Declaration
public async ValueTask<SocketCustomSticker> GetStickerAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | id | The id of the sticker to get. |
CacheMode | mode | The CacheMode that determines whether the object should be fetched from cache. |
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
ValueTask<SocketCustomSticker> | A task that represents the asynchronous get operation. The task result contains the sticker found with the
specified |
GetStickersAsync(CacheMode, RequestOptions)
Gets a collection of all stickers within this guild.
Declaration
public async ValueTask<IReadOnlyCollection<SocketCustomSticker>> GetStickersAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
CacheMode | mode | The CacheMode that determines whether the object should be fetched from cache. |
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
ValueTask<IReadOnlyCollection<SocketCustomSticker>> | A task that represents the asynchronous get operation. The task result contains a read-only collection of stickers found within the guild. |
GetTextChannel(UInt64)
Gets a text channel in this guild.
Declaration
public SocketTextChannel GetTextChannel(ulong id)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | id | The snowflake identifier for the text channel. |
Returns
Type | Description |
---|---|
SocketTextChannel | A text channel associated with the specified |
GetThreadChannel(UInt64)
Gets a thread in this guild.
Declaration
public SocketThreadChannel GetThreadChannel(ulong id)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | id | The snowflake identifier for the thread. |
Returns
Type | Description |
---|---|
SocketThreadChannel | A thread channel associated with the specified |
GetUser(UInt64)
Gets a user from this guild.
Declaration
public SocketGuildUser GetUser(ulong id)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | id | The snowflake identifier of the user. |
Returns
Type | Description |
---|---|
SocketGuildUser | A guild user associated with the specified |
Remarks
This method retrieves a user found within this guild.
note
This may return null in the WebSocket implementation due to incomplete user collection in large guilds.
GetUsersAsync(RequestOptions)
Gets a collection of all users in this guild.
Declaration
public IAsyncEnumerable<IReadOnlyCollection<IGuildUser>> GetUsersAsync(RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
IAsyncEnumerable<IReadOnlyCollection<IGuildUser>> | A task that represents the asynchronous get operation. The task result contains a collection of guild users found within this guild. |
Remarks
This method retrieves all users found within this guild through REST.
Users returned by this method are not cached.
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 task that represents the asynchronous get operation. The task result contains the partial metadata of the vanity invite found within this guild; null if none is found. |
GetVoiceChannel(UInt64)
Gets a voice channel in this guild.
Declaration
public SocketVoiceChannel GetVoiceChannel(ulong id)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | id | The snowflake identifier for the voice channel. |
Returns
Type | Description |
---|---|
SocketVoiceChannel | A voice channel associated with the specified |
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. |
GetWelcomeScreenAsync(RequestOptions)
Declaration
public Task<WelcomeScreen> GetWelcomeScreenAsync(RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
RequestOptions | options |
Returns
Type | Description |
---|---|
Task<WelcomeScreen> |
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 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> |
ModifyOnboardingAsync(Action<GuildOnboardingProperties>, RequestOptions)
Declaration
public async Task<SocketGuildOnboarding> ModifyOnboardingAsync(Action<GuildOnboardingProperties> props, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
Action<GuildOnboardingProperties> | props | |
RequestOptions | options |
Returns
Type | Description |
---|---|
Task<SocketGuildOnboarding> |
ModifyWelcomeScreenAsync(Boolean, WelcomeScreenChannelProperties[], String, RequestOptions)
Declaration
public Task<WelcomeScreen> ModifyWelcomeScreenAsync(bool enabled, WelcomeScreenChannelProperties[] channels, string description = null, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
Boolean | enabled | |
WelcomeScreenChannelProperties[] | channels | |
String | description | |
RequestOptions | options |
Returns
Type | Description |
---|---|
Task<WelcomeScreen> |
ModifyWidgetAsync(Action<GuildWidgetProperties>, RequestOptions)
Declaration
public 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>)
Declaration
public Task<int> PruneUsersAsync(int days = 30, bool simulate = false, RequestOptions options = null, IEnumerable<ulong> includeRoleIds = null)
Parameters
Type | Name | Description |
---|---|---|
Int32 | days | |
Boolean | simulate | |
RequestOptions | options | |
IEnumerable<UInt64> | includeRoleIds |
Returns
Type | Description |
---|---|
Task<Int32> |
PurgeUserCache()
Purges this guild's user cache.
Declaration
public void PurgeUserCache()
PurgeUserCache(Func<SocketGuildUser, Boolean>)
Purges this guild's user cache.
Declaration
public void PurgeUserCache(Func<SocketGuildUser, bool> predicate)
Parameters
Type | Name | Description |
---|---|---|
Func<SocketGuildUser, Boolean> | predicate | The predicate used to select which users to clear. |
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 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 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()
Gets the name of the guild.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String | A string that resolves to Name. |
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 |