Class RestGuild
Represents a REST-based guild/server.
Assembly: Discord.Net.Rest.dll​
View Source​
public class RestGuild : RestEntity<ulong>, IGuild, IDeletable, ISnowflakeEntity, IEntity<ulong>, IUpdateable
Properties​
Name​
Gets the name of this guild.
View Source​
public string Name { get; }
AFKTimeout​
Gets the amount of time (in seconds) a user must be inactive in a voice channel for until they are automatically moved to the AFK voice channel.
View Source​
public int AFKTimeout { get; }
IsWidgetEnabled​
Gets a value that indicates whether this guild has the widget enabled.
View Source​
public bool IsWidgetEnabled { get; }
VerificationLevel​
Gets the level of requirements a user must fulfill before being allowed to post messages in this guild.
View Source​
public VerificationLevel VerificationLevel { get; }
MfaLevel​
Gets the level of Multi-Factor Authentication requirements a user must fulfill before being allowed to perform administrative actions in this guild.
View Source​
public MfaLevel MfaLevel { get; }
DefaultMessageNotifications​
Gets the default message notifications for users who haven't explicitly set their notification settings.
View Source​
public DefaultMessageNotifications DefaultMessageNotifications { get; }
ExplicitContentFilter​
Gets the level of content filtering applied to user's content in a Guild.
View Source​
public ExplicitContentFilterLevel ExplicitContentFilter { get; }
AFKChannelId​
Gets the ID of the AFK voice channel for this guild.
View Source​
public ulong? AFKChannelId { get; }
WidgetChannelId​
Gets the ID of the channel assigned to the widget of this guild.
View Source​
public ulong? WidgetChannelId { get; }
SystemChannelId​
Gets the ID of the channel where randomized welcome messages are sent.
View Source​
public ulong? SystemChannelId { get; }
RulesChannelId​
Gets the ID of the channel with the rules.
View Source​
public ulong? RulesChannelId { get; }
PublicUpdatesChannelId​
Gets the ID of the channel where admins and moderators of Community guilds receive notices from Discord.
View Source​
public ulong? PublicUpdatesChannelId { get; }
OwnerId​
Gets the ID of the user that owns this guild.
View Source​
public ulong OwnerId { get; }
VoiceRegionId​
Gets the ID of the region hosting this guild's voice channels.
View Source​
public string VoiceRegionId { get; }
IconId​
Gets the ID of this guild's icon.
View Source​
public string IconId { get; }
SplashId​
Gets the ID of this guild's splash image.
View Source​
public string SplashId { get; }
DiscoverySplashId​
Gets the ID of this guild's discovery splash image.
View Source​
public string DiscoverySplashId { get; }
ApplicationId​
Gets the application ID of the guild creator if it is bot-created.
View Source​
public ulong? ApplicationId { get; }
PremiumTier​
Gets the tier of guild boosting in this guild.
View Source​
public PremiumTier PremiumTier { get; }
BannerId​
Gets the identifier for this guilds banner image.
View Source​
public string BannerId { get; }
VanityURLCode​
Gets the code for this guild's vanity invite URL.
View Source​
public string VanityURLCode { get; }
SystemChannelFlags​
Gets the flags for the types of system channel messages that are disabled.
View Source​
public SystemChannelMessageDeny SystemChannelFlags { get; }
Description​
Gets the description for the guild.
View Source​
public string Description { get; }
PremiumSubscriptionCount​
Gets the number of premium subscribers of this guild.
View Source​
public int PremiumSubscriptionCount { get; }
PreferredLocale​
Gets the preferred locale of this guild in IETF BCP 47 language tag format.
View Source​
public string PreferredLocale { get; }
MaxPresences​
Gets the maximum number of presences for the guild.
View Source​
public int? MaxPresences { get; }
MaxMembers​
Gets the maximum number of members for the guild.
View Source​
public int? MaxMembers { get; }
MaxVideoChannelUsers​
Gets the maximum amount of users in a video channel.
View Source​
public int? MaxVideoChannelUsers { get; }
ApproximateMemberCount​
Gets the approximate number of members in this guild.
View Source​
public int? ApproximateMemberCount { get; }
ApproximatePresenceCount​
Gets the approximate number of non-offline members in this guild.
View Source​
public int? ApproximatePresenceCount { get; }
MaxBitrate​
Gets the max bitrate for voice channels in this guild.
View Source​
public int MaxBitrate { get; }
NsfwLevel​
Gets the NSFW level of this guild.
View Source​
public NsfwLevel NsfwLevel { get; }
IsBoostProgressBarEnabled​
Gets whether the guild has the boost progress bar enabled.
View Source​
public bool IsBoostProgressBarEnabled { get; }
PreferredCulture​
Gets the preferred culture of this guild.
View Source​
public CultureInfo PreferredCulture { get; }
Features​
Gets the features for this guild.
View Source​
public GuildFeatures Features { get; }
CreatedAt​
Gets when the snowflake was created.
View Source​
public DateTimeOffset CreatedAt { get; }
IconUrl​
Gets the URL of this guild's icon.
View Source​
public string IconUrl { get; }
SplashUrl​
Gets the URL of this guild's splash image.
View Source​
public string SplashUrl { get; }
DiscoverySplashUrl​
Gets the URL of this guild's discovery splash image.
View Source​
public string DiscoverySplashUrl { get; }
BannerUrl​
Gets the URL of this guild's banner image.
View Source​
public string BannerUrl { get; }
EveryoneRole​
Gets the built-in role containing all users in this guild.
View Source​
public RestRole EveryoneRole { get; }
Roles​
Gets a collection of all roles in this guild.
View Source​
public IReadOnlyCollection<RestRole> Roles { get; }
Emotes​
Gets a collection of all custom emotes for this guild.
View Source​
public IReadOnlyCollection<GuildEmote> Emotes { get; }
Stickers​
View Source​
public IReadOnlyCollection<CustomSticker> Stickers { get; }
IGuild.Available​
Determines if this guild is currently connected and ready to be used.
View Source​
bool IGuild.Available { get; }
IGuild.AudioClient​
Gets the Discord.Audio.IAudioClient currently associated with this guild.
View Source​
IAudioClient IGuild.AudioClient { get; }
IGuild.EveryoneRole​
Gets the built-in role containing all users in this guild.
View Source​
IRole IGuild.EveryoneRole { get; }
IGuild.Roles​
Gets a collection of all roles in this guild.
View Source​
IReadOnlyCollection<IRole> IGuild.Roles { get; }
IGuild.Stickers​
View Source​
IReadOnlyCollection<ICustomSticker> IGuild.Stickers { get; }
Methods​
UpdateAsync(RequestOptions)​
Updates this object's properties with its current state.
View Source​
public async Task UpdateAsync(RequestOptions options = null)
Returns​
System.Threading.Tasks.Task
Parameters​
Type | Name | Description |
---|---|---|
Discord.RequestOptions | options | The options to be used when sending the request. |
UpdateAsync(Boolean, RequestOptions)​
Updates this object's properties with its current state.
View Source​
public async Task UpdateAsync(bool withCounts, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task
Parameters​
Type | Name | Description |
---|---|---|
System.Boolean | withCounts |
If true, Discord.Rest.RestGuild.ApproximateMemberCount and Discord.Rest.RestGuild.ApproximatePresenceCount will be updated as well. | | Discord.RequestOptions | options | The options to be used when sending the request. |
DeleteAsync(RequestOptions)​
Deletes this object and all its children.
View Source​
public Task DeleteAsync(RequestOptions options = null)
Returns​
System.Threading.Tasks.Task
Parameters​
Type | Name | Description |
---|---|---|
Discord.RequestOptions | options | The options to be used when sending the request. |
ModifyAsync(Action<GuildProperties>, RequestOptions)​
Modifies this guild.
View Source​
public async Task ModifyAsync(Action<GuildProperties> func, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task
:
A task that represents the asynchronous modification operation.
Parameters​
Type | Name | Description |
---|---|---|
System.Action<Discord.GuildProperties> | func | The delegate containing the properties to modify the guild with. |
Discord.RequestOptions | options | The options to be used when sending the request. |
ModifyWidgetAsync(Action<GuildWidgetProperties>, RequestOptions)​
Modifies this guild's widget.
View Source​
public async Task ModifyWidgetAsync(Action<GuildWidgetProperties> func, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task
:
A task that represents the asynchronous modification operation.
Parameters​
Type | Name | Description |
---|---|---|
System.Action<Discord.GuildWidgetProperties> | func | The delegate containing the properties to modify the guild widget with. |
Discord.RequestOptions | options | The options to be used when sending the request. |
ReorderChannelsAsync(IEnumerable<ReorderChannelProperties>, RequestOptions)​
Bulk-modifies the order of channels in this guild.
View Source​
public async Task ReorderChannelsAsync(IEnumerable<ReorderChannelProperties> args, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task
:
A task that represents the asynchronous reorder operation.
Parameters​
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<Discord.ReorderChannelProperties> | args | The properties used to modify the channel positions with. |
Discord.RequestOptions | options | The options to be used when sending the request. |
ReorderRolesAsync(IEnumerable<ReorderRoleProperties>, RequestOptions)​
Bulk-modifies the order of roles in this guild.
View Source​
public async Task ReorderRolesAsync(IEnumerable<ReorderRoleProperties> args, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task
:
A task that represents the asynchronous reorder operation.
Parameters​
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<Discord.ReorderRoleProperties> | args | The properties used to modify the role positions with. |
Discord.RequestOptions | options | The options to be used when sending the request. |
LeaveAsync(RequestOptions)​
Leaves this guild.
View Source​
public Task LeaveAsync(RequestOptions options = null)
Returns​
System.Threading.Tasks.Task
:
A task that represents the asynchronous leave operation.
Parameters​
Type | Name | Description |
---|---|---|
Discord.RequestOptions | options | The options to be used when sending the request. |
DeleteSlashCommandsAsync(RequestOptions)​
Deletes all slash commands in the current guild.
View Source​
public Task DeleteSlashCommandsAsync(RequestOptions options = null)
Returns​
System.Threading.Tasks.Task
:
A task that represents the asynchronous delete operation.
Parameters​
Type | Name | Description |
---|---|---|
Discord.RequestOptions | options | The options to be used when sending the request. |
GetSlashCommandsAsync(RequestOptions)​
Gets a collection of slash commands created by the current user in this guild.
View Source​
public Task<IReadOnlyCollection<RestGuildCommand>> GetSlashCommandsAsync(RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.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.
Parameters​
Type | Name | Description |
---|---|---|
Discord.RequestOptions | options | The options to be used when sending the request. |
GetSlashCommandAsync(UInt64, RequestOptions)​
Gets a slash command in the current guild.
View Source​
public Task<RestGuildCommand> GetSlashCommandAsync(ulong id, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<Discord.Rest.RestGuildCommand>
:
A task that represents the asynchronous get operation. The task result contains a
slash command created by the current user.
Parameters​
Type | Name | Description |
---|---|---|
System.UInt64 | id | The unique identifier of the slash command. |
Discord.RequestOptions | options | The options to be used when sending the request. |
GetBansAsync(RequestOptions)​
Gets a collection of all users banned in this guild.
View Source​
public Task<IReadOnlyCollection<RestBan>> GetBansAsync(RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.RestBan>>
:
A task that represents the asynchronous get operation. The task result contains a read-only collection of
ban objects that this guild currently possesses, with each object containing the user banned and reason
behind the ban.
Parameters​
Type | Name | Description |
---|---|---|
Discord.RequestOptions | options | The options to be used when sending the request. |
GetBanAsync(IUser, RequestOptions)​
Gets a ban object for a banned user.
View Source​
public Task<RestBan> GetBanAsync(IUser user, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<Discord.Rest.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.
Parameters​
Type | Name | Description |
---|---|---|
Discord.IUser | user | The banned user. |
Discord.RequestOptions | options | The options to be used when sending the request. |
GetBanAsync(UInt64, RequestOptions)​
Gets a ban object for a banned user.
View Source​
public Task<RestBan> GetBanAsync(ulong userId, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<Discord.Rest.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.
Parameters​
Type | Name | Description |
---|---|---|
System.UInt64 | userId | The snowflake identifier for the banned user. |
Discord.RequestOptions | options | The options to be used when sending the request. |
AddBanAsync(IUser, Int32, String, RequestOptions)​
Bans the user from this guild and optionally prunes their recent messages.
View Source​
public Task AddBanAsync(IUser user, int pruneDays = 0, string reason = null, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task
:
A task that represents the asynchronous add operation for the ban.
Parameters​
Type | Name | Description |
---|---|---|
Discord.IUser | user | The user to ban. |
System.Int32 | pruneDays | The number of days to remove messages from this user for, and this number must be between [0, 7]. |
System.String | reason | The reason of the ban to be written in the audit log. |
Discord.RequestOptions | options | The options to be used when sending the request. |
AddBanAsync(UInt64, Int32, String, RequestOptions)​
Bans the user from this guild and optionally prunes their recent messages.
View Source​
public Task AddBanAsync(ulong userId, int pruneDays = 0, string reason = null, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task
:
A task that represents the asynchronous add operation for the ban.
Parameters​
Type | Name | Description |
---|---|---|
System.UInt64 | userId | The snowflake ID of the user to ban. |
System.Int32 | pruneDays | The number of days to remove messages from this user for, and this number must be between [0, 7]. |
System.String | reason | The reason of the ban to be written in the audit log. |
Discord.RequestOptions | options | The options to be used when sending the request. |
RemoveBanAsync(IUser, RequestOptions)​
Unbans the user if they are currently banned.
View Source​
public Task RemoveBanAsync(IUser user, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task
:
A task that represents the asynchronous removal operation for the ban.
Parameters​
Type | Name | Description |
---|---|---|
Discord.IUser | user | The user to be unbanned. |
Discord.RequestOptions | options | The options to be used when sending the request. |
RemoveBanAsync(UInt64, RequestOptions)​
Unbans the user if they are currently banned.
View Source​
public Task RemoveBanAsync(ulong userId, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task
:
A task that represents the asynchronous removal operation for the ban.
Parameters​
Type | Name | Description |
---|---|---|
System.UInt64 | userId | The snowflake identifier of the user to be unbanned. |
Discord.RequestOptions | options | The options to be used when sending the request. |
GetChannelsAsync(RequestOptions)​
Gets a collection of all channels in this guild.
View Source​
public Task<IReadOnlyCollection<RestGuildChannel>> GetChannelsAsync(RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.RestGuildChannel>>
:
A task that represents the asynchronous get operation. The task result contains a read-only collection of
generic channels found within this guild.
Parameters​
Type | Name | Description |
---|---|---|
Discord.RequestOptions | options | The options to be used when sending the request. |
GetChannelAsync(UInt64, RequestOptions)​
Gets a channel in this guild.
View Source​
public Task<RestGuildChannel> GetChannelAsync(ulong id, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<Discord.Rest.RestGuildChannel>
:
A task that represents the asynchronous get operation. The task result contains the generic channel
associated with the specified <code data-dev-comment-type="paramref" class="paramref">id</code>; null
if none is found.
Parameters​
Type | Name | Description |
---|---|---|
System.UInt64 | id | The snowflake identifier for the channel. |
Discord.RequestOptions | options | The options to be used when sending the request. |
GetTextChannelAsync(UInt64, RequestOptions)​
Gets a text channel in this guild.
View Source​
public async Task<RestTextChannel> GetTextChannelAsync(ulong id, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<Discord.Rest.RestTextChannel>
:
A task that represents the asynchronous get operation. The task result contains the text channel
associated with the specified <code data-dev-comment-type="paramref" class="paramref">id</code>; null
if none is found.
Parameters​
Type | Name | Description |
---|---|---|
System.UInt64 | id | The snowflake identifier for the text channel. |
Discord.RequestOptions | options | The options to be used when sending the request. |
GetTextChannelsAsync(RequestOptions)​
Gets a collection of all text channels in this guild.
View Source​
public async Task<IReadOnlyCollection<RestTextChannel>> GetTextChannelsAsync(RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.RestTextChannel>>
:
A task that represents the asynchronous get operation. The task result contains a read-only collection of
message channels found within this guild.
Parameters​
Type | Name | Description |
---|---|---|
Discord.RequestOptions | options | The options to be used when sending the request. |
GetThreadChannelAsync(UInt64, RequestOptions)​
Gets a thread channel in this guild.
View Source​
public async Task<RestThreadChannel> GetThreadChannelAsync(ulong id, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<Discord.Rest.RestThreadChannel>
:
A task that represents the asynchronous get operation. The task result contains the thread channel associated
with the specified <code data-dev-comment-type="paramref" class="paramref">id</code>; null
if none is found.
Parameters​
Type | Name | Description |
---|---|---|
System.UInt64 | id | The snowflake identifier for the thread channel. |
Discord.RequestOptions | options | The options to be used when sending the request. |
GetThreadChannelsAsync(RequestOptions)​
Gets a collection of all thread in this guild.
View Source​
public async Task<IReadOnlyCollection<RestThreadChannel>> GetThreadChannelsAsync(RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.RestThreadChannel>>
:
A task that represents the asynchronous get operation. The task result contains a read-only collection of
threads found within this guild.
Parameters​
Type | Name | Description |
---|---|---|
Discord.RequestOptions | options | The options to be used when sending the request. |
GetVoiceChannelAsync(UInt64, RequestOptions)​
Gets a voice channel in this guild.
View Source​
public async Task<RestVoiceChannel> GetVoiceChannelAsync(ulong id, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<Discord.Rest.RestVoiceChannel>
:
A task that represents the asynchronous get operation. The task result contains the voice channel associated
with the specified <code data-dev-comment-type="paramref" class="paramref">id</code>; null
if none is found.
Parameters​
Type | Name | Description |
---|---|---|
System.UInt64 | id | The snowflake identifier for the voice channel. |
Discord.RequestOptions | options | The options to be used when sending the request. |
GetVoiceChannelsAsync(RequestOptions)​
Gets a collection of all voice channels in this guild.
View Source​
public async Task<IReadOnlyCollection<RestVoiceChannel>> GetVoiceChannelsAsync(RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.RestVoiceChannel>>
:
A task that represents the asynchronous get operation. The task result contains a read-only collection of
voice channels found within this guild.
Parameters​
Type | Name | Description |
---|---|---|
Discord.RequestOptions | options | The options to be used when sending the request. |
GetStageChannelAsync(UInt64, RequestOptions)​
Gets a stage channel in this guild
View Source​
public async Task<RestStageChannel> GetStageChannelAsync(ulong id, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<Discord.Rest.RestStageChannel>
:
A task that represents the asynchronous get operation. The task result contains the stage channel associated
with the specified <code data-dev-comment-type="paramref" class="paramref">id</code>; null
if none is found.
Parameters​
Type | Name | Description |
---|---|---|
System.UInt64 | id | The snowflake identifier for the stage channel. |
Discord.RequestOptions | options | The options to be used when sending the request. |
GetStageChannelsAsync(RequestOptions)​
Gets a collection of all stage channels in this guild.
View Source​
public async Task<IReadOnlyCollection<RestStageChannel>> GetStageChannelsAsync(RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.RestStageChannel>>
:
A task that represents the asynchronous get operation. The task result contains a read-only collection of
stage channels found within this guild.
Parameters​
Type | Name | Description |
---|---|---|
Discord.RequestOptions | options | The options to be used when sending the request. |
GetCategoryChannelsAsync(RequestOptions)​
Gets a collection of all category channels in this guild.
View Source​
public async Task<IReadOnlyCollection<RestCategoryChannel>> GetCategoryChannelsAsync(RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.RestCategoryChannel>>
:
A task that represents the asynchronous get operation. The task result contains a read-only collection of
category channels found within this guild.
Parameters​
Type | Name | Description |
---|---|---|
Discord.RequestOptions | options | The options to be used when sending the request. |
GetAFKChannelAsync(RequestOptions)​
Gets the AFK voice channel in this guild.
View Source​
public async Task<RestVoiceChannel> GetAFKChannelAsync(RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<Discord.Rest.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.
Parameters​
Type | Name | Description |
---|---|---|
Discord.RequestOptions | options | The options to be used when sending the request. |
GetDefaultChannelAsync(RequestOptions)​
Gets the first viewable text channel in this guild.
View Source​
public async Task<RestTextChannel> GetDefaultChannelAsync(RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<Discord.Rest.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.
Parameters​
Type | Name | Description |
---|---|---|
Discord.RequestOptions | options | The options to be used when sending the request. |
GetWidgetChannelAsync(RequestOptions)​
Gets the widget channel (i.e. the channel set in the guild's widget settings) in this guild.
View Source​
public async Task<RestGuildChannel> GetWidgetChannelAsync(RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<Discord.Rest.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.
Parameters​
Type | Name | Description |
---|---|---|
Discord.RequestOptions | options | The options to be used when sending the request. |
GetSystemChannelAsync(RequestOptions)​
Gets the text channel where guild notices such as welcome messages and boost events are posted.
View Source​
public async Task<RestTextChannel> GetSystemChannelAsync(RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<Discord.Rest.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.
Parameters​
Type | Name | Description |
---|---|---|
Discord.RequestOptions | options | The options to be used when sending the request. |
GetRulesChannelAsync(RequestOptions)​
Gets the text channel where Community guilds can display rules and/or guidelines.
View Source​
public async Task<RestTextChannel> GetRulesChannelAsync(RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<Discord.Rest.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.
Parameters​
Type | Name | Description |
---|---|---|
Discord.RequestOptions | options | The options to be used when sending the request. |
GetPublicUpdatesChannelAsync(RequestOptions)​
Gets the text channel where admins and moderators of Community guilds receive notices from Discord.
View Source​
public async Task<RestTextChannel> GetPublicUpdatesChannelAsync(RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<Discord.Rest.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.
Parameters​
Type | Name | Description |
---|---|---|
Discord.RequestOptions | options | The options to be used when sending the request. |
CreateTextChannelAsync(String, Action<TextChannelProperties>, RequestOptions)​
Creates a new text channel in this guild.
View Source​
public Task<RestTextChannel> CreateTextChannelAsync(string name, Action<TextChannelProperties> func = null, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<Discord.Rest.RestTextChannel>
:
A task that represents the asynchronous creation operation. The task result contains the newly created
text channel.
Parameters​
Type | Name | Description |
---|---|---|
System.String | name | The new name for the text channel. |
System.Action<Discord.TextChannelProperties> | func | The delegate containing the properties to be applied to the channel upon its creation. |
Discord.RequestOptions | options | The options to be used when sending the request. |
CreateVoiceChannelAsync(String, Action<VoiceChannelProperties>, RequestOptions)​
Creates a voice channel with the provided name.
View Source​
public Task<RestVoiceChannel> CreateVoiceChannelAsync(string name, Action<VoiceChannelProperties> func = null, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<Discord.Rest.RestVoiceChannel>
:
The created voice channel.
Parameters​
Type | Name | Description |
---|---|---|
System.String | name | The name of the new channel. |
System.Action<Discord.VoiceChannelProperties> | func | The delegate containing the properties to be applied to the channel upon its creation. |
Discord.RequestOptions | options | The options to be used when sending the request. |
CreateStageChannelAsync(String, Action<VoiceChannelProperties>, RequestOptions)​
Creates a new stage channel in this guild.
View Source​
public Task<RestStageChannel> CreateStageChannelAsync(string name, Action<VoiceChannelProperties> func = null, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<Discord.Rest.RestStageChannel>
:
A task that represents the asynchronous creation operation. The task result contains the newly created
stage channel.
Parameters​
Type | Name | Description |
---|---|---|
System.String | name | The new name for the stage channel. |
System.Action<Discord.VoiceChannelProperties> | func | The delegate containing the properties to be applied to the channel upon its creation. |
Discord.RequestOptions | options | The options to be used when sending the request. |
CreateCategoryChannelAsync(String, Action<GuildChannelProperties>, RequestOptions)​
Creates a category channel with the provided name.
View Source​
public Task<RestCategoryChannel> CreateCategoryChannelAsync(string name, Action<GuildChannelProperties> func = null, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<Discord.Rest.RestCategoryChannel>
:
The created category channel.
Parameters​
Type | Name | Description |
---|---|---|
System.String | name | The name of the new channel. |
System.Action<Discord.GuildChannelProperties> | func | The delegate containing the properties to be applied to the channel upon its creation. |
Discord.RequestOptions | options | The options to be used when sending the request. |
GetVoiceRegionsAsync(RequestOptions)​
Gets a collection of all the voice regions this guild can access.
View Source​
public Task<IReadOnlyCollection<RestVoiceRegion>> GetVoiceRegionsAsync(RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.RestVoiceRegion>>
:
A task that represents the asynchronous get operation. The task result contains a read-only collection of
voice regions the guild can access.
Parameters​
Type | Name | Description |
---|---|---|
Discord.RequestOptions | options | The options to be used when sending the request. |
GetIntegrationsAsync(RequestOptions)​
View Source​
public Task<IReadOnlyCollection<RestGuildIntegration>> GetIntegrationsAsync(RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.RestGuildIntegration>>
Parameters​
Type | Name |
---|---|
Discord.RequestOptions | options |
CreateIntegrationAsync(UInt64, String, RequestOptions)​
View Source​
public Task<RestGuildIntegration> CreateIntegrationAsync(ulong id, string type, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<Discord.Rest.RestGuildIntegration>
Parameters​
Type | Name |
---|---|
System.UInt64 | id |
System.String | type |
Discord.RequestOptions | options |
GetInvitesAsync(RequestOptions)​
Gets a collection of all invites in this guild.
View Source​
public Task<IReadOnlyCollection<RestInviteMetadata>> GetInvitesAsync(RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.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.
Parameters​
Type | Name | Description |
---|---|---|
Discord.RequestOptions | options | The options to be used when sending the request. |
GetVanityInviteAsync(RequestOptions)​
Gets the vanity invite URL of this guild.
View Source​
public Task<RestInviteMetadata> GetVanityInviteAsync(RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<Discord.Rest.RestInviteMetadata>
:
A partial metadata of the vanity invite found within this guild.
Parameters​
Type | Name | Description |
---|---|---|
Discord.RequestOptions | options | The options to be used when sending the request. |
GetRole(UInt64)​
Gets a role in this guild.
View Source​
public RestRole GetRole(ulong id)
Returns​
Discord.Rest.RestRole:
A role that is associated with the specified <code data-dev-comment-type="paramref" class="paramref">id</code>; null
if none is found.
Parameters​
Type | Name | Description |
---|---|---|
System.UInt64 | id | The snowflake identifier for the role. |
CreateRoleAsync(String, Nullable<GuildPermissions>, Nullable<Color>, Boolean, RequestOptions)​
View Source​
public Task<RestRole> CreateRoleAsync(string name, GuildPermissions? permissions = null, Color? color = null, bool isHoisted = false, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<Discord.Rest.RestRole>
Parameters​
Type | Name |
---|---|
System.String | name |
System.Nullable<Discord.GuildPermissions> | permissions |
System.Nullable<Discord.Color> | color |
System.Boolean | isHoisted |
Discord.RequestOptions | options |
CreateRoleAsync(String, Nullable<GuildPermissions>, Nullable<Color>, Boolean, Boolean, RequestOptions)​
Creates a new role with the provided name.
View Source​
public async Task<RestRole> CreateRoleAsync(string name, GuildPermissions? permissions = null, Color? color = null, bool isHoisted = false, bool isMentionable = false, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<Discord.Rest.RestRole>
:
A task that represents the asynchronous creation operation. The task result contains the newly created
role.
Parameters​
Type | Name | Description |
---|---|---|
System.String | name | The new name for the role. |
System.Nullable<Discord.GuildPermissions> | permissions | The guild permission that the role should possess. |
System.Nullable<Discord.Color> | color | The color of the role. |
System.Boolean | isHoisted | Whether the role is separated from others on the sidebar. |
System.Boolean | isMentionable | Whether the role can be mentioned. |
Discord.RequestOptions | options | The options to be used when sending the request. |
GetUsersAsync(RequestOptions)​
Gets a collection of all users in this guild.
View Source​
public IAsyncEnumerable<IReadOnlyCollection<RestGuildUser>> GetUsersAsync(RequestOptions options = null)
Returns​
System.Collections.Generic.IAsyncEnumerable<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.RestGuildUser>>
:
A task that represents the asynchronous get operation. The task result contains a collection of guild
users found within this guild.
Parameters​
Type | Name | Description |
---|---|---|
Discord.RequestOptions | options | The options to be used when sending the request. |
AddGuildUserAsync(UInt64, String, Action<AddGuildUserProperties>, RequestOptions)​
View Source​
public Task<RestGuildUser> AddGuildUserAsync(ulong id, string accessToken, Action<AddGuildUserProperties> func = null, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<Discord.Rest.RestGuildUser>
Parameters​
Type | Name |
---|---|
System.UInt64 | id |
System.String | accessToken |
System.Action<Discord.AddGuildUserProperties> | func |
Discord.RequestOptions | options |
GetUserAsync(UInt64, RequestOptions)​
Gets a user from this guild.
View Source​
public Task<RestGuildUser> GetUserAsync(ulong id, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<Discord.Rest.RestGuildUser>
:
A task that represents the asynchronous get operation. The task result contains the guild user
associated with the specified <code data-dev-comment-type="paramref" class="paramref">id</code>; null
if none is found.
Parameters​
Type | Name | Description |
---|---|---|
System.UInt64 | id | The snowflake identifier of the user. |
Discord.RequestOptions | options | The options to be used when sending the request. |
GetCurrentUserAsync(RequestOptions)​
Gets the current user for this guild.
View Source​
public Task<RestGuildUser> GetCurrentUserAsync(RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<Discord.Rest.RestGuildUser>
:
A task that represents the asynchronous get operation. The task result contains the currently logged-in
user within this guild.
Parameters​
Type | Name | Description |
---|---|---|
Discord.RequestOptions | options | The options to be used when sending the request. |
GetOwnerAsync(RequestOptions)​
Gets the owner of this guild.
View Source​
public Task<RestGuildUser> GetOwnerAsync(RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<Discord.Rest.RestGuildUser>
:
A task that represents the asynchronous get operation. The task result contains the owner of this guild.
Parameters​
Type | Name | Description |
---|---|---|
Discord.RequestOptions | options | The options to be used when sending the request. |
PruneUsersAsync(Int32, Boolean, RequestOptions, IEnumerable<UInt64>)​
Prunes inactive users.
View Source​
public Task<int> PruneUsersAsync(int days = 30, bool simulate = false, RequestOptions options = null, IEnumerable<ulong> includeRoleIds = null)
Returns​
System.Threading.Tasks.Task<System.Int32>
:
A task that represents the asynchronous prune operation. The task result contains the number of users to
be or has been removed from this guild.
Parameters​
Type | Name | Description |
---|---|---|
System.Int32 | days | The number of days required for the users to be kicked. |
System.Boolean | simulate | Whether this prune action is a simulation. |
Discord.RequestOptions | options | The options to be used when sending the request. |
System.Collections.Generic.IEnumerable<System.UInt64> | includeRoleIds | An array of role IDs to be included in the prune of users who do not have any additional roles. |
SearchUsersAsync(String, Int32, RequestOptions)​
Gets a collection of users in this guild that the name or nickname starts with the
provided System.String
at <code data-dev-comment-type="paramref" class="paramref">query</code>.
View Source​
public Task<IReadOnlyCollection<RestGuildUser>> SearchUsersAsync(string query, int limit = 1000, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.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 System.String
at <code data-dev-comment-type="paramref" class="paramref">query</code>.
Parameters​
Type | Name | Description |
---|---|---|
System.String | query | The partial name or nickname to search. |
System.Int32 | limit | The maximum number of users to be gotten. |
Discord.RequestOptions | options | The options to be used when sending the request. |
GetAuditLogsAsync(Int32, RequestOptions, Nullable<UInt64>, Nullable<UInt64>, Nullable<ActionType>)​
Gets the specified number of audit log entries for this guild.
View Source​
public IAsyncEnumerable<IReadOnlyCollection<RestAuditLogEntry>> GetAuditLogsAsync(int limit, RequestOptions options = null, ulong? beforeId = null, ulong? userId = null, ActionType? actionType = null)
Returns​
System.Collections.Generic.IAsyncEnumerable<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.RestAuditLogEntry>>
:
A task that represents the asynchronous get operation. The task result contains a read-only collection
of the requested audit log entries.
Parameters​
Type | Name | Description |
---|---|---|
System.Int32 | limit | The number of audit log entries to fetch. |
Discord.RequestOptions | options | The options to be used when sending the request. |
System.Nullable<System.UInt64> | beforeId | The audit log entry ID to get entries before. |
System.Nullable<System.UInt64> | userId | The user ID to filter entries for. |
System.Nullable<Discord.ActionType> | actionType | The type of actions to filter. |
GetWebhookAsync(UInt64, RequestOptions)​
Gets a webhook found within this guild.
View Source​
public Task<RestWebhook> GetWebhookAsync(ulong id, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<Discord.Rest.RestWebhook>
:
A task that represents the asynchronous get operation. The task result contains the webhook with the
specified <code data-dev-comment-type="paramref" class="paramref">id</code>; null
if none is found.
Parameters​
Type | Name | Description |
---|---|---|
System.UInt64 | id | The identifier for the webhook. |
Discord.RequestOptions | options | The options to be used when sending the request. |
GetWebhooksAsync(RequestOptions)​
Gets a collection of all webhook from this guild.
View Source​
public Task<IReadOnlyCollection<RestWebhook>> GetWebhooksAsync(RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.RestWebhook>>
:
A task that represents the asynchronous get operation. The task result contains a read-only collection
of webhooks found within the guild.
Parameters​
Type | Name | Description |
---|---|---|
Discord.RequestOptions | options | The options to be used when sending the request. |
GetApplicationCommandsAsync(RequestOptions)​
Gets this guilds slash commands
View Source​
public async Task<IReadOnlyCollection<RestGuildCommand>> GetApplicationCommandsAsync(RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.RestGuildCommand>>
:
A task that represents the asynchronous get operation. The task result contains a read-only collection
of application commands found within the guild.
Parameters​
Type | Name | Description |
---|---|---|
Discord.RequestOptions | options | The options to be used when sending the request. |
GetApplicationCommandAsync(UInt64, RequestOptions)​
Gets an application command within this guild with the specified id.
View Source​
public async Task<RestGuildCommand> GetApplicationCommandAsync(ulong id, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<Discord.Rest.RestGuildCommand>
:
A ValueTask that represents the asynchronous get operation. The task result contains a Discord.IApplicationCommand
if found, otherwise null
.
Parameters​
Type | Name | Description |
---|---|---|
System.UInt64 | id | The id of the application command to get. |
Discord.RequestOptions | options | The options to be used when sending the request. |
CreateApplicationCommandAsync(ApplicationCommandProperties, RequestOptions)​
Creates an application command within this guild.
View Source​
public async Task<RestGuildCommand> CreateApplicationCommandAsync(ApplicationCommandProperties properties, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<Discord.Rest.RestGuildCommand>
:
A task that represents the asynchronous creation operation. The task result contains the command that was created.
Parameters​
Type | Name | Description |
---|---|---|
Discord.ApplicationCommandProperties | properties | The properties to use when creating the command. |
Discord.RequestOptions | options | The options to be used when sending the request. |
BulkOverwriteApplicationCommandsAsync(ApplicationCommandProperties[], RequestOptions)​
Overwrites the application commands within this guild.
View Source​
public async Task<IReadOnlyCollection<RestGuildCommand>> BulkOverwriteApplicationCommandsAsync(ApplicationCommandProperties[] properties, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.RestGuildCommand>>
:
A task that represents the asynchronous creation operation. The task result contains a collection of commands that was created.
Parameters​
Type | Name | Description |
---|---|---|
Discord.ApplicationCommandProperties[] | properties | A collection of properties to use when creating the commands. |
Discord.RequestOptions | options | The options to be used when sending the request. |
ToString()​
Returns the name of the guild.
View Source​
public override string ToString()
Returns​
System.String
:
The name of the guild.
GetEmotesAsync(RequestOptions)​
Gets a collection of emotes from this guild.
View Source​
public Task<IReadOnlyCollection<GuildEmote>> GetEmotesAsync(RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.GuildEmote>>
:
A task that represents the asynchronous get operation. The task result contains a read-only collection
of emotes found within the guild.
Parameters​
Type | Name | Description |
---|---|---|
Discord.RequestOptions | options | The options to be used when sending the request. |
GetEmoteAsync(UInt64, RequestOptions)​
Gets a specific emote from this guild.
View Source​
public Task<GuildEmote> GetEmoteAsync(ulong id, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<Discord.GuildEmote>
:
A task that represents the asynchronous get operation. The task result contains the emote found with the
specified <code data-dev-comment-type="paramref" class="paramref">id</code>; null
if none is found.
Parameters​
Type | Name | Description |
---|---|---|
System.UInt64 | id | The snowflake identifier for the guild emote. |
Discord.RequestOptions | options | The options to be used when sending the request. |
CreateEmoteAsync(String, Image, Optional<IEnumerable<IRole>>, RequestOptions)​
Creates a new Discord.GuildEmote in this guild.
View Source​
public Task<GuildEmote> CreateEmoteAsync(string name, Image image, Optional<IEnumerable<IRole>> roles = default(Optional<IEnumerable<IRole>>), RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<Discord.GuildEmote>
:
A task that represents the asynchronous creation operation. The task result contains the created emote.
Parameters​
Type | Name | Description |
---|---|---|
System.String | name | The name of the guild emote. |
Discord.Image | image | The image of the new emote. |
Discord.Optional<T> | roles | The roles to limit the emote usage to. |
Discord.RequestOptions | options | The options to be used when sending the request. |
ModifyEmoteAsync(GuildEmote, Action<EmoteProperties>, RequestOptions)​
Modifies an existing Discord.GuildEmote in this guild.
View Source​
public Task<GuildEmote> ModifyEmoteAsync(GuildEmote emote, Action<EmoteProperties> func, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<Discord.GuildEmote>
:
A task that represents the asynchronous modification operation. The task result contains the modified
emote.
Parameters​
Type | Name | Description |
---|---|---|
Discord.GuildEmote | emote | The emote to be modified. |
System.Action<Discord.EmoteProperties> | func | The delegate containing the properties to modify the emote with. |
Discord.RequestOptions | options | The options to be used when sending the request. |
MoveAsync(IGuildUser, IVoiceChannel)​
Moves the user to the voice channel.
View Source​
public Task MoveAsync(IGuildUser user, IVoiceChannel targetChannel)
Returns​
System.Threading.Tasks.Task
: A task that represents the asynchronous operation for moving a user.
Parameters​
Type | Name | Description |
---|---|---|
Discord.IGuildUser | user | The user to move. |
Discord.IVoiceChannel | targetChannel | the channel where the user gets moved to. |
DeleteEmoteAsync(GuildEmote, RequestOptions)​
Deletes an existing Discord.GuildEmote from this guild.
View Source​
public Task DeleteEmoteAsync(GuildEmote emote, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task
:
A task that represents the asynchronous removal operation.
Parameters​
Type | Name | Description |
---|---|---|
Discord.GuildEmote | emote | The emote to delete. |
Discord.RequestOptions | options | The options to be used when sending the request. |
CreateStickerAsync(String, String, IEnumerable<String>, Image, RequestOptions)​
Creates a new sticker in this guild.
View Source​
public async Task<CustomSticker> CreateStickerAsync(string name, string description, IEnumerable<string> tags, Image image, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<Discord.Rest.CustomSticker>
:
A task that represents the asynchronous creation operation. The task result contains the created sticker.
Parameters​
Type | Name | Description |
---|---|---|
System.String | name | The name of the sticker. |
System.String | description | The description of the sticker. |
System.Collections.Generic.IEnumerable<System.String> | tags | The tags of the sticker. |
Discord.Image | image | The image of the new emote. |
Discord.RequestOptions | options | The options to be used when sending the request. |
CreateStickerAsync(String, String, IEnumerable<String>, String, RequestOptions)​
Creates a new sticker in this guild
View Source​
public Task<CustomSticker> CreateStickerAsync(string name, string description, IEnumerable<string> tags, string path, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<Discord.Rest.CustomSticker>
:
A task that represents the asynchronous creation operation. The task result contains the created sticker.
Parameters​
Type | Name | Description |
---|---|---|
System.String | name | The name of the sticker. |
System.String | description | The description of the sticker. |
System.Collections.Generic.IEnumerable<System.String> | tags | The tags of the sticker. |
System.String | path | The path of the file to upload. |
Discord.RequestOptions | options | The options to be used when sending the request. |
CreateStickerAsync(String, String, IEnumerable<String>, Stream, String, RequestOptions)​
Creates a new sticker in this guild
View Source​
public async Task<CustomSticker> CreateStickerAsync(string name, string description, IEnumerable<string> tags, Stream stream, string filename, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<Discord.Rest.CustomSticker>
:
A task that represents the asynchronous creation operation. The task result contains the created sticker.
Parameters​
Type | Name | Description |
---|---|---|
System.String | name | The name of the sticker. |
System.String | description | The description of the sticker. |
System.Collections.Generic.IEnumerable<System.String> | tags | The tags of the sticker. |
System.IO.Stream | stream | The stream containing the file data. |
System.String | filename | The name of the file <strong>with</strong> the extension, ex: image.png. |
Discord.RequestOptions | options | The options to be used when sending the request. |
GetStickerAsync(UInt64, RequestOptions)​
Gets a specific sticker within this guild.
View Source​
public async Task<CustomSticker> GetStickerAsync(ulong id, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<Discord.Rest.CustomSticker>
:
A task that represents the asynchronous get operation. The task result contains the sticker found with the
specified <code data-dev-comment-type="paramref" class="paramref">id</code>; null
if none is found.
Parameters​
Type | Name | Description |
---|---|---|
System.UInt64 | id | The id of the sticker to get. |
Discord.RequestOptions | options | The options to be used when sending the request. |
GetStickersAsync(RequestOptions)​
Gets a collection of all stickers within this guild.
View Source​
public async Task<IReadOnlyCollection<CustomSticker>> GetStickersAsync(RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.CustomSticker>>
:
A task that represents the asynchronous get operation. The task result contains a read-only collection
of stickers found within the guild.
Parameters​
Type | Name | Description |
---|---|---|
Discord.RequestOptions | options | The options to be used when sending the request. |
DeleteStickerAsync(CustomSticker, RequestOptions)​
Deletes a sticker within this guild.
View Source​
public Task DeleteStickerAsync(CustomSticker sticker, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task
:
A task that represents the asynchronous removal operation.
Parameters​
Type | Name | Description |
---|---|---|
Discord.Rest.CustomSticker | sticker | The sticker to delete. |
Discord.RequestOptions | options | The options to be used when sending the request. |
GetEventAsync(UInt64, RequestOptions)​
Gets an event within this guild.
View Source​
public Task<RestGuildEvent> GetEventAsync(ulong id, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<Discord.Rest.RestGuildEvent>
:
A task that represents the asynchronous get operation.
Parameters​
Type | Name | Description |
---|---|---|
System.UInt64 | id | The snowflake identifier for the event. |
Discord.RequestOptions | options | The options to be used when sending the request. |
GetEventsAsync(RequestOptions)​
Gets all active events within this guild.
View Source​
public Task<IReadOnlyCollection<RestGuildEvent>> GetEventsAsync(RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.RestGuildEvent>>
:
A task that represents the asynchronous get operation.
Parameters​
Type | Name | Description |
---|---|---|
Discord.RequestOptions | options | The options to be used when sending the request. |
CreateEventAsync(String, DateTimeOffset, GuildScheduledEventType, GuildScheduledEventPrivacyLevel, String, Nullable<DateTimeOffset>, Nullable<UInt64>, String, RequestOptions)​
Creates an event within this guild.
View Source​
public Task<RestGuildEvent> CreateEventAsync(string name, DateTimeOffset startTime, GuildScheduledEventType type, GuildScheduledEventPrivacyLevel privacyLevel = GuildScheduledEventPrivacyLevel.Private, string description = null, DateTimeOffset? endTime = null, ulong? channelId = null, string location = null, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<Discord.Rest.RestGuildEvent>
:
A task that represents the asynchronous create operation.
Parameters​
Type | Name | Description |
---|---|---|
System.String | name | The name of the event. |
System.DateTimeOffset | startTime | The start time of the event. |
Discord.GuildScheduledEventType | type | The type of the event. |
Discord.GuildScheduledEventPrivacyLevel | privacyLevel | The privacy level of the event. |
System.String | description | The description of the event. |
System.Nullable<System.DateTimeOffset> | endTime | The end time of the event. |
System.Nullable<System.UInt64> | channelId |
The channel id of the event.
<remarks>
The event must have a type of Discord.GuildScheduledEventType.Stage or Discord.GuildScheduledEventType.Voice
in order to use this property.
</remarks>
|
| System.String
| location | The location of the event; links are supported |
| Discord.RequestOptions | options | The options to be used when sending the request. |
IGuild.CreateEventAsync(String, DateTimeOffset, GuildScheduledEventType, GuildScheduledEventPrivacyLevel, String, Nullable<DateTimeOffset>, Nullable<UInt64>, String, RequestOptions)​
Creates an event within this guild.
View Source​
async Task<IGuildScheduledEvent> IGuild.CreateEventAsync(string name, DateTimeOffset startTime, GuildScheduledEventType type, GuildScheduledEventPrivacyLevel privacyLevel, string description, DateTimeOffset? endTime, ulong? channelId, string location, RequestOptions options)
Returns​
System.Threading.Tasks.Task<Discord.IGuildScheduledEvent>
:
A task that represents the asynchronous create operation.
Parameters​
Type | Name | Description |
---|---|---|
System.String | name | The name of the event. |
System.DateTimeOffset | startTime | The start time of the event. |
Discord.GuildScheduledEventType | type | The type of the event. |
Discord.GuildScheduledEventPrivacyLevel | privacyLevel | The privacy level of the event. |
System.String | description | The description of the event. |
System.Nullable<System.DateTimeOffset> | endTime | The end time of the event. |
System.Nullable<System.UInt64> | channelId |
The channel id of the event.
<remarks>
The event must have a type of Discord.GuildScheduledEventType.Stage or Discord.GuildScheduledEventType.Voice
in order to use this property.
</remarks>
|
| System.String
| location | The location of the event; links are supported |
| Discord.RequestOptions | options | The options to be used when sending the request. |
IGuild.GetEventAsync(UInt64, RequestOptions)​
Gets a event within this guild.
View Source​
async Task<IGuildScheduledEvent> IGuild.GetEventAsync(ulong id, RequestOptions options)
Returns​
System.Threading.Tasks.Task<Discord.IGuildScheduledEvent>
:
A task that represents the asynchronous get operation.
Parameters​
Type | Name | Description |
---|---|---|
System.UInt64 | id | The id of the event. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IGuild.GetEventsAsync(RequestOptions)​
Gets a collection of events within this guild.
View Source​
async Task<IReadOnlyCollection<IGuildScheduledEvent>> IGuild.GetEventsAsync(RequestOptions options)
Returns​
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.IGuildScheduledEvent>>
:
A task that represents the asynchronous get operation.
Parameters​
Type | Name | Description |
---|---|---|
Discord.RequestOptions | options | The options to be used when sending the request. |
IGuild.GetBansAsync(RequestOptions)​
Gets a collection of all users banned in this guild.
View Source​
async Task<IReadOnlyCollection<IBan>> IGuild.GetBansAsync(RequestOptions options)
Returns​
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.IBan>>
:
A task that represents the asynchronous get operation. The task result contains a read-only collection of
ban objects that this guild currently possesses, with each object containing the user banned and reason
behind the ban.
Parameters​
Type | Name | Description |
---|---|---|
Discord.RequestOptions | options | The options to be used when sending the request. |
IGuild.GetBanAsync(IUser, RequestOptions)​
Gets a ban object for a banned user.
View Source​
async Task<IBan> IGuild.GetBanAsync(IUser user, RequestOptions options)
Returns​
System.Threading.Tasks.Task<Discord.IBan>
:
A task that represents the asynchronous get operation. The task result contains a ban object, which
contains the user information and the reason for the ban; null
if the ban entry cannot be found.
Parameters​
Type | Name | Description |
---|---|---|
Discord.IUser | user | The banned user. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IGuild.GetBanAsync(UInt64, RequestOptions)​
Gets a ban object for a banned user.
View Source​
async Task<IBan> IGuild.GetBanAsync(ulong userId, RequestOptions options)
Returns​
System.Threading.Tasks.Task<Discord.IBan>
:
A task that represents the asynchronous get operation. The task result contains a ban object, which
contains the user information and the reason for the ban; null
if the ban entry cannot be found.
Parameters​
Type | Name | Description |
---|---|---|
System.UInt64 | userId | The snowflake identifier for the banned user. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IGuild.GetChannelsAsync(CacheMode, RequestOptions)​
Gets a collection of all channels in this guild.
View Source​
async Task<IReadOnlyCollection<IGuildChannel>> IGuild.GetChannelsAsync(CacheMode mode, RequestOptions options)
Returns​
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.IGuildChannel>>
:
A task that represents the asynchronous get operation. The task result contains a read-only collection of
generic channels found within this guild.
Parameters​
Type | Name | Description |
---|---|---|
Discord.CacheMode | mode | The Discord.CacheMode that determines whether the object should be fetched from cache. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IGuild.GetChannelAsync(UInt64, CacheMode, RequestOptions)​
Gets a channel in this guild.
View Source​
async Task<IGuildChannel> IGuild.GetChannelAsync(ulong id, CacheMode mode, RequestOptions options)
Returns​
System.Threading.Tasks.Task<Discord.IGuildChannel>
:
A task that represents the asynchronous get operation. The task result contains the generic channel
associated with the specified <code data-dev-comment-type="paramref" class="paramref">id</code>; null
if none is found.
Parameters​
Type | Name | Description |
---|---|---|
System.UInt64 | id | The snowflake identifier for the channel. |
Discord.CacheMode | mode | The Discord.CacheMode that determines whether the object should be fetched from cache. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IGuild.GetTextChannelsAsync(CacheMode, RequestOptions)​
Gets a collection of all text channels in this guild.
View Source​
async Task<IReadOnlyCollection<ITextChannel>> IGuild.GetTextChannelsAsync(CacheMode mode, RequestOptions options)
Returns​
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.ITextChannel>>
:
A task that represents the asynchronous get operation. The task result contains a read-only collection of
message channels found within this guild.
Parameters​
Type | Name | Description |
---|---|---|
Discord.CacheMode | mode | The Discord.CacheMode that determines whether the object should be fetched from cache. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IGuild.GetTextChannelAsync(UInt64, CacheMode, RequestOptions)​
Gets a text channel in this guild.
View Source​
async Task<ITextChannel> IGuild.GetTextChannelAsync(ulong id, CacheMode mode, RequestOptions options)
Returns​
System.Threading.Tasks.Task<Discord.ITextChannel>
:
A task that represents the asynchronous get operation. The task result contains the text channel
associated with the specified <code data-dev-comment-type="paramref" class="paramref">id</code>; null
if none is found.
Parameters​
Type | Name | Description |
---|---|---|
System.UInt64 | id | The snowflake identifier for the text channel. |
Discord.CacheMode | mode | The Discord.CacheMode that determines whether the object should be fetched from cache. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IGuild.GetThreadChannelAsync(UInt64, CacheMode, RequestOptions)​
Gets a thread channel within this guild.
View Source​
async Task<IThreadChannel> IGuild.GetThreadChannelAsync(ulong id, CacheMode mode, RequestOptions options)
Returns​
System.Threading.Tasks.Task<Discord.IThreadChannel>
:
A task that represents the asynchronous get operation. The task result contains the thread channel.
Parameters​
Type | Name | Description |
---|---|---|
System.UInt64 | id | The id of the thread channel. |
Discord.CacheMode | mode | The Discord.CacheMode that determines whether the object should be fetched from cache. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IGuild.GetThreadChannelsAsync(CacheMode, RequestOptions)​
Gets a collection of all thread channels in this guild.
View Source​
async Task<IReadOnlyCollection<IThreadChannel>> IGuild.GetThreadChannelsAsync(CacheMode mode, RequestOptions options)
Returns​
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.IThreadChannel>>
:
A task that represents the asynchronous get operation. The task result contains a read-only collection of
thread channels found within this guild.
Parameters​
Type | Name | Description |
---|---|---|
Discord.CacheMode | mode | The Discord.CacheMode that determines whether the object should be fetched from cache. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IGuild.GetVoiceChannelsAsync(CacheMode, RequestOptions)​
Gets a collection of all voice channels in this guild.
View Source​
async Task<IReadOnlyCollection<IVoiceChannel>> IGuild.GetVoiceChannelsAsync(CacheMode mode, RequestOptions options)
Returns​
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.IVoiceChannel>>
:
A task that represents the asynchronous get operation. The task result contains a read-only collection of
voice channels found within this guild.
Parameters​
Type | Name | Description |
---|---|---|
Discord.CacheMode | mode | The Discord.CacheMode that determines whether the object should be fetched from cache. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IGuild.GetCategoriesAsync(CacheMode, RequestOptions)​
Gets a collection of all category channels in this guild.
View Source​
async Task<IReadOnlyCollection<ICategoryChannel>> IGuild.GetCategoriesAsync(CacheMode mode, RequestOptions options)
Returns​
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.ICategoryChannel>>
:
A task that represents the asynchronous get operation. The task result contains a read-only collection of
category channels found within this guild.
Parameters​
Type | Name | Description |
---|---|---|
Discord.CacheMode | mode | The Discord.CacheMode that determines whether the object should be fetched from cache. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IGuild.GetStageChannelAsync(UInt64, CacheMode, RequestOptions)​
Gets a stage channel in this guild.
View Source​
async Task<IStageChannel> IGuild.GetStageChannelAsync(ulong id, CacheMode mode, RequestOptions options)
Returns​
System.Threading.Tasks.Task<Discord.IStageChannel>
:
A task that represents the asynchronous get operation. The task result contains the stage channel associated
with the specified <code data-dev-comment-type="paramref" class="paramref">id</code>; null
if none is found.
Parameters​
Type | Name | Description |
---|---|---|
System.UInt64 | id | The snowflake identifier for the stage channel. |
Discord.CacheMode | mode | The Discord.CacheMode that determines whether the object should be fetched from cache. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IGuild.GetStageChannelsAsync(CacheMode, RequestOptions)​
Gets a collection of all stage channels in this guild.
View Source​
async Task<IReadOnlyCollection<IStageChannel>> IGuild.GetStageChannelsAsync(CacheMode mode, RequestOptions options)
Returns​
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.IStageChannel>>
:
A task that represents the asynchronous get operation. The task result contains a read-only collection of
stage channels found within this guild.
Parameters​
Type | Name | Description |
---|---|---|
Discord.CacheMode | mode | The Discord.CacheMode that determines whether the object should be fetched from cache. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IGuild.GetVoiceChannelAsync(UInt64, CacheMode, RequestOptions)​
Gets a voice channel in this guild.
View Source​
async Task<IVoiceChannel> IGuild.GetVoiceChannelAsync(ulong id, CacheMode mode, RequestOptions options)
Returns​
System.Threading.Tasks.Task<Discord.IVoiceChannel>
:
A task that represents the asynchronous get operation. The task result contains the voice channel associated
with the specified <code data-dev-comment-type="paramref" class="paramref">id</code>; null
if none is found.
Parameters​
Type | Name | Description |
---|---|---|
System.UInt64 | id | The snowflake identifier for the voice channel. |
Discord.CacheMode | mode | The Discord.CacheMode that determines whether the object should be fetched from cache. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IGuild.GetAFKChannelAsync(CacheMode, RequestOptions)​
Gets the AFK voice channel in this guild.
View Source​
async Task<IVoiceChannel> IGuild.GetAFKChannelAsync(CacheMode mode, RequestOptions options)
Returns​
System.Threading.Tasks.Task<Discord.IVoiceChannel>
:
A task that represents the asynchronous get operation. The task result contains the voice channel that the
AFK users will be moved to after they have idled for too long; null
if none is set.
Parameters​
Type | Name | Description |
---|---|---|
Discord.CacheMode | mode | The Discord.CacheMode that determines whether the object should be fetched from cache. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IGuild.GetDefaultChannelAsync(CacheMode, RequestOptions)​
Gets the first viewable text channel in this guild.
View Source​
async Task<ITextChannel> IGuild.GetDefaultChannelAsync(CacheMode mode, RequestOptions options)
Returns​
System.Threading.Tasks.Task<Discord.ITextChannel>
:
A task that represents the asynchronous get operation. The task result contains the first viewable text
channel in this guild; null
if none is found.
Parameters​
Type | Name | Description |
---|---|---|
Discord.CacheMode | mode | The Discord.CacheMode that determines whether the object should be fetched from cache. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IGuild.GetWidgetChannelAsync(CacheMode, RequestOptions)​
Gets the widget channel (i.e. the channel set in the guild's widget settings) in this guild.
View Source​
async Task<IGuildChannel> IGuild.GetWidgetChannelAsync(CacheMode mode, RequestOptions options)
Returns​
System.Threading.Tasks.Task<Discord.IGuildChannel>
:
A task that represents the asynchronous get operation. The task result contains the widget channel set
within the server's widget settings; null
if none is set.
Parameters​
Type | Name | Description |
---|---|---|
Discord.CacheMode | mode | The Discord.CacheMode that determines whether the object should be fetched from cache. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IGuild.GetSystemChannelAsync(CacheMode, RequestOptions)​
Gets the system channel where randomized welcome messages are sent in this guild.
View Source​
async Task<ITextChannel> IGuild.GetSystemChannelAsync(CacheMode mode, RequestOptions options)
Returns​
System.Threading.Tasks.Task<Discord.ITextChannel>
:
A task that represents the asynchronous get operation. The task result contains the text channel where
randomized welcome messages will be sent to; null
if none is set.
Parameters​
Type | Name | Description |
---|---|---|
Discord.CacheMode | mode | The Discord.CacheMode that determines whether the object should be fetched from cache. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IGuild.GetRulesChannelAsync(CacheMode, RequestOptions)​
Gets the text channel where Community guilds can display rules and/or guidelines.
View Source​
async Task<ITextChannel> IGuild.GetRulesChannelAsync(CacheMode mode, RequestOptions options)
Returns​
System.Threading.Tasks.Task<Discord.ITextChannel>
:
A task that represents the asynchronous get operation. The task result contains the text channel
where Community guilds can display rules and/or guidelines; null
if none is set.
Parameters​
Type | Name | Description |
---|---|---|
Discord.CacheMode | mode | The Discord.CacheMode that determines whether the object should be fetched from cache. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IGuild.GetPublicUpdatesChannelAsync(CacheMode, RequestOptions)​
Gets the text channel where admins and moderators of Community guilds receive notices from Discord.
View Source​
async Task<ITextChannel> IGuild.GetPublicUpdatesChannelAsync(CacheMode mode, RequestOptions options)
Returns​
System.Threading.Tasks.Task<Discord.ITextChannel>
:
A task that represents the asynchronous get operation. The task result contains the text channel where
admins and moderators of Community guilds receive notices from Discord; null
if none is set.
Parameters​
Type | Name | Description |
---|---|---|
Discord.CacheMode | mode | The Discord.CacheMode that determines whether the object should be fetched from cache. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IGuild.CreateTextChannelAsync(String, Action<TextChannelProperties>, RequestOptions)​
Creates a new text channel in this guild.
View Source​
async Task<ITextChannel> IGuild.CreateTextChannelAsync(string name, Action<TextChannelProperties> func, RequestOptions options)
Returns​
System.Threading.Tasks.Task<Discord.ITextChannel>
:
A task that represents the asynchronous creation operation. The task result contains the newly created
text channel.
Parameters​
Type | Name | Description |
---|---|---|
System.String | name | The new name for the text channel. |
System.Action<Discord.TextChannelProperties> | func | The delegate containing the properties to be applied to the channel upon its creation. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IGuild.CreateVoiceChannelAsync(String, Action<VoiceChannelProperties>, RequestOptions)​
Creates a new voice channel in this guild.
View Source​
async Task<IVoiceChannel> IGuild.CreateVoiceChannelAsync(string name, Action<VoiceChannelProperties> func, RequestOptions options)
Returns​
System.Threading.Tasks.Task<Discord.IVoiceChannel>
:
A task that represents the asynchronous creation operation. The task result contains the newly created
voice channel.
Parameters​
Type | Name | Description |
---|---|---|
System.String | name | The new name for the voice channel. |
System.Action<Discord.VoiceChannelProperties> | func | The delegate containing the properties to be applied to the channel upon its creation. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IGuild.CreateStageChannelAsync(String, Action<VoiceChannelProperties>, RequestOptions)​
Creates a new stage channel in this guild.
View Source​
async Task<IStageChannel> IGuild.CreateStageChannelAsync(string name, Action<VoiceChannelProperties> func, RequestOptions options)
Returns​
System.Threading.Tasks.Task<Discord.IStageChannel>
:
A task that represents the asynchronous creation operation. The task result contains the newly created
stage channel.
Parameters​
Type | Name | Description |
---|---|---|
System.String | name | The new name for the stage channel. |
System.Action<Discord.VoiceChannelProperties> | func | The delegate containing the properties to be applied to the channel upon its creation. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IGuild.CreateCategoryAsync(String, Action<GuildChannelProperties>, RequestOptions)​
Creates a new channel category in this guild.
View Source​
async Task<ICategoryChannel> IGuild.CreateCategoryAsync(string name, Action<GuildChannelProperties> func, RequestOptions options)
Returns​
System.Threading.Tasks.Task<Discord.ICategoryChannel>
:
A task that represents the asynchronous creation operation. The task result contains the newly created
category channel.
Parameters​
Type | Name | Description |
---|---|---|
System.String | name | The new name for the category. |
System.Action<Discord.GuildChannelProperties> | func | The delegate containing the properties to be applied to the channel upon its creation. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IGuild.GetVoiceRegionsAsync(RequestOptions)​
Gets a collection of all the voice regions this guild can access.
View Source​
async Task<IReadOnlyCollection<IVoiceRegion>> IGuild.GetVoiceRegionsAsync(RequestOptions options)
Returns​
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.IVoiceRegion>>
:
A task that represents the asynchronous get operation. The task result contains a read-only collection of
voice regions the guild can access.
Parameters​
Type | Name | Description |
---|---|---|
Discord.RequestOptions | options | The options to be used when sending the request. |
IGuild.GetIntegrationsAsync(RequestOptions)​
View Source​
async Task<IReadOnlyCollection<IGuildIntegration>> IGuild.GetIntegrationsAsync(RequestOptions options)
Returns​
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.IGuildIntegration>>
Parameters​
Type | Name |
---|---|
Discord.RequestOptions | options |
IGuild.CreateIntegrationAsync(UInt64, String, RequestOptions)​
View Source​
async Task<IGuildIntegration> IGuild.CreateIntegrationAsync(ulong id, string type, RequestOptions options)
Returns​
System.Threading.Tasks.Task<Discord.IGuildIntegration>
Parameters​
Type | Name |
---|---|
System.UInt64 | id |
System.String | type |
Discord.RequestOptions | options |
IGuild.GetInvitesAsync(RequestOptions)​
Gets a collection of all invites in this guild.
View Source​
async Task<IReadOnlyCollection<IInviteMetadata>> IGuild.GetInvitesAsync(RequestOptions options)
Returns​
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.IInviteMetadata>>
:
A task that represents the asynchronous get operation. The task result contains a read-only collection of
invite metadata, each representing information for an invite found within this guild.
Parameters​
Type | Name | Description |
---|---|---|
Discord.RequestOptions | options | The options to be used when sending the request. |
IGuild.GetVanityInviteAsync(RequestOptions)​
Gets the vanity invite URL of this guild.
View Source​
async Task<IInviteMetadata> IGuild.GetVanityInviteAsync(RequestOptions options)
Returns​
System.Threading.Tasks.Task<Discord.IInviteMetadata>
:
A task that represents the asynchronous get operation. The task result contains the partial metadata of
the vanity invite found within this guild; null
if none is found.
Parameters​
Type | Name | Description |
---|---|---|
Discord.RequestOptions | options | The options to be used when sending the request. |
IGuild.GetRole(UInt64)​
Gets a role in this guild.
View Source​
IRole IGuild.GetRole(ulong id)
Returns​
Discord.IRole:
A role that is associated with the specified <code data-dev-comment-type="paramref" class="paramref">id</code>; null
if none is found.
Parameters​
Type | Name | Description |
---|---|---|
System.UInt64 | id | The snowflake identifier for the role. |
IGuild.CreateRoleAsync(String, Nullable<GuildPermissions>, Nullable<Color>, Boolean, RequestOptions)​
Creates a new role with the provided name.
View Source​
async Task<IRole> IGuild.CreateRoleAsync(string name, GuildPermissions? permissions, Color? color, bool isHoisted, RequestOptions options)
Returns​
System.Threading.Tasks.Task<Discord.IRole>
:
A task that represents the asynchronous creation operation. The task result contains the newly created
role.
Parameters​
Type | Name | Description |
---|---|---|
System.String | name | The new name for the role. |
System.Nullable<Discord.GuildPermissions> | permissions | The guild permission that the role should possess. |
System.Nullable<Discord.Color> | color | The color of the role. |
System.Boolean | isHoisted | Whether the role is separated from others on the sidebar. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IGuild.CreateRoleAsync(String, Nullable<GuildPermissions>, Nullable<Color>, Boolean, Boolean, RequestOptions)​
Creates a new role with the provided name.
View Source​
async Task<IRole> IGuild.CreateRoleAsync(string name, GuildPermissions? permissions, Color? color, bool isHoisted, bool isMentionable, RequestOptions options)
Returns​
System.Threading.Tasks.Task<Discord.IRole>
:
A task that represents the asynchronous creation operation. The task result contains the newly created
role.
Parameters​
Type | Name | Description |
---|---|---|
System.String | name | The new name for the role. |
System.Nullable<Discord.GuildPermissions> | permissions | The guild permission that the role should possess. |
System.Nullable<Discord.Color> | color | The color of the role. |
System.Boolean | isHoisted | Whether the role is separated from others on the sidebar. |
System.Boolean | isMentionable | Whether the role can be mentioned. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IGuild.AddGuildUserAsync(UInt64, String, Action<AddGuildUserProperties>, RequestOptions)​
Adds a user to this guild.
View Source​
async Task<IGuildUser> IGuild.AddGuildUserAsync(ulong userId, string accessToken, Action<AddGuildUserProperties> func, RequestOptions options)
Returns​
System.Threading.Tasks.Task<Discord.IGuildUser>
: A guild user associated with the specified <code data-dev-comment-type="paramref" class="paramref">userId</code>; null
if the user is already in the guild.
Parameters​
Type | Name | Description |
---|---|---|
System.UInt64 | userId | The snowflake identifier of the user. |
System.String | accessToken | The OAuth2 access token for the user, requested with the guilds.join scope. |
System.Action<Discord.AddGuildUserProperties> | func | The delegate containing the properties to be applied to the user upon being added to the guild. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IGuild.DisconnectAsync(IGuildUser)​
Disconnects the user from its current voice channel
View Source​
async Task IGuild.DisconnectAsync(IGuildUser user)
Returns​
System.Threading.Tasks.Task
: A task that represents the asynchronous operation for disconnecting a user.
Parameters​
Type | Name | Description |
---|---|---|
Discord.IGuildUser | user | The user to disconnect. |
IGuild.GetUserAsync(UInt64, CacheMode, RequestOptions)​
Gets a user from this guild.
View Source​
async Task<IGuildUser> IGuild.GetUserAsync(ulong id, CacheMode mode, RequestOptions options)
Returns​
System.Threading.Tasks.Task<Discord.IGuildUser>
:
A task that represents the asynchronous get operation. The task result contains the guild user
associated with the specified <code data-dev-comment-type="paramref" class="paramref">id</code>; null
if none is found.
Parameters​
Type | Name | Description |
---|---|---|
System.UInt64 | id | The snowflake identifier of the user. |
Discord.CacheMode | mode | The Discord.CacheMode that determines whether the object should be fetched from cache. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IGuild.GetCurrentUserAsync(CacheMode, RequestOptions)​
Gets the current user for this guild.
View Source​
async Task<IGuildUser> IGuild.GetCurrentUserAsync(CacheMode mode, RequestOptions options)
Returns​
System.Threading.Tasks.Task<Discord.IGuildUser>
:
A task that represents the asynchronous get operation. The task result contains the currently logged-in
user within this guild.
Parameters​
Type | Name | Description |
---|---|---|
Discord.CacheMode | mode | The Discord.CacheMode that determines whether the object should be fetched from cache. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IGuild.GetOwnerAsync(CacheMode, RequestOptions)​
Gets the owner of this guild.
View Source​
async Task<IGuildUser> IGuild.GetOwnerAsync(CacheMode mode, RequestOptions options)
Returns​
System.Threading.Tasks.Task<Discord.IGuildUser>
:
A task that represents the asynchronous get operation. The task result contains the owner of this guild.
Parameters​
Type | Name | Description |
---|---|---|
Discord.CacheMode | mode | The Discord.CacheMode that determines whether the object should be fetched from cache. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IGuild.GetUsersAsync(CacheMode, RequestOptions)​
Gets a collection of all users in this guild.
View Source​
async Task<IReadOnlyCollection<IGuildUser>> IGuild.GetUsersAsync(CacheMode mode, RequestOptions options)
Returns​
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.IGuildUser>>
:
A task that represents the asynchronous get operation. The task result contains a collection of guild
users found within this guild.
Parameters​
Type | Name | Description |
---|---|---|
Discord.CacheMode | mode | The Discord.CacheMode that determines whether the object should be fetched from cache. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IGuild.DownloadUsersAsync()​
Downloads all users for this guild if the current list is incomplete.
View Source​
Task IGuild.DownloadUsersAsync()
Returns​
System.Threading.Tasks.Task
:
A task that represents the asynchronous download operation.
IGuild.SearchUsersAsync(String, Int32, CacheMode, RequestOptions)​
Gets a collection of users in this guild that the name or nickname starts with the
provided System.String
at <code data-dev-comment-type="paramref" class="paramref">query</code>.
View Source​
async Task<IReadOnlyCollection<IGuildUser>> IGuild.SearchUsersAsync(string query, int limit, CacheMode mode, RequestOptions options)
Returns​
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.IGuildUser>>
:
A task that represents the asynchronous get operation. The task result contains a collection of guild
users that the name or nickname starts with the provided System.String
at <code data-dev-comment-type="paramref" class="paramref">query</code>.
Parameters​
Type | Name | Description |
---|---|---|
System.String | query | The partial name or nickname to search. |
System.Int32 | limit | The maximum number of users to be gotten. |
Discord.CacheMode | mode | The Discord.CacheMode that determines whether the object should be fetched from cache. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IGuild.GetAuditLogsAsync(Int32, CacheMode, RequestOptions, Nullable<UInt64>, Nullable<UInt64>, Nullable<ActionType>)​
View Source​
async Task<IReadOnlyCollection<IAuditLogEntry>> IGuild.GetAuditLogsAsync(int limit, CacheMode cacheMode, RequestOptions options, ulong? beforeId, ulong? userId, ActionType? actionType)
Returns​
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.IAuditLogEntry>>
Parameters​
Type | Name |
---|---|
System.Int32 | limit |
Discord.CacheMode | cacheMode |
Discord.RequestOptions | options |
System.Nullable<System.UInt64> | beforeId |
System.Nullable<System.UInt64> | userId |
System.Nullable<Discord.ActionType> | actionType |
IGuild.GetWebhookAsync(UInt64, RequestOptions)​
Gets a webhook found within this guild.
View Source​
async Task<IWebhook> IGuild.GetWebhookAsync(ulong id, RequestOptions options)
Returns​
System.Threading.Tasks.Task<Discord.IWebhook>
:
A task that represents the asynchronous get operation. The task result contains the webhook with the
specified <code data-dev-comment-type="paramref" class="paramref">id</code>; null
if none is found.
Parameters​
Type | Name | Description |
---|---|---|
System.UInt64 | id | The identifier for the webhook. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IGuild.GetWebhooksAsync(RequestOptions)​
Gets a collection of all webhook from this guild.
View Source​
async Task<IReadOnlyCollection<IWebhook>> IGuild.GetWebhooksAsync(RequestOptions options)
Returns​
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.IWebhook>>
:
A task that represents the asynchronous get operation. The task result contains a read-only collection
of webhooks found within the guild.
Parameters​
Type | Name | Description |
---|---|---|
Discord.RequestOptions | options | The options to be used when sending the request. |
IGuild.GetApplicationCommandsAsync(RequestOptions)​
Gets this guilds application commands.
View Source​
async Task<IReadOnlyCollection<IApplicationCommand>> IGuild.GetApplicationCommandsAsync(RequestOptions options)
Returns​
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.IApplicationCommand>>
:
A task that represents the asynchronous get operation. The task result contains a read-only collection
of application commands found within the guild.
Parameters​
Type | Name | Description |
---|---|---|
Discord.RequestOptions | options | The options to be used when sending the request. |
IGuild.CreateStickerAsync(String, String, IEnumerable<String>, Image, RequestOptions)​
Creates a new sticker in this guild.
View Source​
async Task<ICustomSticker> IGuild.CreateStickerAsync(string name, string description, IEnumerable<string> tags, Image image, RequestOptions options)
Returns​
System.Threading.Tasks.Task<Discord.ICustomSticker>
:
A task that represents the asynchronous creation operation. The task result contains the created sticker.
Parameters​
Type | Name | Description |
---|---|---|
System.String | name | The name of the sticker. |
System.String | description | The description of the sticker. |
System.Collections.Generic.IEnumerable<System.String> | tags | The tags of the sticker. |
Discord.Image | image | The image of the new emote. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IGuild.CreateStickerAsync(String, String, IEnumerable<String>, Stream, String, RequestOptions)​
Creates a new sticker in this guild.
View Source​
async Task<ICustomSticker> IGuild.CreateStickerAsync(string name, string description, IEnumerable<string> tags, Stream stream, string filename, RequestOptions options)
Returns​
System.Threading.Tasks.Task<Discord.ICustomSticker>
:
A task that represents the asynchronous creation operation. The task result contains the created sticker.
Parameters​
Type | Name | Description |
---|---|---|
System.String | name | The name of the sticker. |
System.String | description | The description of the sticker. |
System.Collections.Generic.IEnumerable<System.String> | tags | The tags of the sticker. |
System.IO.Stream | stream | The stream containing the file data. |
System.String | filename | The name of the file <strong>with</strong> the extension, ex: image.png. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IGuild.CreateStickerAsync(String, String, IEnumerable<String>, String, RequestOptions)​
Creates a new sticker in this guild.
View Source​
async Task<ICustomSticker> IGuild.CreateStickerAsync(string name, string description, IEnumerable<string> tags, string path, RequestOptions options)
Returns​
System.Threading.Tasks.Task<Discord.ICustomSticker>
:
A task that represents the asynchronous creation operation. The task result contains the created sticker.
Parameters​
Type | Name | Description |
---|---|---|
System.String | name | The name of the sticker. |
System.String | description | The description of the sticker. |
System.Collections.Generic.IEnumerable<System.String> | tags | The tags of the sticker. |
System.String | path | The path of the file to upload. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IGuild.GetStickerAsync(UInt64, CacheMode, RequestOptions)​
Gets a specific sticker within this guild.
View Source​
async Task<ICustomSticker> IGuild.GetStickerAsync(ulong id, CacheMode mode, RequestOptions options)
Returns​
System.Threading.Tasks.Task<Discord.ICustomSticker>
:
A task that represents the asynchronous get operation. The task result contains the sticker found with the
specified <code data-dev-comment-type="paramref" class="paramref">id</code>; null
if none is found.
Parameters​
Type | Name | Description |
---|---|---|
System.UInt64 | id | The id of the sticker to get. |
Discord.CacheMode | mode | The Discord.CacheMode that determines whether the object should be fetched from cache. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IGuild.GetStickersAsync(CacheMode, RequestOptions)​
Gets a collection of all stickers within this guild.
View Source​
async Task<IReadOnlyCollection<ICustomSticker>> IGuild.GetStickersAsync(CacheMode mode, RequestOptions options)
Returns​
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.ICustomSticker>>
:
A task that represents the asynchronous get operation. The task result contains a read-only collection
of stickers found within the guild.
Parameters​
Type | Name | Description |
---|---|---|
Discord.CacheMode | mode | The Discord.CacheMode that determines whether the object should be fetched from cache. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IGuild.DeleteStickerAsync(ICustomSticker, RequestOptions)​
Deletes a sticker within this guild.
View Source​
Task IGuild.DeleteStickerAsync(ICustomSticker sticker, RequestOptions options)
Returns​
System.Threading.Tasks.Task
:
A task that represents the asynchronous removal operation.
Parameters​
Type | Name | Description |
---|---|---|
Discord.ICustomSticker | sticker | The sticker to delete. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IGuild.CreateApplicationCommandAsync(ApplicationCommandProperties, RequestOptions)​
Creates an application command within this guild.
View Source​
async Task<IApplicationCommand> IGuild.CreateApplicationCommandAsync(ApplicationCommandProperties properties, RequestOptions options)
Returns​
System.Threading.Tasks.Task<Discord.IApplicationCommand>
:
A task that represents the asynchronous creation operation. The task result contains the command that was created.
Parameters​
Type | Name | Description |
---|---|---|
Discord.ApplicationCommandProperties | properties | The properties to use when creating the command. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IGuild.BulkOverwriteApplicationCommandsAsync(ApplicationCommandProperties[], RequestOptions)​
Overwrites the application commands within this guild.
View Source​
async Task<IReadOnlyCollection<IApplicationCommand>> IGuild.BulkOverwriteApplicationCommandsAsync(ApplicationCommandProperties[] properties, RequestOptions options)
Returns​
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.IApplicationCommand>>
:
A task that represents the asynchronous creation operation. The task result contains a collection of commands that was created.
Parameters​
Type | Name | Description |
---|---|---|
Discord.ApplicationCommandProperties[] | properties | A collection of properties to use when creating the commands. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IGuild.GetApplicationCommandAsync(UInt64, CacheMode, RequestOptions)​
Gets an application command within this guild with the specified id.
View Source​
async Task<IApplicationCommand> IGuild.GetApplicationCommandAsync(ulong id, CacheMode mode, RequestOptions options)
Returns​
System.Threading.Tasks.Task<Discord.IApplicationCommand>
:
A ValueTask that represents the asynchronous get operation. The task result contains a Discord.IApplicationCommand
if found, otherwise null
.
Parameters​
Type | Name | Description |
---|---|---|
System.UInt64 | id | The id of the application command to get. |
Discord.CacheMode | mode | The Discord.CacheMode that determines whether the object should be fetched from cache. |
Discord.RequestOptions | options | The options to be used when sending the request. |