Show / Hide Table of Contents

Class RestGuild

Represents a REST-based guild/server.

Inheritance
System.Object
RestEntity<System.UInt64>
RestGuild
Implements
IGuild
IDeletable
ISnowflakeEntity
IEntity<System.UInt64>
IUpdateable
Inherited Members
RestEntity<UInt64>.Id
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Discord.Rest
Assembly: Discord.Net.Rest.dll
Syntax
public class RestGuild : RestEntity<ulong>, IGuild, IDeletable, ISnowflakeEntity, IEntity<ulong>, IUpdateable

Properties

| Improve this Doc View Source

AFKChannelId

Declaration
public ulong? AFKChannelId { get; }
Property Value
Type Description
System.Nullable<System.UInt64>
| Improve this Doc View Source

AFKTimeout

Declaration
public int AFKTimeout { get; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

ApplicationId

Declaration
public ulong? ApplicationId { get; }
Property Value
Type Description
System.Nullable<System.UInt64>
| Improve this Doc View Source

BannerId

Declaration
public string BannerId { get; }
Property Value
Type Description
System.String
| Improve this Doc View Source

BannerUrl

Declaration
public string BannerUrl { get; }
Property Value
Type Description
System.String
| Improve this Doc View Source

CreatedAt

Declaration
public DateTimeOffset CreatedAt { get; }
Property Value
Type Description
System.DateTimeOffset
| Improve this Doc View Source

DefaultChannelId

Declaration
[Obsolete("DefaultChannelId is deprecated, use GetDefaultChannelAsync")]
public ulong DefaultChannelId { get; }
Property Value
Type Description
System.UInt64
| Improve this Doc View Source

DefaultMessageNotifications

Declaration
public DefaultMessageNotifications DefaultMessageNotifications { get; }
Property Value
Type Description
DefaultMessageNotifications
| Improve this Doc View Source

Description

Declaration
public string Description { get; }
Property Value
Type Description
System.String
| Improve this Doc View Source

EmbedChannelId

Declaration
public ulong? EmbedChannelId { get; }
Property Value
Type Description
System.Nullable<System.UInt64>
| Improve this Doc View Source

Emotes

Declaration
public IReadOnlyCollection<GuildEmote> Emotes { get; }
Property Value
Type Description
System.Collections.Generic.IReadOnlyCollection<GuildEmote>
| Improve this Doc View Source

EveryoneRole

Gets the built-in role containing all users in this guild.

Declaration
public RestRole EveryoneRole { get; }
Property Value
Type Description
RestRole
| Improve this Doc View Source

ExplicitContentFilter

Declaration
public ExplicitContentFilterLevel ExplicitContentFilter { get; }
Property Value
Type Description
ExplicitContentFilterLevel
| Improve this Doc View Source

Features

Declaration
public IReadOnlyCollection<string> Features { get; }
Property Value
Type Description
System.Collections.Generic.IReadOnlyCollection<System.String>
| Improve this Doc View Source

IconId

Declaration
public string IconId { get; }
Property Value
Type Description
System.String
| Improve this Doc View Source

IconUrl

Declaration
public string IconUrl { get; }
Property Value
Type Description
System.String
| Improve this Doc View Source

IsEmbeddable

Declaration
public bool IsEmbeddable { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

MfaLevel

Declaration
public MfaLevel MfaLevel { get; }
Property Value
Type Description
MfaLevel
| Improve this Doc View Source

Name

Declaration
public string Name { get; }
Property Value
Type Description
System.String
| Improve this Doc View Source

OwnerId

Declaration
public ulong OwnerId { get; }
Property Value
Type Description
System.UInt64
| Improve this Doc View Source

PreferredCulture

Declaration
public CultureInfo PreferredCulture { get; }
Property Value
Type Description
System.Globalization.CultureInfo
| Improve this Doc View Source

PreferredLocale

Declaration
public string PreferredLocale { get; }
Property Value
Type Description
System.String
| Improve this Doc View Source

PremiumSubscriptionCount

Declaration
public int PremiumSubscriptionCount { get; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

PremiumTier

Declaration
public PremiumTier PremiumTier { get; }
Property Value
Type Description
PremiumTier
| Improve this Doc View Source

Roles

Gets a collection of all roles in this guild.

Declaration
public IReadOnlyCollection<RestRole> Roles { get; }
Property Value
Type Description
System.Collections.Generic.IReadOnlyCollection<RestRole>
| Improve this Doc View Source

SplashId

Declaration
public string SplashId { get; }
Property Value
Type Description
System.String
| Improve this Doc View Source

SplashUrl

Declaration
public string SplashUrl { get; }
Property Value
Type Description
System.String
| Improve this Doc View Source

SystemChannelFlags

Declaration
public SystemChannelMessageDeny SystemChannelFlags { get; }
Property Value
Type Description
SystemChannelMessageDeny
| Improve this Doc View Source

SystemChannelId

Declaration
public ulong? SystemChannelId { get; }
Property Value
Type Description
System.Nullable<System.UInt64>
| Improve this Doc View Source

VanityURLCode

Declaration
public string VanityURLCode { get; }
Property Value
Type Description
System.String
| Improve this Doc View Source

VerificationLevel

Declaration
public VerificationLevel VerificationLevel { get; }
Property Value
Type Description
VerificationLevel
| Improve this Doc View Source

VoiceRegionId

Declaration
public string VoiceRegionId { get; }
Property Value
Type Description
System.String

Methods

| Improve this Doc View Source

AddBanAsync(IUser, Int32, String, RequestOptions)

Declaration
public Task AddBanAsync(IUser user, int pruneDays = 0, string reason = null, RequestOptions options = null)
Parameters
Type Name Description
IUser user
System.Int32 pruneDays
System.String reason
RequestOptions options
Returns
Type Description
System.Threading.Tasks.Task
| Improve this Doc View Source

AddBanAsync(UInt64, Int32, String, RequestOptions)

Declaration
public Task AddBanAsync(ulong userId, int pruneDays = 0, string reason = null, RequestOptions options = null)
Parameters
Type Name Description
System.UInt64 userId
System.Int32 pruneDays
System.String reason
RequestOptions options
Returns
Type Description
System.Threading.Tasks.Task
| Improve this Doc View Source

AddGuildUserAsync(UInt64, String, Action<AddGuildUserProperties>, RequestOptions)

Declaration
public Task<RestGuildUser> AddGuildUserAsync(ulong id, string accessToken, Action<AddGuildUserProperties> func = null, RequestOptions options = null)
Parameters
Type Name Description
System.UInt64 id
System.String accessToken
System.Action<AddGuildUserProperties> func
RequestOptions options
Returns
Type Description
System.Threading.Tasks.Task<RestGuildUser>
| Improve this Doc View Source

CreateCategoryChannelAsync(String, Action<GuildChannelProperties>, RequestOptions)

Creates a category channel with the provided name.

Declaration
public Task<RestCategoryChannel> CreateCategoryChannelAsync(string name, Action<GuildChannelProperties> func = null, RequestOptions options = null)
Parameters
Type Name Description
System.String name

The name of the new channel.

System.Action<GuildChannelProperties> func

The delegate containing the properties to be applied to the channel upon its creation.

RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<RestCategoryChannel>

The created category channel.

Exceptions
Type Condition
System.ArgumentNullException

name is null.

| Improve this Doc View Source

CreateEmoteAsync(String, Image, Optional<IEnumerable<IRole>>, RequestOptions)

Declaration
public Task<GuildEmote> CreateEmoteAsync(string name, Image image, Optional<IEnumerable<IRole>> roles = default(Optional<IEnumerable<IRole>>), RequestOptions options = null)
Parameters
Type Name Description
System.String name
Image image
Optional<System.Collections.Generic.IEnumerable<IRole>> roles
RequestOptions options
Returns
Type Description
System.Threading.Tasks.Task<GuildEmote>
| Improve this Doc View Source

CreateIntegrationAsync(UInt64, String, RequestOptions)

Declaration
public Task<RestGuildIntegration> CreateIntegrationAsync(ulong id, string type, RequestOptions options = null)
Parameters
Type Name Description
System.UInt64 id
System.String type
RequestOptions options
Returns
Type Description
System.Threading.Tasks.Task<RestGuildIntegration>
| Improve this Doc View Source

CreateRoleAsync(String, Nullable<GuildPermissions>, Nullable<Color>, Boolean, RequestOptions)

Declaration
public Task<RestRole> CreateRoleAsync(string name, GuildPermissions? permissions = default(GuildPermissions? ), Color? color = default(Color? ), bool isHoisted = false, RequestOptions options = null)
Parameters
Type Name Description
System.String name
System.Nullable<GuildPermissions> permissions
System.Nullable<Color> color
System.Boolean isHoisted
RequestOptions options
Returns
Type Description
System.Threading.Tasks.Task<RestRole>
| Improve this Doc View Source

CreateRoleAsync(String, Nullable<GuildPermissions>, Nullable<Color>, Boolean, Boolean, RequestOptions)

Creates a new role with the provided name.

Declaration
public Task<RestRole> CreateRoleAsync(string name, GuildPermissions? permissions = default(GuildPermissions? ), Color? color = default(Color? ), bool isHoisted = false, bool isMentionable = false, RequestOptions options = null)
Parameters
Type Name Description
System.String name

The new name for the role.

System.Nullable<GuildPermissions> permissions

The guild permission that the role should possess.

System.Nullable<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.

RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<RestRole>

A task that represents the asynchronous creation operation. The task result contains the newly created role.

| Improve this Doc View Source

CreateTextChannelAsync(String, Action<TextChannelProperties>, RequestOptions)

Creates a new text channel in this guild.

Declaration
public Task<RestTextChannel> CreateTextChannelAsync(string name, Action<TextChannelProperties> func = null, RequestOptions options = null)
Parameters
Type Name Description
System.String name

The new name for the text channel.

System.Action<TextChannelProperties> func

The delegate containing the properties to be applied to the channel upon its creation.

RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<RestTextChannel>

A task that represents the asynchronous creation operation. The task result contains the newly created text channel.

Examples

The following example creates a new text channel under an existing category named Wumpus with a set topic.

var categories = await guild.GetCategoriesAsync();
var targetCategory = categories.FirstOrDefault(x => x.Name == "wumpus");
if (targetCategory == null) return;
await Context.Guild.CreateTextChannelAsync(name, x =>
{
    x.CategoryId = targetCategory.Id;
    x.Topic = $"This channel was created at {DateTimeOffset.UtcNow} by {user}.";
});
| Improve this Doc View Source

CreateVoiceChannelAsync(String, Action<VoiceChannelProperties>, RequestOptions)

Creates a voice channel with the provided name.

Declaration
public Task<RestVoiceChannel> CreateVoiceChannelAsync(string name, Action<VoiceChannelProperties> func = null, RequestOptions options = null)
Parameters
Type Name Description
System.String name

The name of the new channel.

System.Action<VoiceChannelProperties> func

The delegate containing the properties to be applied to the channel upon its creation.

RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<RestVoiceChannel>

The created voice channel.

Exceptions
Type Condition
System.ArgumentNullException

name is null.

| Improve this Doc View Source

DeleteAsync(RequestOptions)

Declaration
public Task DeleteAsync(RequestOptions options = null)
Parameters
Type Name Description
RequestOptions options
Returns
Type Description
System.Threading.Tasks.Task
| Improve this Doc View Source

DeleteEmoteAsync(GuildEmote, RequestOptions)

Declaration
public Task DeleteEmoteAsync(GuildEmote emote, RequestOptions options = null)
Parameters
Type Name Description
GuildEmote emote
RequestOptions options
Returns
Type Description
System.Threading.Tasks.Task
| Improve this Doc View Source

GetAFKChannelAsync(RequestOptions)

Gets the AFK voice channel in this guild.

Declaration
public Task<RestVoiceChannel> GetAFKChannelAsync(RequestOptions options = null)
Parameters
Type Name Description
RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<RestVoiceChannel>

A task that represents the asynchronous get operation. The task result contains the voice channel that the AFK users will be moved to after they have idled for too long; null if none is set.

| Improve this Doc View Source

GetAuditLogsAsync(Int32, RequestOptions, Nullable<UInt64>, Nullable<UInt64>, Nullable<ActionType>)

Gets the specified number of audit log entries for this guild.

Declaration
public IAsyncEnumerable<IReadOnlyCollection<RestAuditLogEntry>> GetAuditLogsAsync(int limit, RequestOptions options = null, ulong? beforeId = default(ulong? ), ulong? userId = default(ulong? ), ActionType? actionType = default(ActionType? ))
Parameters
Type Name Description
System.Int32 limit

The number of audit log entries to fetch.

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<ActionType> actionType

The type of actions to filter.

Returns
Type Description
System.Collections.Generic.IAsyncEnumerable<System.Collections.Generic.IReadOnlyCollection<RestAuditLogEntry>>

A task that represents the asynchronous get operation. The task result contains a read-only collection of the requested audit log entries.

| Improve this Doc View Source

GetBanAsync(IUser, RequestOptions)

Gets a ban object for a banned user.

Declaration
public Task<RestBan> GetBanAsync(IUser user, RequestOptions options = null)
Parameters
Type Name Description
IUser user

The banned user.

RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<RestBan>

A task that represents the asynchronous get operation. The task result contains a ban object, which contains the user information and the reason for the ban; null if the ban entry cannot be found.

| Improve this Doc View Source

GetBanAsync(UInt64, RequestOptions)

Gets a ban object for a banned user.

Declaration
public Task<RestBan> GetBanAsync(ulong userId, RequestOptions options = null)
Parameters
Type Name Description
System.UInt64 userId

The snowflake identifier for the banned user.

RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<RestBan>

A task that represents the asynchronous get operation. The task result contains a ban object, which contains the user information and the reason for the ban; null if the ban entry cannot be found.

| Improve this Doc View Source

GetBansAsync(RequestOptions)

Gets a collection of all users banned in this guild.

Declaration
public Task<IReadOnlyCollection<RestBan>> GetBansAsync(RequestOptions options = null)
Parameters
Type Name Description
RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<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.

| Improve this Doc View Source

GetCategoryChannelsAsync(RequestOptions)

Gets a collection of all category channels in this guild.

Declaration
public Task<IReadOnlyCollection<RestCategoryChannel>> GetCategoryChannelsAsync(RequestOptions options = null)
Parameters
Type Name Description
RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<RestCategoryChannel>>

A task that represents the asynchronous get operation. The task result contains a read-only collection of category channels found within this guild.

| Improve this Doc View Source

GetChannelAsync(UInt64, RequestOptions)

Gets a channel in this guild.

Declaration
public Task<RestGuildChannel> GetChannelAsync(ulong id, RequestOptions options = null)
Parameters
Type Name Description
System.UInt64 id

The snowflake identifier for the channel.

RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<RestGuildChannel>

A task that represents the asynchronous get operation. The task result contains the generic channel associated with the specified id; null if none is found.

| Improve this Doc View Source

GetChannelsAsync(RequestOptions)

Gets a collection of all channels in this guild.

Declaration
public Task<IReadOnlyCollection<RestGuildChannel>> GetChannelsAsync(RequestOptions options = null)
Parameters
Type Name Description
RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<RestGuildChannel>>

A task that represents the asynchronous get operation. The task result contains a read-only collection of generic channels found within this guild.

| Improve this Doc View Source

GetCurrentUserAsync(RequestOptions)

Gets the current user for this guild.

Declaration
public Task<RestGuildUser> GetCurrentUserAsync(RequestOptions options = null)
Parameters
Type Name Description
RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<RestGuildUser>

A task that represents the asynchronous get operation. The task result contains the currently logged-in user within this guild.

| Improve this Doc View Source

GetDefaultChannelAsync(RequestOptions)

Gets the first viewable text channel in this guild.

Declaration
public Task<RestTextChannel> GetDefaultChannelAsync(RequestOptions options = null)
Parameters
Type Name Description
RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<RestTextChannel>

A task that represents the asynchronous get operation. The task result contains the first viewable text channel in this guild; null if none is found.

| Improve this Doc View Source

GetEmbedChannelAsync(RequestOptions)

Gets the embed channel (i.e. the channel set in the guild's widget settings) in this guild.

Declaration
public Task<RestGuildChannel> GetEmbedChannelAsync(RequestOptions options = null)
Parameters
Type Name Description
RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<RestGuildChannel>

A task that represents the asynchronous get operation. The task result contains the embed channel set within the server's widget settings; null if none is set.

| Improve this Doc View Source

GetEmoteAsync(UInt64, RequestOptions)

Declaration
public Task<GuildEmote> GetEmoteAsync(ulong id, RequestOptions options = null)
Parameters
Type Name Description
System.UInt64 id
RequestOptions options
Returns
Type Description
System.Threading.Tasks.Task<GuildEmote>
| Improve this Doc View Source

GetIntegrationsAsync(RequestOptions)

Declaration
public Task<IReadOnlyCollection<RestGuildIntegration>> GetIntegrationsAsync(RequestOptions options = null)
Parameters
Type Name Description
RequestOptions options
Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<RestGuildIntegration>>
| Improve this Doc View Source

GetInvitesAsync(RequestOptions)

Gets a collection of all invites in this guild.

Declaration
public Task<IReadOnlyCollection<RestInviteMetadata>> GetInvitesAsync(RequestOptions options = null)
Parameters
Type Name Description
RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<RestInviteMetadata>>

A task that represents the asynchronous get operation. The task result contains a read-only collection of invite metadata, each representing information for an invite found within this guild.

| Improve this Doc View Source

GetOwnerAsync(RequestOptions)

Gets the owner of this guild.

Declaration
public Task<RestGuildUser> GetOwnerAsync(RequestOptions options = null)
Parameters
Type Name Description
RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<RestGuildUser>

A task that represents the asynchronous get operation. The task result contains the owner of this guild.

| Improve this Doc View Source

GetRole(UInt64)

Gets a role in this guild.

Declaration
public RestRole GetRole(ulong id)
Parameters
Type Name Description
System.UInt64 id

The snowflake identifier for the role.

Returns
Type Description
RestRole

A role that is associated with the specified id; null if none is found.

| Improve this Doc View Source

GetSystemChannelAsync(RequestOptions)

Gets the first viewable text channel in this guild.

Declaration
public Task<RestTextChannel> GetSystemChannelAsync(RequestOptions options = null)
Parameters
Type Name Description
RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<RestTextChannel>

A task that represents the asynchronous get operation. The task result contains the first viewable text channel in this guild; null if none is found.

| Improve this Doc View Source

GetTextChannelAsync(UInt64, RequestOptions)

Gets a text channel in this guild.

Declaration
public Task<RestTextChannel> GetTextChannelAsync(ulong id, RequestOptions options = null)
Parameters
Type Name Description
System.UInt64 id

The snowflake identifier for the text channel.

RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<RestTextChannel>

A task that represents the asynchronous get operation. The task result contains the text channel associated with the specified id; null if none is found.

| Improve this Doc View Source

GetTextChannelsAsync(RequestOptions)

Gets a collection of all text channels in this guild.

Declaration
public Task<IReadOnlyCollection<RestTextChannel>> GetTextChannelsAsync(RequestOptions options = null)
Parameters
Type Name Description
RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<RestTextChannel>>

A task that represents the asynchronous get operation. The task result contains a read-only collection of message channels found within this guild.

| Improve this Doc View Source

GetUserAsync(UInt64, RequestOptions)

Gets a user from this guild.

Declaration
public Task<RestGuildUser> GetUserAsync(ulong id, RequestOptions options = null)
Parameters
Type Name Description
System.UInt64 id

The snowflake identifier of the user.

RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<RestGuildUser>

A task that represents the asynchronous get operation. The task result contains the guild user associated with the specified id; null if none is found.

Remarks

This method retrieves a user found within this guild.

| Improve this Doc View Source

GetUsersAsync(RequestOptions)

Gets a collection of all users in this guild.

Declaration
public IAsyncEnumerable<IReadOnlyCollection<RestGuildUser>> GetUsersAsync(RequestOptions options = null)
Parameters
Type Name Description
RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Collections.Generic.IAsyncEnumerable<System.Collections.Generic.IReadOnlyCollection<RestGuildUser>>

A task that represents the asynchronous get operation. The task result contains a collection of guild users found within this guild.

Remarks

This method retrieves all users found within this guild.

| Improve this Doc View Source

GetVanityInviteAsync(RequestOptions)

Gets the vanity invite URL of this guild.

Declaration
public Task<RestInviteMetadata> GetVanityInviteAsync(RequestOptions options = null)
Parameters
Type Name Description
RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<RestInviteMetadata>

A partial metadata of the vanity invite found within this guild.

| Improve this Doc View Source

GetVoiceChannelAsync(UInt64, RequestOptions)

Gets a voice channel in this guild.

Declaration
public Task<RestVoiceChannel> GetVoiceChannelAsync(ulong id, RequestOptions options = null)
Parameters
Type Name Description
System.UInt64 id

The snowflake identifier for the voice channel.

RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<RestVoiceChannel>

A task that represents the asynchronous get operation. The task result contains the voice channel associated with the specified id; null if none is found.

| Improve this Doc View Source

GetVoiceChannelsAsync(RequestOptions)

Gets a collection of all voice channels in this guild.

Declaration
public Task<IReadOnlyCollection<RestVoiceChannel>> GetVoiceChannelsAsync(RequestOptions options = null)
Parameters
Type Name Description
RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<RestVoiceChannel>>

A task that represents the asynchronous get operation. The task result contains a read-only collection of voice channels found within this guild.

| Improve this Doc View Source

GetVoiceRegionsAsync(RequestOptions)

Gets a collection of all the voice regions this guild can access.

Declaration
public Task<IReadOnlyCollection<RestVoiceRegion>> GetVoiceRegionsAsync(RequestOptions options = null)
Parameters
Type Name Description
RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<RestVoiceRegion>>

A task that represents the asynchronous get operation. The task result contains a read-only collection of voice regions the guild can access.

| Improve this Doc View Source

GetWebhookAsync(UInt64, RequestOptions)

Gets a webhook found within this guild.

Declaration
public Task<RestWebhook> GetWebhookAsync(ulong id, RequestOptions options = null)
Parameters
Type Name Description
System.UInt64 id

The identifier for the webhook.

RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<RestWebhook>

A task that represents the asynchronous get operation. The task result contains the webhook with the specified id; null if none is found.

| Improve this Doc View Source

GetWebhooksAsync(RequestOptions)

Gets a collection of all webhook from this guild.

Declaration
public Task<IReadOnlyCollection<RestWebhook>> GetWebhooksAsync(RequestOptions options = null)
Parameters
Type Name Description
RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<RestWebhook>>

A task that represents the asynchronous get operation. The task result contains a read-only collection of webhooks found within the guild.

| Improve this Doc View Source

LeaveAsync(RequestOptions)

Declaration
public Task LeaveAsync(RequestOptions options = null)
Parameters
Type Name Description
RequestOptions options
Returns
Type Description
System.Threading.Tasks.Task
| Improve this Doc View Source

ModifyAsync(Action<GuildProperties>, RequestOptions)

Declaration
public Task ModifyAsync(Action<GuildProperties> func, RequestOptions options = null)
Parameters
Type Name Description
System.Action<GuildProperties> func
RequestOptions options
Returns
Type Description
System.Threading.Tasks.Task
Exceptions
Type Condition
System.ArgumentNullException

func is null.

| Improve this Doc View Source

ModifyEmbedAsync(Action<GuildEmbedProperties>, RequestOptions)

Declaration
public Task ModifyEmbedAsync(Action<GuildEmbedProperties> func, RequestOptions options = null)
Parameters
Type Name Description
System.Action<GuildEmbedProperties> func
RequestOptions options
Returns
Type Description
System.Threading.Tasks.Task
Exceptions
Type Condition
System.ArgumentNullException

func is null.

| Improve this Doc View Source

ModifyEmoteAsync(GuildEmote, Action<EmoteProperties>, RequestOptions)

Declaration
public Task<GuildEmote> ModifyEmoteAsync(GuildEmote emote, Action<EmoteProperties> func, RequestOptions options = null)
Parameters
Type Name Description
GuildEmote emote
System.Action<EmoteProperties> func
RequestOptions options
Returns
Type Description
System.Threading.Tasks.Task<GuildEmote>
Exceptions
Type Condition
System.ArgumentNullException

func is null.

| Improve this Doc View Source

PruneUsersAsync(Int32, Boolean, RequestOptions)

Prunes inactive users.

Declaration
public Task<int> PruneUsersAsync(int days = 30, bool simulate = false, RequestOptions options = null)
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.

RequestOptions options

The options to be used when sending the request.

Returns
Type Description
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.

Remarks

This method removes all users that have not logged on in the provided number of days.

If simulate is true, this method will only return the number of users that would be removed without kicking the users.

| Improve this Doc View Source

RemoveBanAsync(IUser, RequestOptions)

Declaration
public Task RemoveBanAsync(IUser user, RequestOptions options = null)
Parameters
Type Name Description
IUser user
RequestOptions options
Returns
Type Description
System.Threading.Tasks.Task
| Improve this Doc View Source

RemoveBanAsync(UInt64, RequestOptions)

Declaration
public Task RemoveBanAsync(ulong userId, RequestOptions options = null)
Parameters
Type Name Description
System.UInt64 userId
RequestOptions options
Returns
Type Description
System.Threading.Tasks.Task
| Improve this Doc View Source

ReorderChannelsAsync(IEnumerable<ReorderChannelProperties>, RequestOptions)

Declaration
public Task ReorderChannelsAsync(IEnumerable<ReorderChannelProperties> args, RequestOptions options = null)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<ReorderChannelProperties> args
RequestOptions options
Returns
Type Description
System.Threading.Tasks.Task
Exceptions
Type Condition
System.ArgumentNullException

args is null.

| Improve this Doc View Source

ReorderRolesAsync(IEnumerable<ReorderRoleProperties>, RequestOptions)

Declaration
public Task ReorderRolesAsync(IEnumerable<ReorderRoleProperties> args, RequestOptions options = null)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<ReorderRoleProperties> args
RequestOptions options
Returns
Type Description
System.Threading.Tasks.Task
| Improve this Doc View Source

ToString()

Returns the name of the guild.

Declaration
public override string ToString()
Returns
Type Description
System.String

The name of the guild.

Overrides
System.Object.ToString()
| Improve this Doc View Source

UpdateAsync(RequestOptions)

Declaration
public Task UpdateAsync(RequestOptions options = null)
Parameters
Type Name Description
RequestOptions options
Returns
Type Description
System.Threading.Tasks.Task

Explicit Interface Implementations

| Improve this Doc View Source

IGuild.AddGuildUserAsync(UInt64, String, Action<AddGuildUserProperties>, RequestOptions)

Declaration
Task<IGuildUser> IGuild.AddGuildUserAsync(ulong userId, string accessToken, Action<AddGuildUserProperties> func, RequestOptions options)
Parameters
Type Name Description
System.UInt64 userId
System.String accessToken
System.Action<AddGuildUserProperties> func
RequestOptions options
Returns
Type Description
System.Threading.Tasks.Task<IGuildUser>
| Improve this Doc View Source

IGuild.AudioClient

Declaration
IAudioClient IGuild.AudioClient { get; }
Returns
Type Description
IAudioClient
| Improve this Doc View Source

IGuild.Available

Declaration
bool IGuild.Available { get; }
Returns
Type Description
System.Boolean
| Improve this Doc View Source

IGuild.CreateCategoryAsync(String, Action<GuildChannelProperties>, RequestOptions)

Declaration
Task<ICategoryChannel> IGuild.CreateCategoryAsync(string name, Action<GuildChannelProperties> func, RequestOptions options)
Parameters
Type Name Description
System.String name
System.Action<GuildChannelProperties> func
RequestOptions options
Returns
Type Description
System.Threading.Tasks.Task<ICategoryChannel>
| Improve this Doc View Source

IGuild.CreateIntegrationAsync(UInt64, String, RequestOptions)

Declaration
Task<IGuildIntegration> IGuild.CreateIntegrationAsync(ulong id, string type, RequestOptions options)
Parameters
Type Name Description
System.UInt64 id
System.String type
RequestOptions options
Returns
Type Description
System.Threading.Tasks.Task<IGuildIntegration>
| Improve this Doc View Source

IGuild.CreateRoleAsync(String, Nullable<GuildPermissions>, Nullable<Color>, Boolean, RequestOptions)

Declaration
Task<IRole> IGuild.CreateRoleAsync(string name, GuildPermissions? permissions, Color? color, bool isHoisted, RequestOptions options)
Parameters
Type Name Description
System.String name
System.Nullable<GuildPermissions> permissions
System.Nullable<Color> color
System.Boolean isHoisted
RequestOptions options
Returns
Type Description
System.Threading.Tasks.Task<IRole>
| Improve this Doc View Source

IGuild.CreateRoleAsync(String, Nullable<GuildPermissions>, Nullable<Color>, Boolean, Boolean, RequestOptions)

Declaration
Task<IRole> IGuild.CreateRoleAsync(string name, GuildPermissions? permissions, Color? color, bool isHoisted, bool isMentionable, RequestOptions options)
Parameters
Type Name Description
System.String name
System.Nullable<GuildPermissions> permissions
System.Nullable<Color> color
System.Boolean isHoisted
System.Boolean isMentionable
RequestOptions options
Returns
Type Description
System.Threading.Tasks.Task<IRole>
| Improve this Doc View Source

IGuild.CreateTextChannelAsync(String, Action<TextChannelProperties>, RequestOptions)

Declaration
Task<ITextChannel> IGuild.CreateTextChannelAsync(string name, Action<TextChannelProperties> func, RequestOptions options)
Parameters
Type Name Description
System.String name
System.Action<TextChannelProperties> func
RequestOptions options
Returns
Type Description
System.Threading.Tasks.Task<ITextChannel>
| Improve this Doc View Source

IGuild.CreateVoiceChannelAsync(String, Action<VoiceChannelProperties>, RequestOptions)

Declaration
Task<IVoiceChannel> IGuild.CreateVoiceChannelAsync(string name, Action<VoiceChannelProperties> func, RequestOptions options)
Parameters
Type Name Description
System.String name
System.Action<VoiceChannelProperties> func
RequestOptions options
Returns
Type Description
System.Threading.Tasks.Task<IVoiceChannel>
| Improve this Doc View Source

IGuild.DownloadUsersAsync()

Declaration
Task IGuild.DownloadUsersAsync()
Returns
Type Description
System.Threading.Tasks.Task
Exceptions
Type Condition
System.NotSupportedException

Downloading users is not supported for a REST-based guild.

| Improve this Doc View Source

IGuild.EveryoneRole

Declaration
IRole IGuild.EveryoneRole { get; }
Returns
Type Description
IRole
| Improve this Doc View Source

IGuild.GetAFKChannelAsync(CacheMode, RequestOptions)

Declaration
Task<IVoiceChannel> IGuild.GetAFKChannelAsync(CacheMode mode, RequestOptions options)
Parameters
Type Name Description
CacheMode mode
RequestOptions options
Returns
Type Description
System.Threading.Tasks.Task<IVoiceChannel>
| Improve this Doc View Source

IGuild.GetAuditLogsAsync(Int32, CacheMode, RequestOptions, Nullable<UInt64>, Nullable<UInt64>, Nullable<ActionType>)

Declaration
Task<IReadOnlyCollection<IAuditLogEntry>> IGuild.GetAuditLogsAsync(int limit, CacheMode cacheMode, RequestOptions options, ulong? beforeId, ulong? userId, ActionType? actionType)
Parameters
Type Name Description
System.Int32 limit
CacheMode cacheMode
RequestOptions options
System.Nullable<System.UInt64> beforeId
System.Nullable<System.UInt64> userId
System.Nullable<ActionType> actionType
Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<IAuditLogEntry>>
| Improve this Doc View Source

IGuild.GetBanAsync(IUser, RequestOptions)

Declaration
Task<IBan> IGuild.GetBanAsync(IUser user, RequestOptions options)
Parameters
Type Name Description
IUser user
RequestOptions options
Returns
Type Description
System.Threading.Tasks.Task<IBan>
| Improve this Doc View Source

IGuild.GetBanAsync(UInt64, RequestOptions)

Declaration
Task<IBan> IGuild.GetBanAsync(ulong userId, RequestOptions options)
Parameters
Type Name Description
System.UInt64 userId
RequestOptions options
Returns
Type Description
System.Threading.Tasks.Task<IBan>
| Improve this Doc View Source

IGuild.GetBansAsync(RequestOptions)

Declaration
Task<IReadOnlyCollection<IBan>> IGuild.GetBansAsync(RequestOptions options)
Parameters
Type Name Description
RequestOptions options
Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<IBan>>
| Improve this Doc View Source

IGuild.GetCategoriesAsync(CacheMode, RequestOptions)

Declaration
Task<IReadOnlyCollection<ICategoryChannel>> IGuild.GetCategoriesAsync(CacheMode mode, RequestOptions options)
Parameters
Type Name Description
CacheMode mode
RequestOptions options
Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<ICategoryChannel>>
| Improve this Doc View Source

IGuild.GetChannelAsync(UInt64, CacheMode, RequestOptions)

Declaration
Task<IGuildChannel> IGuild.GetChannelAsync(ulong id, CacheMode mode, RequestOptions options)
Parameters
Type Name Description
System.UInt64 id
CacheMode mode
RequestOptions options
Returns
Type Description
System.Threading.Tasks.Task<IGuildChannel>
| Improve this Doc View Source

IGuild.GetChannelsAsync(CacheMode, RequestOptions)

Declaration
Task<IReadOnlyCollection<IGuildChannel>> IGuild.GetChannelsAsync(CacheMode mode, RequestOptions options)
Parameters
Type Name Description
CacheMode mode
RequestOptions options
Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<IGuildChannel>>
| Improve this Doc View Source

IGuild.GetCurrentUserAsync(CacheMode, RequestOptions)

Declaration
Task<IGuildUser> IGuild.GetCurrentUserAsync(CacheMode mode, RequestOptions options)
Parameters
Type Name Description
CacheMode mode
RequestOptions options
Returns
Type Description
System.Threading.Tasks.Task<IGuildUser>
| Improve this Doc View Source

IGuild.GetDefaultChannelAsync(CacheMode, RequestOptions)

Declaration
Task<ITextChannel> IGuild.GetDefaultChannelAsync(CacheMode mode, RequestOptions options)
Parameters
Type Name Description
CacheMode mode
RequestOptions options
Returns
Type Description
System.Threading.Tasks.Task<ITextChannel>
| Improve this Doc View Source

IGuild.GetEmbedChannelAsync(CacheMode, RequestOptions)

Declaration
Task<IGuildChannel> IGuild.GetEmbedChannelAsync(CacheMode mode, RequestOptions options)
Parameters
Type Name Description
CacheMode mode
RequestOptions options
Returns
Type Description
System.Threading.Tasks.Task<IGuildChannel>
| Improve this Doc View Source

IGuild.GetIntegrationsAsync(RequestOptions)

Declaration
Task<IReadOnlyCollection<IGuildIntegration>> IGuild.GetIntegrationsAsync(RequestOptions options)
Parameters
Type Name Description
RequestOptions options
Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<IGuildIntegration>>
| Improve this Doc View Source

IGuild.GetInvitesAsync(RequestOptions)

Declaration
Task<IReadOnlyCollection<IInviteMetadata>> IGuild.GetInvitesAsync(RequestOptions options)
Parameters
Type Name Description
RequestOptions options
Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<IInviteMetadata>>
| Improve this Doc View Source

IGuild.GetOwnerAsync(CacheMode, RequestOptions)

Declaration
Task<IGuildUser> IGuild.GetOwnerAsync(CacheMode mode, RequestOptions options)
Parameters
Type Name Description
CacheMode mode
RequestOptions options
Returns
Type Description
System.Threading.Tasks.Task<IGuildUser>
| Improve this Doc View Source

IGuild.GetRole(UInt64)

Declaration
IRole IGuild.GetRole(ulong id)
Parameters
Type Name Description
System.UInt64 id
Returns
Type Description
IRole
| Improve this Doc View Source

IGuild.GetSystemChannelAsync(CacheMode, RequestOptions)

Declaration
Task<ITextChannel> IGuild.GetSystemChannelAsync(CacheMode mode, RequestOptions options)
Parameters
Type Name Description
CacheMode mode
RequestOptions options
Returns
Type Description
System.Threading.Tasks.Task<ITextChannel>
| Improve this Doc View Source

IGuild.GetTextChannelAsync(UInt64, CacheMode, RequestOptions)

Declaration
Task<ITextChannel> IGuild.GetTextChannelAsync(ulong id, CacheMode mode, RequestOptions options)
Parameters
Type Name Description
System.UInt64 id
CacheMode mode
RequestOptions options
Returns
Type Description
System.Threading.Tasks.Task<ITextChannel>
| Improve this Doc View Source

IGuild.GetTextChannelsAsync(CacheMode, RequestOptions)

Declaration
Task<IReadOnlyCollection<ITextChannel>> IGuild.GetTextChannelsAsync(CacheMode mode, RequestOptions options)
Parameters
Type Name Description
CacheMode mode
RequestOptions options
Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<ITextChannel>>
| Improve this Doc View Source

IGuild.GetUserAsync(UInt64, CacheMode, RequestOptions)

Declaration
Task<IGuildUser> IGuild.GetUserAsync(ulong id, CacheMode mode, RequestOptions options)
Parameters
Type Name Description
System.UInt64 id
CacheMode mode
RequestOptions options
Returns
Type Description
System.Threading.Tasks.Task<IGuildUser>
| Improve this Doc View Source

IGuild.GetUsersAsync(CacheMode, RequestOptions)

Declaration
Task<IReadOnlyCollection<IGuildUser>> IGuild.GetUsersAsync(CacheMode mode, RequestOptions options)
Parameters
Type Name Description
CacheMode mode
RequestOptions options
Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<IGuildUser>>
| Improve this Doc View Source

IGuild.GetVanityInviteAsync(RequestOptions)

Declaration
Task<IInviteMetadata> IGuild.GetVanityInviteAsync(RequestOptions options)
Parameters
Type Name Description
RequestOptions options
Returns
Type Description
System.Threading.Tasks.Task<IInviteMetadata>
| Improve this Doc View Source

IGuild.GetVoiceChannelAsync(UInt64, CacheMode, RequestOptions)

Declaration
Task<IVoiceChannel> IGuild.GetVoiceChannelAsync(ulong id, CacheMode mode, RequestOptions options)
Parameters
Type Name Description
System.UInt64 id
CacheMode mode
RequestOptions options
Returns
Type Description
System.Threading.Tasks.Task<IVoiceChannel>
| Improve this Doc View Source

IGuild.GetVoiceChannelsAsync(CacheMode, RequestOptions)

Declaration
Task<IReadOnlyCollection<IVoiceChannel>> IGuild.GetVoiceChannelsAsync(CacheMode mode, RequestOptions options)
Parameters
Type Name Description
CacheMode mode
RequestOptions options
Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<IVoiceChannel>>
| Improve this Doc View Source

IGuild.GetVoiceRegionsAsync(RequestOptions)

Declaration
Task<IReadOnlyCollection<IVoiceRegion>> IGuild.GetVoiceRegionsAsync(RequestOptions options)
Parameters
Type Name Description
RequestOptions options
Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<IVoiceRegion>>
| Improve this Doc View Source

IGuild.GetWebhookAsync(UInt64, RequestOptions)

Declaration
Task<IWebhook> IGuild.GetWebhookAsync(ulong id, RequestOptions options)
Parameters
Type Name Description
System.UInt64 id
RequestOptions options
Returns
Type Description
System.Threading.Tasks.Task<IWebhook>
| Improve this Doc View Source

IGuild.GetWebhooksAsync(RequestOptions)

Declaration
Task<IReadOnlyCollection<IWebhook>> IGuild.GetWebhooksAsync(RequestOptions options)
Parameters
Type Name Description
RequestOptions options
Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<IWebhook>>
| Improve this Doc View Source

IGuild.Roles

Declaration
IReadOnlyCollection<IRole> IGuild.Roles { get; }
Returns
Type Description
System.Collections.Generic.IReadOnlyCollection<IRole>

Implements

IGuild
IDeletable
ISnowflakeEntity
IEntity<TId>
IUpdateable
  • Improve this Doc
  • View Source
Back to top Generated by DocFX