Class DiscordRestClient
Inherited Members
Namespace: DSharpPlus
Assembly: cs.temp.dll.dll
Syntax
public class DiscordRestClient : BaseDiscordClient
Constructors
DiscordRestClient(DiscordConfiguration)
Declaration
public DiscordRestClient(DiscordConfiguration config)
Parameters
Type | Name | Description |
---|---|---|
DiscordConfiguration | config |
Properties
Guilds
Gets the dictionary of guilds cached by this client.
Declaration
public override IReadOnlyDictionary<ulong, DiscordGuild> Guilds { get; }
Property Value
Type | Description |
---|---|
IReadOnlyDictionary<System.UInt64, DiscordGuild> |
Overrides
Methods
AddGuildMemberAsync(UInt64, UInt64, String, String, IEnumerable<DiscordRole>, Boolean, Boolean)
Adds a member to a guild
Declaration
public Task<DiscordMember> AddGuildMemberAsync(ulong guild_id, ulong user_id, string access_token, string nick, IEnumerable<DiscordRole> roles, bool muted, bool deafened)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | guild_id | Guild id |
System.UInt64 | user_id | User id |
System.String | access_token | Access token |
System.String | nick | User nickname |
IEnumerable<DiscordRole> | roles | User roles |
System.Boolean | muted | Whether this user should be muted on join |
System.Boolean | deafened | Whether this user should be deafened on join |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordMember> |
AddGuildMemberRoleAsync(UInt64, UInt64, UInt64, String)
Add role to guild member
Declaration
public Task AddGuildMemberRoleAsync(ulong guild_id, ulong user_id, ulong role_id, string reason)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | guild_id | Guild id |
System.UInt64 | user_id | User id |
System.UInt64 | role_id | Role id |
System.String | reason | Reason this role gets added |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
BeginGuildPruneAsync(UInt64, Int32, Boolean, IEnumerable<UInt64>, String)
Begins a guild prune.
Declaration
public Task<int?> BeginGuildPruneAsync(ulong guild_id, int days, bool compute_prune_count, IEnumerable<ulong> include_roles, string reason)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | guild_id | Guild id |
System.Int32 | days | Days to prune for |
System.Boolean | compute_prune_count | Whether to return the prune count after this method completes. This is discouraged for larger guilds. |
IEnumerable<System.UInt64> | include_roles | The roles to be included in the prune. |
System.String | reason | Reason why this guild was pruned |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Nullable<System.Int32>> |
CreateChannelInviteAsync(UInt64, Int32, Int32, Boolean, Boolean, String)
Creates a channel invite
Declaration
public Task<DiscordInvite> CreateChannelInviteAsync(ulong channel_id, int max_age, int max_uses, bool temporary, bool unique, string reason)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | channel_id | Channel id |
System.Int32 | max_age | For how long the invite should exist |
System.Int32 | max_uses | How often the invite may be used |
System.Boolean | temporary | Whether this invite should be temporary |
System.Boolean | unique | Whether this invite should be unique (false might return an existing invite) |
System.String | reason | Why you made an invite |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordInvite> |
CreateDmAsync(UInt64)
Creates a DM
Declaration
public Task<DiscordDmChannel> CreateDmAsync(ulong recipient_id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | recipient_id | Recipient user id |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordDmChannel> |
CreateGroupDmAsync(IEnumerable<String>, IDictionary<UInt64, String>)
Creates a group DM
Declaration
public Task<DiscordDmChannel> CreateGroupDmAsync(IEnumerable<string> access_tokens, IDictionary<ulong, string> nicks)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<System.String> | access_tokens | Access tokens |
IDictionary<System.UInt64, System.String> | nicks | Nicknames per user |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordDmChannel> |
CreateGroupDmWithCurrentUserAsync(IEnumerable<String>, IDictionary<UInt64, String>)
Creates a group DM with current user
Declaration
public Task<DiscordDmChannel> CreateGroupDmWithCurrentUserAsync(IEnumerable<string> access_tokens, IDictionary<ulong, string> nicks)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<System.String> | access_tokens | Access tokens |
IDictionary<System.UInt64, System.String> | nicks | Nicknames |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordDmChannel> |
CreateGuildAsync(String, String, String, Nullable<VerificationLevel>, Nullable<DefaultMessageNotifications>)
Creates a new guild
Declaration
public Task<DiscordGuild> CreateGuildAsync(string name, string region_id, string iconb64, VerificationLevel? verification_level, DefaultMessageNotifications? default_message_notifications)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | New guild's name |
System.String | region_id | New guild's region ID |
System.String | iconb64 | New guild's icon (base64) |
System.Nullable<VerificationLevel> | verification_level | New guild's verification level |
System.Nullable<DefaultMessageNotifications> | default_message_notifications | New guild's default message notification level |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordGuild> |
CreateGuildBanAsync(UInt64, UInt64, Int32, String)
Creates guild ban
Declaration
public Task CreateGuildBanAsync(ulong guild_id, ulong user_id, int delete_message_days, string reason)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | guild_id | Guild id |
System.UInt64 | user_id | User id |
System.Int32 | delete_message_days | Days to delete messages |
System.String | reason | Reason why this member was banned |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
CreateGuildChannelAsync(UInt64, String, ChannelType, Nullable<UInt64>, Optional<String>, Nullable<Int32>, Nullable<Int32>, IEnumerable<DiscordOverwriteBuilder>, Nullable<Boolean>, Optional<Nullable<Int32>>, String)
Creates a guild channel
Declaration
public Task<DiscordChannel> CreateGuildChannelAsync(ulong id, string name, ChannelType type, ulong? parent, Optional<string> topic, int? bitrate, int? userLimit, IEnumerable<DiscordOverwriteBuilder> overwrites, bool? nsfw, Optional<int?> perUserRateLimit, string reason)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | id | Channel id |
System.String | name | Channel name |
ChannelType | type | Channel type |
System.Nullable<System.UInt64> | parent | Channel parent id |
Optional<System.String> | topic | Channel topic |
System.Nullable<System.Int32> | bitrate | Voice channel bitrate |
System.Nullable<System.Int32> | userLimit | Voice channel user limit |
IEnumerable<DiscordOverwriteBuilder> | overwrites | Channel overwrites |
System.Nullable<System.Boolean> | nsfw | Whether this channel should be marked as NSFW |
Optional<System.Nullable<System.Int32>> | perUserRateLimit | Slow mode timeout for users. |
System.String | reason | Reason this channel was created |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordChannel> |
CreateGuildFromTemplateAsync(String, String, String)
Creates a guild from a template. This requires the bot to be in less than 10 guilds total.
Declaration
public Task<DiscordGuild> CreateGuildFromTemplateAsync(string code, string name, string icon)
Parameters
Type | Name | Description |
---|---|---|
System.String | code | The template code. |
System.String | name | Name of the guild. |
System.String | icon | Stream containing the icon for the guild. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordGuild> | The created guild. |
CreateGuildIntegrationAsync(UInt64, String, UInt64)
Creates guild integration
Declaration
public Task<DiscordIntegration> CreateGuildIntegrationAsync(ulong guild_id, string type, ulong id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | guild_id | Guild id |
System.String | type | Integration type |
System.UInt64 | id | Integration id |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordIntegration> |
CreateGuildRoleAsync(UInt64, String, Nullable<Permissions>, Nullable<Int32>, Nullable<Boolean>, Nullable<Boolean>, String)
Creates a new role
Declaration
public Task<DiscordRole> CreateGuildRoleAsync(ulong guild_id, string name, Permissions? permissions, int? color, bool? hoist, bool? mentionable, string reason)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | guild_id | Guild id |
System.String | name | Role name |
System.Nullable<Permissions> | permissions | Role permissions |
System.Nullable<System.Int32> | color | Role color |
System.Nullable<System.Boolean> | hoist | Whether this role should be hoisted |
System.Nullable<System.Boolean> | mentionable | Whether this role should be mentionable |
System.String | reason | Reason why this role was created |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordRole> |
CreateGuildTemplateAsync(UInt64, String, String)
Creates a guild template.
Declaration
public Task<DiscordGuildTemplate> CreateGuildTemplateAsync(ulong guild_id, string name, string description = null)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | guild_id | Guild id |
System.String | name | Name of the template. |
System.String | description | Description of the template. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordGuildTemplate> | The template created. |
CreateMessageAsync(UInt64, DiscordEmbed)
Sends a message
Declaration
public Task<DiscordMessage> CreateMessageAsync(ulong channel_id, DiscordEmbed embed)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | channel_id | Channel id |
DiscordEmbed | embed | Embed to attach |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordMessage> |
CreateMessageAsync(UInt64, DiscordMessageBuilder)
Sends a message
Declaration
public Task<DiscordMessage> CreateMessageAsync(ulong channel_id, DiscordMessageBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | channel_id | Channel id |
DiscordMessageBuilder | builder | The Discord Mesage builder. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordMessage> |
CreateMessageAsync(UInt64, String)
Sends a message
Declaration
public Task<DiscordMessage> CreateMessageAsync(ulong channel_id, string content)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | channel_id | Channel id |
System.String | content | Message (text) content |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordMessage> |
CreateMessageAsync(UInt64, String, DiscordEmbed)
Sends a message
Declaration
public Task<DiscordMessage> CreateMessageAsync(ulong channel_id, string content, DiscordEmbed embed)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | channel_id | Channel id |
System.String | content | Message (text) content |
DiscordEmbed | embed | Embed to attach |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordMessage> |
CreateReactionAsync(UInt64, UInt64, String)
Creates a new reaction
Declaration
public Task CreateReactionAsync(ulong channel_id, ulong message_id, string emoji)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | channel_id | Channel id |
System.UInt64 | message_id | Message id |
System.String | emoji | Emoji to react |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
CreateWebhookAsync(UInt64, String, Stream, String)
Creates a new webhook
Declaration
public Task<DiscordWebhook> CreateWebhookAsync(ulong channel_id, string name, Stream avatar = null, string reason = null)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | channel_id | Channel id |
System.String | name | Webhook name |
Stream | avatar | Webhook avatar |
System.String | reason | Reason why this webhook was created |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordWebhook> |
CreateWebhookAsync(UInt64, String, String, String)
Creates a new webhook
Declaration
public Task<DiscordWebhook> CreateWebhookAsync(ulong channel_id, string name, string base64_avatar, string reason)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | channel_id | Channel id |
System.String | name | Webhook name |
System.String | base64_avatar | Webhook avatar (base64) |
System.String | reason | Reason why this webhook was created |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordWebhook> |
CrosspostMessageAsync(UInt64, UInt64)
Publishes a message in a news channel to following channels
Declaration
public Task<DiscordMessage> CrosspostMessageAsync(ulong channel_id, ulong message_id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | channel_id | Id of the news channel the message to crosspost belongs to |
System.UInt64 | message_id | Id of the message to crosspost |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordMessage> |
DeleteAllReactionsAsync(UInt64, UInt64, String)
Deletes all reactions from a message
Declaration
public Task DeleteAllReactionsAsync(ulong channel_id, ulong message_id, string reason)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | channel_id | Channel id |
System.UInt64 | message_id | Message id |
System.String | reason | Reason why all reactions were removed |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
DeleteChannelAsync(UInt64, String)
Deletes a channel
Declaration
public Task DeleteChannelAsync(ulong id, string reason)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | id | Channel id |
System.String | reason | Reason why this channel was deleted |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
DeleteChannelPermissionAsync(UInt64, UInt64, String)
Deletes channel overwrite
Declaration
public Task DeleteChannelPermissionAsync(ulong channel_id, ulong overwrite_id, string reason)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | channel_id | Channel id |
System.UInt64 | overwrite_id | Overwrite id |
System.String | reason | Reason it was deleted |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
DeleteGuildAsync(UInt64)
Deletes a guild
Declaration
public Task DeleteGuildAsync(ulong id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | id | guild id |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
DeleteGuildIntegrationAsync(UInt64, DiscordIntegration)
Removes a guild integration
Declaration
public Task DeleteGuildIntegrationAsync(ulong guild_id, DiscordIntegration integration)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | guild_id | Guild id |
DiscordIntegration | integration | Integration to remove |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
DeleteGuildRoleAsync(UInt64, UInt64, String)
Deletes a role
Declaration
public Task DeleteGuildRoleAsync(ulong guild_id, ulong role_id, string reason)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | guild_id | Guild id |
System.UInt64 | role_id | Role id |
System.String | reason | Reason why this role was deleted |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
DeleteGuildTemplateAsync(UInt64, String)
Deletes the template.
Declaration
public Task<DiscordGuildTemplate> DeleteGuildTemplateAsync(ulong guild_id, string code)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | guild_id | Guild id |
System.String | code | The code of the template to delete. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordGuildTemplate> | The deleted template. |
DeleteInvite(String, String)
Removes an invite
Declaration
public Task<DiscordInvite> DeleteInvite(string invite_code, string reason)
Parameters
Type | Name | Description |
---|---|---|
System.String | invite_code | Invite code |
System.String | reason | Reason why this invite was removed |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordInvite> |
DeleteMessageAsync(UInt64, UInt64, String)
Deletes a message
Declaration
public Task DeleteMessageAsync(ulong channel_id, ulong message_id, string reason)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | channel_id | Channel id |
System.UInt64 | message_id | Message id |
System.String | reason | Why this message was deleted |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
DeleteMessagesAsync(UInt64, IEnumerable<UInt64>, String)
Deletes multiple messages
Declaration
public Task DeleteMessagesAsync(ulong channel_id, IEnumerable<ulong> message_ids, string reason)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | channel_id | Channel id |
IEnumerable<System.UInt64> | message_ids | Message ids |
System.String | reason | Reason these messages were deleted |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
DeleteOwnReactionAsync(UInt64, UInt64, String)
Deletes own reaction
Declaration
public Task DeleteOwnReactionAsync(ulong channel_id, ulong message_id, string emoji)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | channel_id | Channel id |
System.UInt64 | message_id | Message id |
System.String | emoji | Emoji to remove from reaction |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
DeleteUserReactionAsync(UInt64, UInt64, UInt64, String, String)
Deletes someone elses reaction
Declaration
public Task DeleteUserReactionAsync(ulong channel_id, ulong message_id, ulong user_id, string emoji, string reason)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | channel_id | Channel id |
System.UInt64 | message_id | Message id |
System.UInt64 | user_id | User id |
System.String | emoji | Emoji to remove |
System.String | reason | Reason why this reaction was removed |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
DeleteWebhookAsync(UInt64, String)
Deletes a webhook
Declaration
public Task DeleteWebhookAsync(ulong webhook_id, string reason)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | webhook_id | Webhook id |
System.String | reason | Reason this webhook was deleted |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
DeleteWebhookAsync(UInt64, String, String)
Deletes a webhook (when user is not in said guild)
Declaration
public Task DeleteWebhookAsync(ulong webhook_id, string reason, string webhook_token)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | webhook_id | Webhook id |
System.String | reason | Reason this webhook was removed |
System.String | webhook_token | Webhook token |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
Dispose()
Disposes of this DiscordRestClient
Declaration
public override void Dispose()
Overrides
EditChannelPermissionsAsync(UInt64, UInt64, Permissions, Permissions, String, String)
Edits channel overwrite
Declaration
public Task EditChannelPermissionsAsync(ulong channel_id, ulong overwrite_id, Permissions allow, Permissions deny, string type, string reason)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | channel_id | Channel id |
System.UInt64 | overwrite_id | Overwrite id |
Permissions | allow | Permissions to allow |
Permissions | deny | Permissions to deny |
System.String | type | Overwrite type |
System.String | reason | Reason this overwrite was created |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
EditMessageAsync(UInt64, UInt64, DiscordMessageBuilder)
Edits a message
Declaration
public Task<DiscordMessage> EditMessageAsync(ulong channel_id, ulong message_id, DiscordMessageBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | channel_id | Channel id |
System.UInt64 | message_id | Message id |
DiscordMessageBuilder | builder | The builder of the message to edit. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordMessage> |
EditMessageAsync(UInt64, UInt64, Optional<DiscordEmbed>)
Edits a message
Declaration
public Task<DiscordMessage> EditMessageAsync(ulong channel_id, ulong message_id, Optional<DiscordEmbed> embed)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | channel_id | Channel id |
System.UInt64 | message_id | Message id |
Optional<DiscordEmbed> | embed | New message embed |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordMessage> |
EditMessageAsync(UInt64, UInt64, Optional<String>)
Edits a message
Declaration
public Task<DiscordMessage> EditMessageAsync(ulong channel_id, ulong message_id, Optional<string> content)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | channel_id | Channel id |
System.UInt64 | message_id | Message id |
Optional<System.String> | content | New message content |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordMessage> |
ExecuteWebhookAsync(UInt64, String, DiscordWebhookBuilder)
Sends a message to a webhook
Declaration
public Task<DiscordMessage> ExecuteWebhookAsync(ulong webhook_id, string webhook_token, DiscordWebhookBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | webhook_id | Webhook id |
System.String | webhook_token | Webhook token |
DiscordWebhookBuilder | builder | Webhook builder filled with data to send. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordMessage> |
FollowChannelAsync(UInt64, UInt64)
Follows a news channel
Declaration
public Task<DiscordFollowedChannel> FollowChannelAsync(ulong channel_id, ulong webhook_channel_id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | channel_id | Id of the channel to follow |
System.UInt64 | webhook_channel_id | Id of the channel to crosspost messages to |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordFollowedChannel> |
GetApplicationAssetsAsync(DiscordApplication)
Gets assets from an application
Declaration
public Task<IReadOnlyList<DiscordApplicationAsset>> GetApplicationAssetsAsync(DiscordApplication application)
Parameters
Type | Name | Description |
---|---|---|
DiscordApplication | application | Application to get assets from |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<IReadOnlyList<DiscordApplicationAsset>> |
GetChannelAsync(UInt64)
Gets a channel object
Declaration
public Task<DiscordChannel> GetChannelAsync(ulong id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | id | Channel id |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordChannel> |
GetChannelInvitesAsync(UInt64)
Gets a channel's invites
Declaration
public Task<IReadOnlyList<DiscordInvite>> GetChannelInvitesAsync(ulong channel_id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | channel_id | Channel id |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<IReadOnlyList<DiscordInvite>> |
GetChannelMessageAsync(UInt64, UInt64)
Gets a message from a channel
Declaration
public Task<DiscordMessage> GetChannelMessageAsync(ulong channel_id, ulong message_id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | channel_id | Channel id |
System.UInt64 | message_id | Message id |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordMessage> |
GetChannelMessagesAsync(UInt64, Int32, Nullable<UInt64>, Nullable<UInt64>, Nullable<UInt64>)
Gets messages from a channel
Declaration
public Task<IReadOnlyList<DiscordMessage>> GetChannelMessagesAsync(ulong channel_id, int limit, ulong? before, ulong? after, ulong? around)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | channel_id | Channel id |
System.Int32 | limit | Limit of messages to get |
System.Nullable<System.UInt64> | before | Gets messages before this id |
System.Nullable<System.UInt64> | after | Gets messages after this id |
System.Nullable<System.UInt64> | around | Gets messages around this id |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<IReadOnlyList<DiscordMessage>> |
GetChannelWebhooksAsync(UInt64)
Gets all webhooks from a channel
Declaration
public Task<IReadOnlyList<DiscordWebhook>> GetChannelWebhooksAsync(ulong channel_id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | channel_id | Channel id |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<IReadOnlyList<DiscordWebhook>> |
GetCurrentUserAsync()
Gets current user object
Declaration
public Task<DiscordUser> GetCurrentUserAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordUser> |
GetCurrentUserGuildsAsync(Int32, Nullable<UInt64>, Nullable<UInt64>)
Gets current user's guilds
Declaration
public Task<IReadOnlyList<DiscordGuild>> GetCurrentUserGuildsAsync(int limit = 100, ulong? before = default(ulong? ), ulong? after = default(ulong? ))
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | limit | Limit of guilds to get |
System.Nullable<System.UInt64> | before | Gets guild before id |
System.Nullable<System.UInt64> | after | Gets guilds after id |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<IReadOnlyList<DiscordGuild>> |
GetGuildAsync(UInt64, Nullable<Boolean>)
Gets a guild.
Declaration
public Task<DiscordGuild> GetGuildAsync(ulong guild_id, bool? with_counts = default(bool? ))
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | guild_id | The guild ID to search for. |
System.Nullable<System.Boolean> | with_counts | Whether to include approximate presence and member counts in the returned guild. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordGuild> |
GetGuildBansAsync(UInt64)
Gets guild bans
Declaration
public Task<IReadOnlyList<DiscordBan>> GetGuildBansAsync(ulong guild_id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | guild_id | Guild id |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<IReadOnlyList<DiscordBan>> |
GetGuildChannelsAsync(UInt64)
Gets channels from a guild
Declaration
public Task<IReadOnlyList<DiscordChannel>> GetGuildChannelsAsync(ulong guild_id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | guild_id | Guild id |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<IReadOnlyList<DiscordChannel>> |
GetGuildIntegrationsAsync(UInt64)
Gets guild integrations
Declaration
public Task<IReadOnlyList<DiscordIntegration>> GetGuildIntegrationsAsync(ulong guild_id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | guild_id | Guild id |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<IReadOnlyList<DiscordIntegration>> |
GetGuildInvitesAsync(UInt64)
Get a guild's invites
Declaration
public Task<IReadOnlyList<DiscordInvite>> GetGuildInvitesAsync(ulong guild_id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | guild_id | Guild id |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<IReadOnlyList<DiscordInvite>> |
GetGuildMemberAsync(UInt64, UInt64)
Gets guild member
Declaration
public Task<DiscordMember> GetGuildMemberAsync(ulong guild_id, ulong member_id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | guild_id | Guild id |
System.UInt64 | member_id | Member id |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordMember> |
GetGuildMembershipScreeningFormAsync(UInt64)
Gets a guild's membership screening form.
Declaration
public Task<DiscordGuildMembershipScreening> GetGuildMembershipScreeningFormAsync(ulong guild_id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | guild_id | Guild id |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordGuildMembershipScreening> | The guild's membership screening form. |
GetGuildPruneCountAsync(UInt64, Int32, IEnumerable<UInt64>)
Get a guild's prune count.
Declaration
public Task<int> GetGuildPruneCountAsync(ulong guild_id, int days, IEnumerable<ulong> include_roles)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | guild_id | Guild id |
System.Int32 | days | Days to check for |
IEnumerable<System.UInt64> | include_roles | The roles to be included in the prune. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Int32> |
GetGuildRolesAsync(UInt64)
Gets roles
Declaration
public Task<IReadOnlyList<DiscordRole>> GetGuildRolesAsync(ulong guild_id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | guild_id | Guild id |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<IReadOnlyList<DiscordRole>> |
GetGuildTemplatesAsync(UInt64)
Gets a guild's templates.
Declaration
public Task<IReadOnlyList<DiscordGuildTemplate>> GetGuildTemplatesAsync(ulong guild_id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | guild_id | Guild id |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<IReadOnlyList<DiscordGuildTemplate>> | All of the guild's templates. |
GetGuildVoiceRegionsAsync(UInt64)
Get a guild's voice region
Declaration
public Task<IReadOnlyList<DiscordVoiceRegion>> GetGuildVoiceRegionsAsync(ulong guild_id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | guild_id | Guild id |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<IReadOnlyList<DiscordVoiceRegion>> |
GetGuildWebhooksAsync(UInt64)
Gets all webhooks from a guild
Declaration
public Task<IReadOnlyList<DiscordWebhook>> GetGuildWebhooksAsync(ulong guild_id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | guild_id | Guild id |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<IReadOnlyList<DiscordWebhook>> |
GetGuildWidgetAsync(UInt64)
Gets a guild's widget
Declaration
public Task<DiscordWidget> GetGuildWidgetAsync(ulong guild_id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | guild_id | Guild id |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordWidget> |
GetGuildWidgetSettingsAsync(UInt64)
Gets a guild's widget settings
Declaration
public Task<DiscordWidgetSettings> GetGuildWidgetSettingsAsync(ulong guild_id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | guild_id | Guild id |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordWidgetSettings> |
GetInvite(String, Nullable<Boolean>)
Gets an invite.
Declaration
public Task<DiscordInvite> GetInvite(string invite_code, bool? withCounts = default(bool? ))
Parameters
Type | Name | Description |
---|---|---|
System.String | invite_code | The invite code. |
System.Nullable<System.Boolean> | withCounts | Whether to include presence and total member counts in the returned invite. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordInvite> |
GetMessageAsync(UInt64, UInt64)
Gets message in a channel
Declaration
public Task<DiscordMessage> GetMessageAsync(ulong channel_id, ulong message_id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | channel_id | Channel id |
System.UInt64 | message_id | Message id |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordMessage> |
GetPinnedMessagesAsync(UInt64)
Gets pinned messages
Declaration
public Task<IReadOnlyList<DiscordMessage>> GetPinnedMessagesAsync(ulong channel_id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | channel_id | Channel id |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<IReadOnlyList<DiscordMessage>> |
GetReactionsAsync(UInt64, UInt64, DiscordEmoji, Nullable<UInt64>, Int32)
Gets all users that reacted with a specific emoji to a message
Declaration
public Task<IReadOnlyList<DiscordUser>> GetReactionsAsync(ulong channel_id, ulong message_id, DiscordEmoji emoji, ulong? after_id = default(ulong? ), int limit = 25)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | channel_id | Channel id |
System.UInt64 | message_id | Message id |
DiscordEmoji | emoji | Emoji to check for |
System.Nullable<System.UInt64> | after_id | Whether to search for reactions after this message id. |
System.Int32 | limit | The maximum amount of reactions to fetch. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<IReadOnlyList<DiscordUser>> |
GetReactionsAsync(UInt64, UInt64, String, Nullable<UInt64>, Int32)
Gets all users that reacted with a specific emoji to a message
Declaration
public Task<IReadOnlyList<DiscordUser>> GetReactionsAsync(ulong channel_id, ulong message_id, string emoji, ulong? after_id = default(ulong? ), int limit = 25)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | channel_id | Channel id |
System.UInt64 | message_id | Message id |
System.String | emoji | Emoji to check for |
System.Nullable<System.UInt64> | after_id | Whether to search for reactions after this message id. |
System.Int32 | limit | The maximum amount of reactions to fetch. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<IReadOnlyList<DiscordUser>> |
GetTemplateAsync(String)
Gets a guild template by the code.
Declaration
public Task<DiscordGuildTemplate> GetTemplateAsync(string code)
Parameters
Type | Name | Description |
---|---|---|
System.String | code | The code of the template. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordGuildTemplate> | The guild template for the code. |
GetUserAsync(UInt64)
Gets user object
Declaration
public Task<DiscordUser> GetUserAsync(ulong user)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | user | User id |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordUser> |
GetUsersConnectionsAsync()
Gets current user's connections
Declaration
public Task<IReadOnlyList<DiscordConnection>> GetUsersConnectionsAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<IReadOnlyList<DiscordConnection>> |
GetWebhookAsync(UInt64)
Gets a webhook
Declaration
public Task<DiscordWebhook> GetWebhookAsync(ulong webhook_id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | webhook_id | Webhook id |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordWebhook> |
GetWebhookWithTokenAsync(UInt64, String)
Gets a webhook with its token (when user is not in said guild)
Declaration
public Task<DiscordWebhook> GetWebhookWithTokenAsync(ulong webhook_id, string webhook_token)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | webhook_id | Webhook id |
System.String | webhook_token | Webhook token |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordWebhook> |
GroupDmAddRecipientAsync(UInt64, UInt64, String, String)
Adds a member to a group DM
Declaration
public Task GroupDmAddRecipientAsync(ulong channel_id, ulong user_id, string access_token, string nickname)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | channel_id | Channel id |
System.UInt64 | user_id | User id |
System.String | access_token | User's access token |
System.String | nickname | Nickname for user |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
GroupDmRemoveRecipientAsync(UInt64, UInt64)
Removes a member from a group DM
Declaration
public Task GroupDmRemoveRecipientAsync(ulong channel_id, ulong user_id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | channel_id | Channel id |
System.UInt64 | user_id | User id |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
InitializeCacheAsync()
Initializes cache
Declaration
public Task InitializeCacheAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
JoinGroupDmAsync(UInt64, String)
Joins a group DM
Declaration
public Task JoinGroupDmAsync(ulong channel_id, string nickname)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | channel_id | Channel id |
System.String | nickname | Dm nickname |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
LeaveGroupDmAsync(UInt64)
Leaves a group DM
Declaration
public Task LeaveGroupDmAsync(ulong channel_id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | channel_id | Channel id |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
LeaveGuildAsync(UInt64)
Leaves a guild
Declaration
public Task LeaveGuildAsync(ulong guild_id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | guild_id | Guild id |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
ListGuildMembersAsync(UInt64, Nullable<Int32>, Nullable<UInt64>)
Gets all guild members
Declaration
public Task<IReadOnlyList<DiscordMember>> ListGuildMembersAsync(ulong guild_id, int? limit, ulong? after)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | guild_id | Guild id |
System.Nullable<System.Int32> | limit | Member download limit |
System.Nullable<System.UInt64> | after | Gets members after this ID |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<IReadOnlyList<DiscordMember>> |
ModifyAsync(UInt64, UInt64, Action<MemberEditModel>)
Modifies a member
Declaration
public Task ModifyAsync(ulong member_id, ulong guild_id, Action<MemberEditModel> action)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | member_id | Member id |
System.UInt64 | guild_id | Guild id |
Action<MemberEditModel> | action | Modifications |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
ModifyChannelAsync(UInt64, Action<ChannelEditModel>)
Modifies a channel
Declaration
public Task ModifyChannelAsync(ulong channelId, Action<ChannelEditModel> action)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | channelId | Channel id |
Action<ChannelEditModel> | action | Channel modifications |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
ModifyChannelAsync(UInt64, String, Nullable<Int32>, Optional<String>, Nullable<Boolean>, Optional<Nullable<UInt64>>, Nullable<Int32>, Nullable<Int32>, Optional<Nullable<Int32>>, String)
Modifies a channel
Declaration
public Task ModifyChannelAsync(ulong id, string name, int? position, Optional<string> topic, bool? nsfw, Optional<ulong?> parent, int? bitrate, int? userLimit, Optional<int?> perUserRateLimit, string reason)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | id | Channel id |
System.String | name | New channel name |
System.Nullable<System.Int32> | position | New channel position |
Optional<System.String> | topic | New channel topic |
System.Nullable<System.Boolean> | nsfw | Whether this channel should be marked as NSFW |
Optional<System.Nullable<System.UInt64>> | parent | New channel parent |
System.Nullable<System.Int32> | bitrate | New voice channel bitrate |
System.Nullable<System.Int32> | userLimit | New voice channel user limit |
Optional<System.Nullable<System.Int32>> | perUserRateLimit | Slow mode timeout for users. |
System.String | reason | Reason why this channel was modified |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
ModifyCurrentMemberNicknameAsync(UInt64, String, String)
Changes current user's nickname
Declaration
public Task ModifyCurrentMemberNicknameAsync(ulong guild_id, string nick, string reason)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | guild_id | Guild id |
System.String | nick | Nickname |
System.String | reason | Reason why you set it to this |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
ModifyCurrentUserAsync(String, Stream)
Modifies current user
Declaration
public Task<DiscordUser> ModifyCurrentUserAsync(string username = null, Stream avatar = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | username | username |
Stream | avatar | avatar |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordUser> |
ModifyCurrentUserAsync(String, String)
Modifies current user
Declaration
public Task<DiscordUser> ModifyCurrentUserAsync(string username, string base64_avatar)
Parameters
Type | Name | Description |
---|---|---|
System.String | username | New username |
System.String | base64_avatar | New avatar (base64) |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordUser> |
ModifyGuildAsync(UInt64, Action<GuildEditModel>)
Modifies a guild
Declaration
public Task<DiscordGuild> ModifyGuildAsync(ulong guild_id, Action<GuildEditModel> action)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | guild_id | Guild id |
Action<GuildEditModel> | action | Guild modifications |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordGuild> |
ModifyGuildAsync(UInt64, Optional<String>, Optional<String>, Optional<VerificationLevel>, Optional<DefaultMessageNotifications>, Optional<MfaLevel>, Optional<ExplicitContentFilter>, Optional<Nullable<UInt64>>, Optional<Int32>, Optional<String>, Optional<UInt64>, Optional<String>, Optional<Nullable<UInt64>>, String)
Modifies a guild
Declaration
public Task<DiscordGuild> ModifyGuildAsync(ulong guild_id, Optional<string> name, Optional<string> region, Optional<VerificationLevel> verification_level, Optional<DefaultMessageNotifications> default_message_notifications, Optional<MfaLevel> mfa_level, Optional<ExplicitContentFilter> explicit_content_filter, Optional<ulong?> afk_channel_id, Optional<int> afk_timeout, Optional<string> iconb64, Optional<ulong> owner_id, Optional<string> splashb64, Optional<ulong?> systemChannelId, string reason)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | guild_id | Guild ID |
Optional<System.String> | name | New guild Name |
Optional<System.String> | region | New guild voice region |
Optional<VerificationLevel> | verification_level | New guild verification level |
Optional<DefaultMessageNotifications> | default_message_notifications | New guild default message notification level |
Optional<MfaLevel> | mfa_level | New guild MFA level |
Optional<ExplicitContentFilter> | explicit_content_filter | New guild explicit content filter level |
Optional<System.Nullable<System.UInt64>> | afk_channel_id | New guild AFK channel id |
Optional<System.Int32> | afk_timeout | New guild AFK timeout in seconds |
Optional<System.String> | iconb64 | New guild icon (base64) |
Optional<System.UInt64> | owner_id | New guild owner id |
Optional<System.String> | splashb64 | New guild spalsh (base64) |
Optional<System.Nullable<System.UInt64>> | systemChannelId | New guild system channel id |
System.String | reason | Modify reason |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordGuild> |
ModifyGuildIntegrationAsync(UInt64, UInt64, Int32, Int32, Boolean)
Modifies a guild integration
Declaration
public Task<DiscordIntegration> ModifyGuildIntegrationAsync(ulong guild_id, ulong integration_id, int expire_behaviour, int expire_grace_period, bool enable_emoticons)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | guild_id | Guild id |
System.UInt64 | integration_id | Integration id |
System.Int32 | expire_behaviour | Expiration behaviour |
System.Int32 | expire_grace_period | Expiration grace period |
System.Boolean | enable_emoticons | Whether to enable emojis for this integration |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordIntegration> |
ModifyGuildMemberAsync(UInt64, UInt64, Optional<String>, Optional<IEnumerable<UInt64>>, Optional<Boolean>, Optional<Boolean>, Optional<Nullable<UInt64>>, String)
Modifies guild member
Declaration
public Task ModifyGuildMemberAsync(ulong guild_id, ulong user_id, Optional<string> nick, Optional<IEnumerable<ulong>> role_ids, Optional<bool> mute, Optional<bool> deaf, Optional<ulong?> voice_channel_id, string reason)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | guild_id | Guild id |
System.UInt64 | user_id | User id |
Optional<System.String> | nick | New nickname |
Optional<IEnumerable<System.UInt64>> | role_ids | New roles |
Optional<System.Boolean> | mute | Whether this user should be muted |
Optional<System.Boolean> | deaf | Whether this user should be deafened |
Optional<System.Nullable<System.UInt64>> | voice_channel_id | Voice channel to move this user to |
System.String | reason | Reason this user was modified |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
ModifyGuildMembershipScreeningFormAsync(UInt64, Action<MembershipScreeningEditModel>)
Modifies a guild's membership screening form.
Declaration
public Task<DiscordGuildMembershipScreening> ModifyGuildMembershipScreeningFormAsync(ulong guild_id, Action<MembershipScreeningEditModel> action)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | guild_id | Guild id |
Action<MembershipScreeningEditModel> | action | Action to perform |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordGuildMembershipScreening> | The modified screening form. |
ModifyGuildRoleAsync(UInt64, UInt64, Action<RoleEditModel>)
Modifies a role
Declaration
public Task ModifyGuildRoleAsync(ulong role_id, ulong guild_id, Action<RoleEditModel> action)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | role_id | Role id |
System.UInt64 | guild_id | Guild id |
Action<RoleEditModel> | action | Modifications |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
ModifyGuildRoleAsync(UInt64, UInt64, String, Nullable<Permissions>, Nullable<DiscordColor>, Nullable<Boolean>, Nullable<Boolean>, String)
Modifies a role
Declaration
public Task<DiscordRole> ModifyGuildRoleAsync(ulong guild_id, ulong role_id, string name, Permissions? permissions, DiscordColor? color, bool? hoist, bool? mentionable, string reason)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | guild_id | Guild id |
System.UInt64 | role_id | Role id |
System.String | name | New role name |
System.Nullable<Permissions> | permissions | New role permissions |
System.Nullable<DiscordColor> | color | New role color |
System.Nullable<System.Boolean> | hoist | Whether this role should be hoisted |
System.Nullable<System.Boolean> | mentionable | Whether this role should be mentionable |
System.String | reason | Why this role was modified |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordRole> |
ModifyGuildTemplateAsync(UInt64, String, String, String)
Modifies the template's metadata.
Declaration
public Task<DiscordGuildTemplate> ModifyGuildTemplateAsync(ulong guild_id, string code, string name = null, string description = null)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | guild_id | Guild id |
System.String | code | The template's code. |
System.String | name | Name of the template. |
System.String | description | Description of the template. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordGuildTemplate> | The template modified. |
ModifyGuildWidgetSettingsAsync(UInt64, Nullable<Boolean>, Nullable<UInt64>, String)
Modifies a guild's widget settings
Declaration
public Task<DiscordWidgetSettings> ModifyGuildWidgetSettingsAsync(ulong guild_id, bool? enabled = default(bool? ), ulong? channel_id = default(ulong? ), string reason = null)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | guild_id | Guild id |
System.Nullable<System.Boolean> | enabled | If the widget is enabled or not |
System.Nullable<System.UInt64> | channel_id | Widget channel id |
System.String | reason | Reason the widget settings were modified |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordWidgetSettings> |
ModifyWebhookAsync(UInt64, String, Stream, String, String)
Modifies a webhook (when user is not in said guild)
Declaration
public Task<DiscordWebhook> ModifyWebhookAsync(ulong webhook_id, string name, Stream avatar, string webhook_token, string reason)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | webhook_id | Webhook id |
System.String | name | New webhook name |
Stream | avatar | New webhook avatar |
System.String | webhook_token | Webhook token |
System.String | reason | Reason why this webhook was modified |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordWebhook> |
ModifyWebhookAsync(UInt64, String, String, String, String)
Modifies a webhook (when user is not in said guild)
Declaration
public Task<DiscordWebhook> ModifyWebhookAsync(ulong webhook_id, string name, string base64_avatar, string webhook_token, string reason)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | webhook_id | Webhook id |
System.String | name | New webhook name |
System.String | base64_avatar | New webhook avatar (base64) |
System.String | webhook_token | Webhook token |
System.String | reason | Reason why this webhook was modified |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordWebhook> |
ModifyWebhookAsync(UInt64, UInt64, String, Stream, String)
Modifies a webhook
Declaration
public Task<DiscordWebhook> ModifyWebhookAsync(ulong webhook_id, ulong channelId, string name, Stream avatar, string reason)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | webhook_id | Webhook id |
System.UInt64 | channelId | The new channel id the webhook should be moved to. |
System.String | name | New webhook name |
Stream | avatar | New webhook avatar |
System.String | reason | Reason why this webhook was modified |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordWebhook> |
ModifyWebhookAsync(UInt64, UInt64, String, String, String)
Modifies a webhook
Declaration
public Task<DiscordWebhook> ModifyWebhookAsync(ulong webhook_id, ulong channelId, string name, string base64_avatar, string reason)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | webhook_id | Webhook id |
System.UInt64 | channelId | The new channel id the webhook should be moved to. |
System.String | name | New webhook name |
System.String | base64_avatar | New webhook avatar (base64) |
System.String | reason | Reason why this webhook was modified |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordWebhook> |
RemoveGuildBanAsync(UInt64, UInt64, String)
Removes a guild ban
Declaration
public Task RemoveGuildBanAsync(ulong guild_id, ulong user_id, string reason)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | guild_id | Guild id |
System.UInt64 | user_id | User to unban |
System.String | reason | Reason why this member was unbanned |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
RemoveGuildMemberAsync(UInt64, UInt64, String)
Removes guild member
Declaration
public Task RemoveGuildMemberAsync(ulong guild_id, ulong user_id, string reason)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | guild_id | Guild id |
System.UInt64 | user_id | User id |
System.String | reason | Why this user was removed |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
RemoveGuildMemberRoleAsync(UInt64, UInt64, UInt64, String)
Remove role from member
Declaration
public Task RemoveGuildMemberRoleAsync(ulong guild_id, ulong user_id, ulong role_id, string reason)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | guild_id | Guild id |
System.UInt64 | user_id | User id |
System.UInt64 | role_id | Role id |
System.String | reason | Reason this role gets removed |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
SyncGuildIntegrationAsync(UInt64, UInt64)
Syncs guild integration
Declaration
public Task SyncGuildIntegrationAsync(ulong guild_id, ulong integration_id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | guild_id | Guild id |
System.UInt64 | integration_id | Integration id |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
SyncGuildTemplateAsync(UInt64, String)
Syncs the template to the current guild's state.
Declaration
public Task<DiscordGuildTemplate> SyncGuildTemplateAsync(ulong guild_id, string code)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | guild_id | Guild id |
System.String | code | The code of the template to sync. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordGuildTemplate> | The template synced. |
TriggerTypingAsync(UInt64)
Send a typing indicator to a channel
Declaration
public Task TriggerTypingAsync(ulong channel_id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | channel_id | Channel id |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
UnpinMessageAsync(UInt64, UInt64)
Unpuns a message
Declaration
public Task UnpinMessageAsync(ulong channel_id, ulong message_id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | channel_id | Channel id |
System.UInt64 | message_id | Message id |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
UpdateChannelPositionAsync(UInt64, UInt64, Int32, String)
Updates a channel's position
Declaration
public Task UpdateChannelPositionAsync(ulong guild_id, ulong channel_id, int position, string reason)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | guild_id | Guild id |
System.UInt64 | channel_id | Channel id |
System.Int32 | position | Channel position |
System.String | reason | Reason this position was modified |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
UpdateRolePositionAsync(UInt64, UInt64, Int32, String)
Updates a role's position
Declaration
public Task UpdateRolePositionAsync(ulong guild_id, ulong role_id, int position, string reason = null)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | guild_id | Guild id |
System.UInt64 | role_id | Role id |
System.Int32 | position | Role position |
System.String | reason | Reason this position was modified |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |