Documentation ¶
Index ¶
- Constants
- Variables
- func NewError(rq *http.Request, rqBody []byte, rs *http.Response, rsBody []byte) error
- type Applications
- type AuditLogPage
- type AutoModeration
- type Channels
- type Check
- type Client
- type CompiledEndpoint
- type Config
- type ConfigOpt
- type Emojis
- type Endpoint
- type Error
- type Gateway
- type GuildScheduledEvents
- type GuildTemplates
- type Guilds
- type Interactions
- type Invites
- type Members
- type OAuth2
- type Page
- type RateLimiter
- type RateLimiterConfig
- type RateLimiterConfigOpt
- type RequestConfig
- type RequestOpt
- func WithCheck(check Check) RequestOpt
- func WithCtx(ctx context.Context) RequestOpt
- func WithDelay(delay time.Duration) RequestOpt
- func WithDiscordLocale(locale discord.Locale) RequestOpt
- func WithHeader(key string, value string) RequestOpt
- func WithQueryParam(param string, value any) RequestOpt
- func WithReason(reason string) RequestOpt
- func WithToken(tokenType discord.TokenType, token string) RequestOpt
- type Rest
- type StageInstances
- type Stickers
- type Threads
- type Users
- type Voice
- type Webhooks
Constants ¶
const MajorParameters = "guild.id:channel.id:webhook.id:interaction.token"
MajorParameters is a list of url parameters which decide in which bucket a route belongs (https://discord.com/developers/docs/topics/rate-limits#rate-limits)
Variables ¶
var ( // APIVersion is the Discord API version DisGo should use APIVersion = 10 // API is the base path of the Discord API API = fmt.Sprintf("https://discord.com/api/v%d", APIVersion) )
var ( GetGateway = NewNoBotAuthEndpoint(http.MethodGet, "/gateway") GetGatewayBot = NewEndpoint(http.MethodGet, "/gateway/bot") GetVoiceRegions = NewNoBotAuthEndpoint(http.MethodGet, "/voice/regions") )
Misc
var ( GetBotApplicationInfo = NewEndpoint(http.MethodGet, "/oauth2/applications/@me") GetAuthorizationInfo = NewEndpoint(http.MethodGet, "/oauth2/@me") Token = NewEndpoint(http.MethodPost, "/oauth2/token") )
OAuth2
var ( GetUser = NewEndpoint(http.MethodGet, "/users/{user.id}") GetCurrentUser = NewEndpoint(http.MethodGet, "/users/@me") GetCurrentMember = NewEndpoint(http.MethodGet, "/users/@me/guilds/{guild.id}/member") UpdateSelfUser = NewEndpoint(http.MethodPatch, "/users/@me") GetCurrentUserConnections = NewNoBotAuthEndpoint(http.MethodGet, "/users/@me/connections") GetCurrentUserGuilds = NewNoBotAuthEndpoint(http.MethodGet, "/users/@me/guilds") LeaveGuild = NewEndpoint(http.MethodDelete, "/users/@me/guilds/{guild.id}") GetDMChannels = NewEndpoint(http.MethodGet, "/users/@me/channels") CreateDMChannel = NewEndpoint(http.MethodPost, "/users/@me/channels") )
Users
var ( GetGuild = NewEndpoint(http.MethodGet, "/guilds/{guild.id}") GetGuildPreview = NewEndpoint(http.MethodGet, "/guilds/{guild.id}/preview") CreateGuild = NewEndpoint(http.MethodPost, "/guilds") UpdateGuild = NewEndpoint(http.MethodPatch, "/guilds/{guild.id}") DeleteGuild = NewEndpoint(http.MethodDelete, "/guilds/{guild.id}") GetGuildVanityURL = NewEndpoint(http.MethodGet, "/guilds/{guild.id}/vanity-url") CreateGuildChannel = NewEndpoint(http.MethodPost, "/guilds/{guild.id}/channels") GetGuildChannels = NewEndpoint(http.MethodGet, "/guilds/{guild.id}/channels") UpdateChannelPositions = NewEndpoint(http.MethodPatch, "/guilds/{guild.id}/channels") GetBans = NewEndpoint(http.MethodGet, "/guilds/{guild.id}/bans") GetBan = NewEndpoint(http.MethodGet, "/guilds/{guild.id}/bans/{user.id}") AddBan = NewEndpoint(http.MethodPut, "/guilds/{guild.id}/bans/{user.id}") DeleteBan = NewEndpoint(http.MethodDelete, "/guilds/{guild.id}/bans/{user.id}") GetMember = NewEndpoint(http.MethodGet, "/guilds/{guild.id}/members/{user.id}") GetMembers = NewEndpoint(http.MethodGet, "/guilds/{guild.id}/members") SearchMembers = NewEndpoint(http.MethodGet, "/guilds/{guild.id}/members/search") AddMember = NewEndpoint(http.MethodPut, "/guilds/{guild.id}/members/{user.id}") UpdateMember = NewEndpoint(http.MethodPatch, "/guilds/{guild.id}/members/{user.id}") RemoveMember = NewEndpoint(http.MethodDelete, "/guilds/{guild.id}/members/{user.id}") AddMemberRole = NewEndpoint(http.MethodPut, "/guilds/{guild.id}/members/{user.id}/roles/{role.id}") RemoveMemberRole = NewEndpoint(http.MethodDelete, "/guilds/{guild.id}/members/{user.id}/roles/{role.id}") UpdateCurrentMember = NewEndpoint(http.MethodPatch, "/guilds/{guild.id}/members/@me") GetPruneMembersCount = NewEndpoint(http.MethodGet, "/guilds/{guild.id}/prune") PruneMembers = NewEndpoint(http.MethodPost, "/guilds/{guild.id}/prune") GetGuildWebhooks = NewEndpoint(http.MethodGet, "/guilds/{guild.id}/webhooks") GetAuditLogs = NewEndpoint(http.MethodGet, "/guilds/{guild.id}/audit-logs") GetGuildVoiceRegions = NewEndpoint(http.MethodGet, "/guilds/{guild.id}/regions") UpdateCurrentUserVoiceState = NewEndpoint(http.MethodPatch, "/guilds/{guild.id}/voice-states/@me") UpdateUserVoiceState = NewEndpoint(http.MethodPatch, "/guilds/{guild.id}/voice-states/{user.id}") )
Guilds
var ( GetAutoModerationRules = NewEndpoint(http.MethodGet, "/guilds/{guild.id}/auto-moderation/rules") GetAutoModerationRule = NewEndpoint(http.MethodGet, "/guilds/{guild.id}/auto-moderation/rules/{auto_moderation_rule.id}") CreateAutoModerationRule = NewEndpoint(http.MethodPost, "/guilds/{guild.id}/auto-moderation/rules") UpdateAutoModerationRule = NewEndpoint(http.MethodPatch, "/guilds/{guild.id}/auto-moderation/rules/{auto_moderation_rule.id}") DeleteAutoModerationRule = NewEndpoint(http.MethodDelete, "/guilds/{guild.id}/auto-moderation/rules/{auto_moderation_rule.id}") )
AutoModeration
var ( GetIntegrations = NewEndpoint(http.MethodGet, "/guilds/{guild.id}/integrations") CreateIntegration = NewEndpoint(http.MethodPost, "/guilds/{guild.id}/integrations") UpdateIntegration = NewEndpoint(http.MethodPatch, "/guilds/{guild.id}/integrations/{integration.id}") DeleteIntegration = NewEndpoint(http.MethodDelete, "/guilds/{guild.id}/integrations/{integration.id}") SyncIntegration = NewEndpoint(http.MethodPost, "/guilds/{guild.id}/integrations/{integration.id}/sync") )
GuildIntegrations
var ( GetGuildTemplate = NewEndpoint(http.MethodGet, "/guilds/templates/{template.code}") GetGuildTemplates = NewEndpoint(http.MethodGet, "/guilds/{guild.id}/templates") CreateGuildTemplate = NewEndpoint(http.MethodPost, "/guilds/{guild.id}/templates") SyncGuildTemplate = NewEndpoint(http.MethodPut, "/guilds/{guild.id}/templates/{template.code}") UpdateGuildTemplate = NewEndpoint(http.MethodPatch, "/guilds/{guild.id}/templates/{template.code}") DeleteGuildTemplate = NewEndpoint(http.MethodDelete, "/guilds/{guild.id}/templates/{template.code}") CreateGuildFromTemplate = NewEndpoint(http.MethodPost, "/guilds/templates/{template.code}") )
GuildTemplates
var ( GetGuildScheduledEvents = NewEndpoint(http.MethodGet, "/guilds/{guild.id}/scheduled-events") GetGuildScheduledEvent = NewEndpoint(http.MethodGet, "/guilds/{guild.id}/scheduled-events/{guild_scheduled_event.id}") CreateGuildScheduledEvent = NewEndpoint(http.MethodPost, "/guilds/{guild.id}/scheduled-events") UpdateGuildScheduledEvent = NewEndpoint(http.MethodPatch, "/guilds/{guild.id}/scheduled-events/{guild_scheduled_event.id}") DeleteGuildScheduledEvent = NewEndpoint(http.MethodDelete, "/guilds/{guild.id}/scheduled-events/{guild_scheduled_event.id}") GetGuildScheduledEventUsers = NewEndpoint(http.MethodGet, "/guilds/{guild.id}/scheduled-events/{guild_scheduled_event.id}/users") )
GuildScheduledEvents
var ( GetStageInstance = NewEndpoint(http.MethodGet, "/stage-instances/{channel.id}") CreateStageInstance = NewEndpoint(http.MethodPost, "/stage-instances") UpdateStageInstance = NewEndpoint(http.MethodPatch, "/stage-instances/{channel.id}") DeleteStageInstance = NewEndpoint(http.MethodDelete, "/stage-instances/{channel.id}") )
StageInstance
var ( GetRoles = NewEndpoint(http.MethodGet, "/guilds/{guild.id}/roles") GetRole = NewEndpoint(http.MethodGet, "/guilds/{guild.id}/roles/{role.id}") CreateRole = NewEndpoint(http.MethodPost, "/guilds/{guild.id}/roles") UpdateRole = NewEndpoint(http.MethodPatch, "/guilds/{guild.id}/roles/{role.id}") UpdateRolePositions = NewEndpoint(http.MethodPatch, "/guilds/{guild.id}/roles") DeleteRole = NewEndpoint(http.MethodDelete, "/guilds/{guild.id}/roles/{role.id}") )
Roles
var ( GetChannel = NewEndpoint(http.MethodGet, "/channels/{channel.id}") UpdateChannel = NewEndpoint(http.MethodPatch, "/channels/{channel.id}") DeleteChannel = NewEndpoint(http.MethodDelete, "/channels/{channel.id}") GetChannelWebhooks = NewEndpoint(http.MethodGet, "/channels/{channel.id}/webhooks") CreateWebhook = NewEndpoint(http.MethodPost, "/channels/{channel.id}/webhooks") GetPermissionOverwrites = NewEndpoint(http.MethodGet, "/channels/{channel.id}/permissions") GetPermissionOverwrite = NewEndpoint(http.MethodGet, "/channels/{channel.id}/permissions/{overwrite.id}") UpdatePermissionOverwrite = NewEndpoint(http.MethodPut, "/channels/{channel.id}/permissions/{overwrite.id}") DeletePermissionOverwrite = NewEndpoint(http.MethodDelete, "/channels/{channel.id}/permissions/{overwrite.id}") SendTyping = NewEndpoint(http.MethodPost, "/channels/{channel.id}/typing") FollowChannel = NewEndpoint(http.MethodPost, "/channels/{channel.id}/followers") )
Channels
var ( CreateThreadWithMessage = NewEndpoint(http.MethodPost, "/channels/{channel.id}/messages/{message.id}/threads") CreateThread = NewEndpoint(http.MethodPost, "/channels/{channel.id}/threads") JoinThread = NewEndpoint(http.MethodPut, "/channels/{channel.id}/thread-members/@me") LeaveThread = NewEndpoint(http.MethodDelete, "/channels/{channel.id}/thread-members/@me") AddThreadMember = NewEndpoint(http.MethodPut, "/channels/{channel.id}/thread-members/{user.id}") RemoveThreadMember = NewEndpoint(http.MethodDelete, "/channels/{channel.id}/thread-members/{user.id}") GetThreadMember = NewEndpoint(http.MethodGet, "/channels/{channel.id}/thread-members/{user.id}") GetThreadMembers = NewEndpoint(http.MethodGet, "/channels/{channel.id}/thread-members") GetArchivedPublicThreads = NewEndpoint(http.MethodGet, "/channels/{channel.id}/threads/archived/public") GetArchivedPrivateThreads = NewEndpoint(http.MethodGet, "/channels/{channel.id}/threads/archived/private") GetJoinedAchievedPrivateThreads = NewEndpoint(http.MethodGet, "/channels/{channel.id}/users/@me/threads/archived/private") )
Threads
var ( GetMessages = NewEndpoint(http.MethodGet, "/channels/{channel.id}/messages") GetMessage = NewEndpoint(http.MethodGet, "/channels/{channel.id}/messages/{message.id}") CreateMessage = NewEndpoint(http.MethodPost, "/channels/{channel.id}/messages") UpdateMessage = NewEndpoint(http.MethodPatch, "/channels/{channel.id}/messages/{message.id}") DeleteMessage = NewEndpoint(http.MethodDelete, "/channels/{channel.id}/messages/{message.id}") BulkDeleteMessages = NewEndpoint(http.MethodPost, "/channels/{channel.id}/messages/bulk-delete") GetPinnedMessages = NewEndpoint(http.MethodGet, "/channels/{channel.id}/pins") PinMessage = NewEndpoint(http.MethodPut, "/channels/{channel.id}/pins/{message.id}") UnpinMessage = NewEndpoint(http.MethodDelete, "/channels/{channel.id}/pins/{message.id}") CrosspostMessage = NewEndpoint(http.MethodPost, "/channels/{channel.id}/messages/{message.id}/crosspost") GetReactions = NewEndpoint(http.MethodGet, "/channels/{channel.id}/messages/{message.id}/reactions/{emoji}") AddReaction = NewEndpoint(http.MethodPut, "/channels/{channel.id}/messages/{message.id}/reactions/{emoji}/@me") RemoveOwnReaction = NewEndpoint(http.MethodDelete, "/channels/{channel.id}/messages/{message.id}/reactions/{emoji}/@me") RemoveUserReaction = NewEndpoint(http.MethodDelete, "/channels/{channel.id}/messages/{message.id}/reactions/{emoji}/{user.id}") RemoveAllReactions = NewEndpoint(http.MethodDelete, "/channels/{channel.id}/messages/{message.id}/reactions") RemoveAllReactionsForEmoji = NewEndpoint(http.MethodDelete, "/channels/{channel.id}/messages/{message.id}/reactions/{emoji}") )
Messages
var ( GetEmojis = NewEndpoint(http.MethodGet, "/guilds/{guild.id}/emojis") GetEmoji = NewEndpoint(http.MethodGet, "/guilds/{guild.id}/emojis/{emoji.id}") CreateEmoji = NewEndpoint(http.MethodPost, "/guilds/{guild.id}/emojis") UpdateEmoji = NewEndpoint(http.MethodPatch, "/guilds/{guild.id}/emojis/{emote.id}") DeleteEmoji = NewEndpoint(http.MethodDelete, "/guilds/{guild.id}/emojis/{emote.id}") )
Emojis
var ( GetNitroStickerPacks = NewEndpoint(http.MethodGet, "/sticker-packs") GetSticker = NewEndpoint(http.MethodGet, "/stickers/{sticker.id}") GetGuildStickers = NewEndpoint(http.MethodGet, "/guilds/{guild.id}/stickers") CreateGuildSticker = NewEndpoint(http.MethodPost, "/guilds/{guild.id}/stickers") UpdateGuildSticker = NewEndpoint(http.MethodPatch, "/guilds/{guild.id}/stickers/{sticker.id}") DeleteGuildSticker = NewEndpoint(http.MethodDelete, "/guilds/{guild.id}/stickers/{sticker.id}") )
Stickers
var ( GetWebhook = NewEndpoint(http.MethodGet, "/webhooks/{webhook.id}") UpdateWebhook = NewEndpoint(http.MethodPatch, "/webhooks/{webhook.id}") DeleteWebhook = NewEndpoint(http.MethodDelete, "/webhooks/{webhook.id}") GetWebhookWithToken = NewNoBotAuthEndpoint(http.MethodGet, "/webhooks/{webhook.id}/{webhook.token}") UpdateWebhookWithToken = NewNoBotAuthEndpoint(http.MethodPatch, "/webhooks/{webhook.id}/{webhook.token}") DeleteWebhookWithToken = NewNoBotAuthEndpoint(http.MethodDelete, "/webhooks/{webhook.id}/{webhook.token}") CreateWebhookMessage = NewNoBotAuthEndpoint(http.MethodPost, "/webhooks/{webhook.id}/{webhook.token}") CreateWebhookMessageSlack = NewNoBotAuthEndpoint(http.MethodPost, "/webhooks/{webhook.id}/{webhook.token}/slack") CreateWebhookMessageGitHub = NewNoBotAuthEndpoint(http.MethodPost, "/webhooks/{webhook.id}/{webhook.token}/github") UpdateWebhookMessage = NewNoBotAuthEndpoint(http.MethodPatch, "/webhooks/{webhook.id}/{webhook.token}/messages/{message.id}") DeleteWebhookMessage = NewNoBotAuthEndpoint(http.MethodDelete, "/webhooks/{webhook.id}/{webhook.token}/messages/{message.id}") )
Webhooks
var ( GetInvite = NewEndpoint(http.MethodGet, "/invites/{code}") CreateInvite = NewEndpoint(http.MethodPost, "/channels/{channel.id}/invites") DeleteInvite = NewEndpoint(http.MethodDelete, "/invites/{code}") GetGuildInvites = NewEndpoint(http.MethodGet, "/guilds/{guild.id}/invites") GetChannelInvites = NewEndpoint(http.MethodGet, "/channels/{channel.id}/invites") )
Invites
var ( GetGlobalCommands = NewEndpoint(http.MethodGet, "/applications/{application.id}/commands") GetGlobalCommand = NewEndpoint(http.MethodGet, "/applications/{application.id}/command/{command.id}") CreateGlobalCommand = NewEndpoint(http.MethodPost, "/applications/{application.id}/commands") SetGlobalCommands = NewEndpoint(http.MethodPut, "/applications/{application.id}/commands") UpdateGlobalCommand = NewEndpoint(http.MethodPatch, "/applications/{application.id}/commands/{command.id}") DeleteGlobalCommand = NewEndpoint(http.MethodDelete, "/applications/{application.id}/commands/{command.id}") GetGuildCommands = NewEndpoint(http.MethodGet, "/applications/{application.id}/guilds/{guild.id}/commands") GetGuildCommand = NewEndpoint(http.MethodGet, "/applications/{application.id}/guilds/{guild.id}/command/{command.id}") CreateGuildCommand = NewEndpoint(http.MethodPost, "/applications/{application.id}/guilds/{guild.id}/commands") SetGuildCommands = NewEndpoint(http.MethodPut, "/applications/{application.id}/guilds/{guild.id}/commands") UpdateGuildCommand = NewEndpoint(http.MethodPatch, "/applications/{application.id}/guilds/{guild.id}/commands/{command.id}") DeleteGuildCommand = NewEndpoint(http.MethodDelete, "/applications/{application.id}/guilds/{guild.id}/commands/{command.id}") GetGuildCommandsPermissions = NewEndpoint(http.MethodGet, "/applications/{application.id}/guilds/{guild.id}/commands/permissions") GetGuildCommandPermissions = NewEndpoint(http.MethodGet, "/applications/{application.id}/guilds/{guild.id}/commands/{command.id}/permissions") SetGuildCommandPermissions = NewEndpoint(http.MethodPut, "/applications/{application.id}/guilds/{guild.id}/commands/{command.id}/permissions") GetInteractionResponse = NewNoBotAuthEndpoint(http.MethodGet, "/webhooks/{application.id}/{interaction.token}/messages/@original") CreateInteractionResponse = NewNoBotAuthEndpoint(http.MethodPost, "/interactions/{interaction.id}/{interaction.token}/callback") UpdateInteractionResponse = NewNoBotAuthEndpoint(http.MethodPatch, "/webhooks/{application.id}/{interaction.token}/messages/@original") DeleteInteractionResponse = NewNoBotAuthEndpoint(http.MethodDelete, "/webhooks/{application.id}/{interaction.token}/messages/@original") GetFollowupMessage = NewNoBotAuthEndpoint(http.MethodGet, "/webhooks/{application.id}/{interaction.token}") CreateFollowupMessage = NewNoBotAuthEndpoint(http.MethodPost, "/webhooks/{application.id}/{interaction.token}") UpdateFollowupMessage = NewNoBotAuthEndpoint(http.MethodPatch, "/webhooks/{application.id}/{interaction.token}/messages/{message.id}") DeleteFollowupMessage = NewNoBotAuthEndpoint(http.MethodDelete, "/webhooks/{application.id}/{interaction.token}/messages/{message.id}") )
Interactions
var ErrNoMorePages = errors.New("no more pages")
Functions ¶
Types ¶
type Applications ¶
type Applications interface { GetGlobalCommands(applicationID snowflake.ID, withLocalizations bool, opts ...RequestOpt) ([]discord.ApplicationCommand, error) GetGlobalCommand(applicationID snowflake.ID, commandID snowflake.ID, opts ...RequestOpt) (discord.ApplicationCommand, error) CreateGlobalCommand(applicationID snowflake.ID, commandCreate discord.ApplicationCommandCreate, opts ...RequestOpt) (discord.ApplicationCommand, error) SetGlobalCommands(applicationID snowflake.ID, commandCreates []discord.ApplicationCommandCreate, opts ...RequestOpt) ([]discord.ApplicationCommand, error) UpdateGlobalCommand(applicationID snowflake.ID, commandID snowflake.ID, commandUpdate discord.ApplicationCommandUpdate, opts ...RequestOpt) (discord.ApplicationCommand, error) DeleteGlobalCommand(applicationID snowflake.ID, commandID snowflake.ID, opts ...RequestOpt) error GetGuildCommands(applicationID snowflake.ID, guildID snowflake.ID, withLocalizations bool, opts ...RequestOpt) ([]discord.ApplicationCommand, error) GetGuildCommand(applicationID snowflake.ID, guildID snowflake.ID, commandID snowflake.ID, opts ...RequestOpt) (discord.ApplicationCommand, error) CreateGuildCommand(applicationID snowflake.ID, guildID snowflake.ID, command discord.ApplicationCommandCreate, opts ...RequestOpt) (discord.ApplicationCommand, error) SetGuildCommands(applicationID snowflake.ID, guildID snowflake.ID, commands []discord.ApplicationCommandCreate, opts ...RequestOpt) ([]discord.ApplicationCommand, error) UpdateGuildCommand(applicationID snowflake.ID, guildID snowflake.ID, commandID snowflake.ID, command discord.ApplicationCommandUpdate, opts ...RequestOpt) (discord.ApplicationCommand, error) DeleteGuildCommand(applicationID snowflake.ID, guildID snowflake.ID, commandID snowflake.ID, opts ...RequestOpt) error GetGuildCommandsPermissions(applicationID snowflake.ID, guildID snowflake.ID, opts ...RequestOpt) ([]discord.ApplicationCommandPermissions, error) GetGuildCommandPermissions(applicationID snowflake.ID, guildID snowflake.ID, commandID snowflake.ID, opts ...RequestOpt) (*discord.ApplicationCommandPermissions, error) }
func NewApplications ¶
func NewApplications(client Client) Applications
type AuditLogPage ¶ added in v0.13.19
type AuditLogPage struct { discord.AuditLog Err error ID snowflake.ID // contains filtered or unexported fields }
func (*AuditLogPage) Previous ¶ added in v0.13.19
func (p *AuditLogPage) Previous() bool
type AutoModeration ¶ added in v0.12.7
type AutoModeration interface { GetAutoModerationRules(guildID snowflake.ID, opts ...RequestOpt) ([]discord.AutoModerationRule, error) GetAutoModerationRule(guildID snowflake.ID, ruleID snowflake.ID, opts ...RequestOpt) (*discord.AutoModerationRule, error) CreateAutoModerationRule(guildID snowflake.ID, ruleCreate discord.AutoModerationRuleCreate, opts ...RequestOpt) (*discord.AutoModerationRule, error) UpdateAutoModerationRule(guildID snowflake.ID, ruleID snowflake.ID, ruleUpdate discord.AutoModerationRuleUpdate, opts ...RequestOpt) (*discord.AutoModerationRule, error) DeleteAutoModerationRule(guildID snowflake.ID, ruleID snowflake.ID, opts ...RequestOpt) error }
func NewAutoModeration ¶ added in v0.12.7
func NewAutoModeration(client Client) AutoModeration
type Channels ¶
type Channels interface { GetChannel(channelID snowflake.ID, opts ...RequestOpt) (discord.Channel, error) UpdateChannel(channelID snowflake.ID, channelUpdate discord.ChannelUpdate, opts ...RequestOpt) (discord.Channel, error) DeleteChannel(channelID snowflake.ID, opts ...RequestOpt) error GetWebhooks(channelID snowflake.ID, opts ...RequestOpt) ([]discord.Webhook, error) CreateWebhook(channelID snowflake.ID, webhookCreate discord.WebhookCreate, opts ...RequestOpt) (*discord.IncomingWebhook, error) GetPermissionOverwrites(channelID snowflake.ID, opts ...RequestOpt) ([]discord.PermissionOverwrite, error) GetPermissionOverwrite(channelID snowflake.ID, overwriteID snowflake.ID, opts ...RequestOpt) (*discord.PermissionOverwrite, error) UpdatePermissionOverwrite(channelID snowflake.ID, overwriteID snowflake.ID, permissionOverwrite discord.PermissionOverwriteUpdate, opts ...RequestOpt) error DeletePermissionOverwrite(channelID snowflake.ID, overwriteID snowflake.ID, opts ...RequestOpt) error SendTyping(channelID snowflake.ID, opts ...RequestOpt) error GetMessage(channelID snowflake.ID, messageID snowflake.ID, opts ...RequestOpt) (*discord.Message, error) GetMessages(channelID snowflake.ID, around snowflake.ID, before snowflake.ID, after snowflake.ID, limit int, opts ...RequestOpt) ([]discord.Message, error) GetMessagesPage(channelID snowflake.ID, startID snowflake.ID, limit int, opts ...RequestOpt) Page[discord.Message] CreateMessage(channelID snowflake.ID, messageCreate discord.MessageCreate, opts ...RequestOpt) (*discord.Message, error) UpdateMessage(channelID snowflake.ID, messageID snowflake.ID, messageUpdate discord.MessageUpdate, opts ...RequestOpt) (*discord.Message, error) DeleteMessage(channelID snowflake.ID, messageID snowflake.ID, opts ...RequestOpt) error BulkDeleteMessages(channelID snowflake.ID, messageIDs []snowflake.ID, opts ...RequestOpt) error CrosspostMessage(channelID snowflake.ID, messageID snowflake.ID, opts ...RequestOpt) (*discord.Message, error) GetReactions(channelID snowflake.ID, messageID snowflake.ID, emoji string, opts ...RequestOpt) ([]discord.User, error) AddReaction(channelID snowflake.ID, messageID snowflake.ID, emoji string, opts ...RequestOpt) error RemoveOwnReaction(channelID snowflake.ID, messageID snowflake.ID, emoji string, opts ...RequestOpt) error RemoveUserReaction(channelID snowflake.ID, messageID snowflake.ID, emoji string, userID snowflake.ID, opts ...RequestOpt) error RemoveAllReactions(channelID snowflake.ID, messageID snowflake.ID, opts ...RequestOpt) error RemoveAllReactionsForEmoji(channelID snowflake.ID, messageID snowflake.ID, emoji string, opts ...RequestOpt) error GetPinnedMessages(channelID snowflake.ID, opts ...RequestOpt) ([]discord.Message, error) PinMessage(channelID snowflake.ID, messageID snowflake.ID, opts ...RequestOpt) error UnpinMessage(channelID snowflake.ID, messageID snowflake.ID, opts ...RequestOpt) error }
func NewChannels ¶
type Check ¶
type Check func() bool
Check is a function which gets executed right before a request is made
type Client ¶
type Client interface { // HTTPClient returns the http.Client the rest client uses HTTPClient() *http.Client // RateLimiter returns the rrate.RateLimiter the rest client uses RateLimiter() RateLimiter // Close closes the rest client and awaits all pending requests to finish. You can use a cancelling context to abort the waiting Close(ctx context.Context) // Do makes a request to the given CompiledAPIRoute and marshals the given any as json and unmarshalls the response into the given interface Do(endpoint *CompiledEndpoint, rqBody any, rsBody any, opts ...RequestOpt) error }
Client allows doing requests to different endpoints
type CompiledEndpoint ¶ added in v0.13.11
CompiledEndpoint represents a Discord Rest API endpoint with applied url params & query values.
type Config ¶
type Config struct { Logger log.Logger HTTPClient *http.Client RateLimiter RateLimiter RateRateLimiterConfigOpts []RateLimiterConfigOpt UserAgent string }
Config is the configuration for the rest client
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig is the configuration which is used by default
type ConfigOpt ¶
type ConfigOpt func(config *Config)
ConfigOpt can be used to supply optional parameters to NewClient
func WithHTTPClient ¶
WithHTTPClient applies a custom http.Client to the rest rate limiter
func WithLogger ¶
WithLogger applies a custom logger to the rest rate limiter
func WithRateLimiter ¶
func WithRateLimiter(rateLimiter RateLimiter) ConfigOpt
WithRateLimiter applies a custom rrate.RateLimiter to the rest client
func WithRateRateLimiterConfigOpts ¶ added in v0.12.0
func WithRateRateLimiterConfigOpts(opts ...RateLimiterConfigOpt) ConfigOpt
WithRateRateLimiterConfigOpts applies rrate.ConfigOpt for the rrate.RateLimiter to the rest rate limiter
func WithUserAgent ¶
WithUserAgent sets the user agent for all requests
type Emojis ¶
type Emojis interface { GetEmojis(guildID snowflake.ID, opts ...RequestOpt) ([]discord.Emoji, error) GetEmoji(guildID snowflake.ID, emojiID snowflake.ID, opts ...RequestOpt) (*discord.Emoji, error) CreateEmoji(guildID snowflake.ID, emojiCreate discord.EmojiCreate, opts ...RequestOpt) (*discord.Emoji, error) UpdateEmoji(guildID snowflake.ID, emojiID snowflake.ID, emojiUpdate discord.EmojiUpdate, opts ...RequestOpt) (*discord.Emoji, error) DeleteEmoji(guildID snowflake.ID, emojiID snowflake.ID, opts ...RequestOpt) error }
type Endpoint ¶ added in v0.13.11
Endpoint represents a Discord Rest API endpoint.
func NewEndpoint ¶ added in v0.13.11
NewEndpoint returns a new Endpoint which requires bot auth with the given http method & route.
func NewNoBotAuthEndpoint ¶ added in v0.13.11
NewNoBotAuthEndpoint returns a new Endpoint which does not require bot auth with the given http method & route.
func (*Endpoint) Compile ¶ added in v0.13.11
func (e *Endpoint) Compile(values discord.QueryValues, params ...any) *CompiledEndpoint
Compile compiles an Endpoint to a CompiledEndpoint with the given url params & query values
type Error ¶
Error holds the http.Response & an error related to a REST request
type Gateway ¶
type Gateway interface { GetGateway(opts ...RequestOpt) (*discord.Gateway, error) GetGatewayBot(opts ...RequestOpt) (*discord.GatewayBot, error) }
func NewGateway ¶
type GuildScheduledEvents ¶
type GuildScheduledEvents interface { GetGuildScheduledEvents(guildID snowflake.ID, withUserCounts bool, opts ...RequestOpt) ([]discord.GuildScheduledEvent, error) GetGuildScheduledEvent(guildID snowflake.ID, guildScheduledEventID snowflake.ID, withUserCounts bool, opts ...RequestOpt) (*discord.GuildScheduledEvent, error) CreateGuildScheduledEvent(guildID snowflake.ID, guildScheduledEventCreate discord.GuildScheduledEventCreate, opts ...RequestOpt) (*discord.GuildScheduledEvent, error) UpdateGuildScheduledEvent(guildID snowflake.ID, guildScheduledEventID snowflake.ID, guildScheduledEventUpdate discord.GuildScheduledEventUpdate, opts ...RequestOpt) (*discord.GuildScheduledEvent, error) DeleteGuildScheduledEvent(guildID snowflake.ID, guildScheduledEventID snowflake.ID, opts ...RequestOpt) error GetGuildScheduledEventUsers(guildID snowflake.ID, guildScheduledEventID snowflake.ID, withMember bool, before snowflake.ID, after snowflake.ID, limit int, opts ...RequestOpt) ([]discord.GuildScheduledEventUser, error) GetGuildScheduledEventUsersPage(guildID snowflake.ID, guildScheduledEventID snowflake.ID, withMember bool, startID snowflake.ID, limit int, opts ...RequestOpt) Page[discord.GuildScheduledEventUser] }
func NewGuildScheduledEvents ¶
func NewGuildScheduledEvents(client Client) GuildScheduledEvents
type GuildTemplates ¶
type GuildTemplates interface { GetGuildTemplate(templateCode string, opts ...RequestOpt) (*discord.GuildTemplate, error) GetGuildTemplates(guildID snowflake.ID, opts ...RequestOpt) ([]discord.GuildTemplate, error) CreateGuildTemplate(guildID snowflake.ID, guildTemplateCreate discord.GuildTemplateCreate, opts ...RequestOpt) (*discord.GuildTemplate, error) CreateGuildFromTemplate(templateCode string, createGuildFromTemplate discord.GuildFromTemplateCreate, opts ...RequestOpt) (*discord.Guild, error) SyncGuildTemplate(guildID snowflake.ID, templateCode string, opts ...RequestOpt) (*discord.GuildTemplate, error) UpdateGuildTemplate(guildID snowflake.ID, templateCode string, guildTemplateUpdate discord.GuildTemplateUpdate, opts ...RequestOpt) (*discord.GuildTemplate, error) DeleteGuildTemplate(guildID snowflake.ID, templateCode string, opts ...RequestOpt) (*discord.GuildTemplate, error) }
func NewGuildTemplates ¶
func NewGuildTemplates(client Client) GuildTemplates
type Guilds ¶
type Guilds interface { GetGuild(guildID snowflake.ID, withCounts bool, opts ...RequestOpt) (*discord.RestGuild, error) GetGuildPreview(guildID snowflake.ID, opts ...RequestOpt) (*discord.GuildPreview, error) CreateGuild(guildCreate discord.GuildCreate, opts ...RequestOpt) (*discord.RestGuild, error) UpdateGuild(guildID snowflake.ID, guildUpdate discord.GuildUpdate, opts ...RequestOpt) (*discord.RestGuild, error) DeleteGuild(guildID snowflake.ID, opts ...RequestOpt) error CreateGuildChannel(guildID snowflake.ID, guildChannelCreate discord.GuildChannelCreate, opts ...RequestOpt) (discord.GuildChannel, error) GetGuildChannels(guildID snowflake.ID, opts ...RequestOpt) ([]discord.GuildChannel, error) UpdateChannelPositions(guildID snowflake.ID, guildChannelPositionUpdates []discord.GuildChannelPositionUpdate, opts ...RequestOpt) error GetRoles(guildID snowflake.ID, opts ...RequestOpt) ([]discord.Role, error) GetRole(guildID snowflake.ID, roleID snowflake.ID, opts ...RequestOpt) ([]discord.Role, error) CreateRole(guildID snowflake.ID, createRole discord.RoleCreate, opts ...RequestOpt) (*discord.Role, error) UpdateRole(guildID snowflake.ID, roleID snowflake.ID, roleUpdate discord.RoleUpdate, opts ...RequestOpt) (*discord.Role, error) UpdateRolePositions(guildID snowflake.ID, rolePositionUpdates []discord.RolePositionUpdate, opts ...RequestOpt) ([]discord.Role, error) DeleteRole(guildID snowflake.ID, roleID snowflake.ID, opts ...RequestOpt) error GetBans(guildID snowflake.ID, before snowflake.ID, after snowflake.ID, limit int, opts ...RequestOpt) ([]discord.Ban, error) GetBansPage(guildID snowflake.ID, startID snowflake.ID, limit int, opts ...RequestOpt) Page[discord.Ban] GetBan(guildID snowflake.ID, userID snowflake.ID, opts ...RequestOpt) (*discord.Ban, error) AddBan(guildID snowflake.ID, userID snowflake.ID, deleteMessageDuration time.Duration, opts ...RequestOpt) error DeleteBan(guildID snowflake.ID, userID snowflake.ID, opts ...RequestOpt) error GetIntegrations(guildID snowflake.ID, opts ...RequestOpt) ([]discord.Integration, error) DeleteIntegration(guildID snowflake.ID, integrationID snowflake.ID, opts ...RequestOpt) error GetAllWebhooks(guildID snowflake.ID, opts ...RequestOpt) ([]discord.Webhook, error) GetAuditLog(guildID snowflake.ID, userID snowflake.ID, actionType discord.AuditLogEvent, before snowflake.ID, limit int, opts ...RequestOpt) (*discord.AuditLog, error) GetAuditLogPage(guildID snowflake.ID, userID snowflake.ID, actionType discord.AuditLogEvent, startID snowflake.ID, limit int, opts ...RequestOpt) AuditLogPage }
type Interactions ¶
type Interactions interface { GetInteractionResponse(applicationID snowflake.ID, interactionToken string, opts ...RequestOpt) (*discord.Message, error) CreateInteractionResponse(interactionID snowflake.ID, interactionToken string, interactionResponse discord.InteractionResponse, opts ...RequestOpt) error UpdateInteractionResponse(applicationID snowflake.ID, interactionToken string, messageUpdate discord.MessageUpdate, opts ...RequestOpt) (*discord.Message, error) DeleteInteractionResponse(applicationID snowflake.ID, interactionToken string, opts ...RequestOpt) error GetFollowupMessage(applicationID snowflake.ID, interactionToken string, messageID snowflake.ID, opts ...RequestOpt) (*discord.Message, error) CreateFollowupMessage(applicationID snowflake.ID, interactionToken string, messageCreate discord.MessageCreate, opts ...RequestOpt) (*discord.Message, error) UpdateFollowupMessage(applicationID snowflake.ID, interactionToken string, messageID snowflake.ID, messageUpdate discord.MessageUpdate, opts ...RequestOpt) (*discord.Message, error) DeleteFollowupMessage(applicationID snowflake.ID, interactionToken string, messageID snowflake.ID, opts ...RequestOpt) error }
func NewInteractions ¶
func NewInteractions(client Client) Interactions
type Invites ¶
type Invites interface { GetInvite(code string, opts ...RequestOpt) (*discord.Invite, error) CreateInvite(channelID snowflake.ID, inviteCreate discord.InviteCreate, opts ...RequestOpt) (*discord.Invite, error) DeleteInvite(code string, opts ...RequestOpt) (*discord.Invite, error) GetGuildInvites(guildID snowflake.ID, opts ...RequestOpt) ([]discord.Invite, error) GetChannelInvites(channelID snowflake.ID, opts ...RequestOpt) ([]discord.Invite, error) }
func NewInvites ¶
type Members ¶
type Members interface { GetMember(guildID snowflake.ID, userID snowflake.ID, opts ...RequestOpt) (*discord.Member, error) GetMembers(guildID snowflake.ID, opts ...RequestOpt) ([]discord.Member, error) SearchMembers(guildID snowflake.ID, query string, limit int, opts ...RequestOpt) ([]discord.Member, error) AddMember(guildID snowflake.ID, userID snowflake.ID, memberAdd discord.MemberAdd, opts ...RequestOpt) (*discord.Member, error) RemoveMember(guildID snowflake.ID, userID snowflake.ID, opts ...RequestOpt) error UpdateMember(guildID snowflake.ID, userID snowflake.ID, memberUpdate discord.MemberUpdate, opts ...RequestOpt) (*discord.Member, error) AddMemberRole(guildID snowflake.ID, userID snowflake.ID, roleID snowflake.ID, opts ...RequestOpt) error RemoveMemberRole(guildID snowflake.ID, userID snowflake.ID, roleID snowflake.ID, opts ...RequestOpt) error UpdateCurrentMember(guildID snowflake.ID, nick string, opts ...RequestOpt) (*string, error) UpdateCurrentUserVoiceState(guildID snowflake.ID, currentUserVoiceStateUpdate discord.CurrentUserVoiceStateUpdate, opts ...RequestOpt) error UpdateUserVoiceState(guildID snowflake.ID, userID snowflake.ID, userVoiceStateUpdate discord.UserVoiceStateUpdate, opts ...RequestOpt) error }
func NewMembers ¶
type OAuth2 ¶
type OAuth2 interface { GetBotApplicationInfo(opts ...RequestOpt) (*discord.Application, error) GetCurrentAuthorizationInfo(bearerToken string, opts ...RequestOpt) (*discord.AuthorizationInformation, error) GetCurrentUser(bearerToken string, opts ...RequestOpt) (*discord.OAuth2User, error) GetCurrentMember(bearerToken string, guildID snowflake.ID, opts ...RequestOpt) (*discord.Member, error) GetCurrentUserGuilds(bearerToken string, before snowflake.ID, after snowflake.ID, limit int, opts ...RequestOpt) ([]discord.OAuth2Guild, error) GetCurrentUserGuildsPage(bearerToken string, startID snowflake.ID, limit int, opts ...RequestOpt) Page[discord.OAuth2Guild] GetCurrentUserConnections(bearerToken string, opts ...RequestOpt) ([]discord.Connection, error) SetGuildCommandPermissions(bearerToken string, applicationID snowflake.ID, guildID snowflake.ID, commandID snowflake.ID, commandPermissions []discord.ApplicationCommandPermission, opts ...RequestOpt) (*discord.ApplicationCommandPermissions, error) GetAccessToken(clientID snowflake.ID, clientSecret string, code string, redirectURI string, opts ...RequestOpt) (*discord.AccessTokenResponse, error) RefreshAccessToken(clientID snowflake.ID, clientSecret string, refreshToken string, opts ...RequestOpt) (*discord.AccessTokenResponse, error) }
type Page ¶ added in v0.13.19
type RateLimiter ¶ added in v0.12.0
type RateLimiter interface { // MaxRetries returns the maximum number of retries the client should do MaxRetries() int // Close gracefully closes the RateLimiter. // If the context deadline is exceeded, the RateLimiter will be closed immediately. Close(ctx context.Context) // Reset resets the rate limiter to its initial state Reset() // WaitBucket waits for the given bucket to be available for new requests & locks it WaitBucket(ctx context.Context, endpoint *CompiledEndpoint) error // UnlockBucket unlocks the given bucket and calculates the rate limit for the next request UnlockBucket(endpoint *CompiledEndpoint, rs *http.Response) error }
RateLimiter can be used to supply your own rate limit implementation
func NewRateLimiter ¶ added in v0.12.0
func NewRateLimiter(opts ...RateLimiterConfigOpt) RateLimiter
NewRateLimiter return a new default RateLimiter with the given RateLimiterConfigOpt(s).
type RateLimiterConfig ¶ added in v0.12.0
RateLimiterConfig is the configuration for the rate limiter.
func DefaultRateLimiterConfig ¶ added in v0.12.0
func DefaultRateLimiterConfig() *RateLimiterConfig
DefaultRateLimiterConfig is the configuration which is used by default.
func (*RateLimiterConfig) Apply ¶ added in v0.12.0
func (c *RateLimiterConfig) Apply(opts []RateLimiterConfigOpt)
Apply applies the given RateLimiterConfigOpt(s) to the RateLimiterConfig.
type RateLimiterConfigOpt ¶ added in v0.12.0
type RateLimiterConfigOpt func(config *RateLimiterConfig)
RateLimiterConfigOpt can be used to supply optional parameters to NewRateLimiter.
func WithCleanupInterval ¶ added in v0.12.0
func WithCleanupInterval(cleanupInterval time.Duration) RateLimiterConfigOpt
WithCleanupInterval tells the rest rate limiter how often to clean up the rate limiter buckets.
func WithMaxRetries ¶ added in v0.12.0
func WithMaxRetries(maxRetries int) RateLimiterConfigOpt
WithMaxRetries tells the rest rate limiter to retry the request up to the specified number of times if it encounters a 429 response.
func WithRateLimiterLogger ¶ added in v0.12.0
func WithRateLimiterLogger(logger log.Logger) RateLimiterConfigOpt
WithRateLimiterLogger applies a custom logger to the rest rate limiter.
type RequestConfig ¶
type RequestConfig struct { Request *http.Request Ctx context.Context Checks []Check Delay time.Duration }
RequestConfig are additional options for the request
func DefaultRequestConfig ¶
func DefaultRequestConfig(rq *http.Request) *RequestConfig
func (*RequestConfig) Apply ¶
func (c *RequestConfig) Apply(opts []RequestOpt)
Apply applies the given RequestOpt(s) to the RequestConfig & sets the context if none is set
type RequestOpt ¶
type RequestOpt func(config *RequestConfig)
RequestOpt can be used to supply optional parameters to Client.Do
func WithCtx ¶
func WithCtx(ctx context.Context) RequestOpt
WithCtx applies a custom context to the request
func WithDelay ¶
func WithDelay(delay time.Duration) RequestOpt
WithDelay applies a delay to the request
func WithDiscordLocale ¶
func WithDiscordLocale(locale discord.Locale) RequestOpt
WithDiscordLocale adds the X-Discord-Locale header with the passed locale to the request
func WithHeader ¶
func WithHeader(key string, value string) RequestOpt
WithHeader adds a custom header to the request
func WithQueryParam ¶
func WithQueryParam(param string, value any) RequestOpt
WithQueryParam applies a custom query parameter to the request
func WithReason ¶
func WithReason(reason string) RequestOpt
WithReason adds a reason header to the request. Not all discord endpoints support this
type Rest ¶
type Rest interface { Client Applications OAuth2 Gateway Guilds AutoModeration Members Channels Threads Interactions Invites GuildTemplates Users Voice Webhooks StageInstances Emojis Stickers GuildScheduledEvents }
Rest is a manager for all of disgo's HTTP requests
type StageInstances ¶
type StageInstances interface { GetStageInstance(guildID snowflake.ID, opts ...RequestOpt) (*discord.StageInstance, error) CreateStageInstance(stageInstanceCreate discord.StageInstanceCreate, opts ...RequestOpt) (*discord.StageInstance, error) UpdateStageInstance(guildID snowflake.ID, stageInstanceUpdate discord.StageInstanceUpdate, opts ...RequestOpt) (*discord.StageInstance, error) DeleteStageInstance(guildID snowflake.ID, opts ...RequestOpt) error }
func NewStageInstances ¶
func NewStageInstances(client Client) StageInstances
type Stickers ¶
type Stickers interface { GetNitroStickerPacks(opts ...RequestOpt) ([]discord.StickerPack, error) GetSticker(stickerID snowflake.ID, opts ...RequestOpt) (*discord.Sticker, error) GetStickers(guildID snowflake.ID, opts ...RequestOpt) ([]discord.Sticker, error) CreateSticker(guildID snowflake.ID, createSticker discord.StickerCreate, opts ...RequestOpt) (*discord.Sticker, error) UpdateSticker(guildID snowflake.ID, stickerID snowflake.ID, stickerUpdate discord.StickerUpdate, opts ...RequestOpt) (*discord.Sticker, error) DeleteSticker(guildID snowflake.ID, stickerID snowflake.ID, opts ...RequestOpt) error }
func NewStickers ¶
type Threads ¶
type Threads interface { // CreateThreadFromMessage does not work for discord.ChannelTypeGuildForum channels. CreateThreadFromMessage(channelID snowflake.ID, messageID snowflake.ID, threadCreateFromMessage discord.ThreadCreateFromMessage, opts ...RequestOpt) (thread *discord.GuildThread, err error) CreateThreadInForum(channelID snowflake.ID, threadCreateInForum discord.ForumThreadCreate, opts ...RequestOpt) (thread *discord.ForumThread, err error) CreateThread(channelID snowflake.ID, threadCreate discord.ThreadCreate, opts ...RequestOpt) (thread *discord.GuildThread, err error) JoinThread(threadID snowflake.ID, opts ...RequestOpt) error LeaveThread(threadID snowflake.ID, opts ...RequestOpt) error AddThreadMember(threadID snowflake.ID, userID snowflake.ID, opts ...RequestOpt) error RemoveThreadMember(threadID snowflake.ID, userID snowflake.ID, opts ...RequestOpt) error GetThreadMember(threadID snowflake.ID, userID snowflake.ID, opts ...RequestOpt) (threadMember *discord.ThreadMember, err error) GetThreadMembers(threadID snowflake.ID, opts ...RequestOpt) (threadMembers []discord.ThreadMember, err error) GetPublicArchivedThreads(channelID snowflake.ID, before time.Time, limit int, opts ...RequestOpt) (threads *discord.GetThreads, err error) GetPrivateArchivedThreads(channelID snowflake.ID, before time.Time, limit int, opts ...RequestOpt) (threads *discord.GetThreads, err error) GetJoinedPrivateArchivedThreads(channelID snowflake.ID, before time.Time, limit int, opts ...RequestOpt) (threads *discord.GetThreads, err error) }
func NewThreads ¶
type Users ¶
type Users interface { GetUser(userID snowflake.ID, opts ...RequestOpt) (*discord.User, error) UpdateSelfUser(selfUserUpdate discord.SelfUserUpdate, opts ...RequestOpt) (*discord.OAuth2User, error) GetGuilds(before int, after int, limit int, opts ...RequestOpt) ([]discord.OAuth2Guild, error) LeaveGuild(guildID snowflake.ID, opts ...RequestOpt) error GetDMChannels(opts ...RequestOpt) ([]discord.Channel, error) CreateDMChannel(userID snowflake.ID, opts ...RequestOpt) (*discord.DMChannel, error) }
type Voice ¶
type Voice interface {
GetVoiceRegions(opts ...RequestOpt) ([]discord.VoiceRegion, error)
}
type Webhooks ¶
type Webhooks interface { GetWebhook(webhookID snowflake.ID, opts ...RequestOpt) (discord.Webhook, error) UpdateWebhook(webhookID snowflake.ID, webhookUpdate discord.WebhookUpdate, opts ...RequestOpt) (discord.Webhook, error) DeleteWebhook(webhookID snowflake.ID, opts ...RequestOpt) error GetWebhookWithToken(webhookID snowflake.ID, webhookToken string, opts ...RequestOpt) (discord.Webhook, error) UpdateWebhookWithToken(webhookID snowflake.ID, webhookToken string, webhookUpdate discord.WebhookUpdateWithToken, opts ...RequestOpt) (discord.Webhook, error) DeleteWebhookWithToken(webhookID snowflake.ID, webhookToken string, opts ...RequestOpt) error CreateWebhookMessage(webhookID snowflake.ID, webhookToken string, messageCreate discord.WebhookMessageCreate, wait bool, threadID snowflake.ID, opts ...RequestOpt) (*discord.Message, error) CreateWebhookMessageSlack(webhookID snowflake.ID, webhookToken string, messageCreate discord.Payload, wait bool, threadID snowflake.ID, opts ...RequestOpt) (*discord.Message, error) CreateWebhookMessageGitHub(webhookID snowflake.ID, webhookToken string, messageCreate discord.Payload, wait bool, threadID snowflake.ID, opts ...RequestOpt) (*discord.Message, error) UpdateWebhookMessage(webhookID snowflake.ID, webhookToken string, messageID snowflake.ID, messageUpdate discord.WebhookMessageUpdate, threadID snowflake.ID, opts ...RequestOpt) (*discord.Message, error) DeleteWebhookMessage(webhookID snowflake.ID, webhookToken string, messageID snowflake.ID, threadID snowflake.ID, opts ...RequestOpt) error }
func NewWebhooks ¶
Source Files ¶
- applications.go
- auto_moderation.go
- channels.go
- emojis.go
- gateway.go
- guild_scheduled_events.go
- guild_templates.go
- guilds.go
- interactions.go
- invites.go
- members.go
- oauth2.go
- page.go
- request_config.go
- rest.go
- rest_client.go
- rest_config.go
- rest_endpoints.go
- rest_error.go
- rest_rate_limiter.go
- rest_rate_limiter_config.go
- stage_instances.go
- stickers.go
- threads.go
- users.go
- voice.go
- webhooks.go