dsbotgo

package module
v0.0.0-...-59da25f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2026 License: MIT Imports: 35 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

dsbotgo

Go Version GitLab CI Coverage Go Report Card

A Discord selfbot package written in Go that supports two different modes for interacting with Discord:

  1. TLS Mode - Uses bogdanfinn/tls-client for lightweight HTTP requests with proper TLS fingerprinting
  2. Browser Mode - Uses go-rod/rod for full browser automation

Features

  • Dual Mode Support: Choose between lightweight TLS client or full browser automation
  • Rate Limiting: Built-in rate limiting to avoid Discord API limits
  • Proxy Support: Configure proxy for both modes
  • Debug Mode: Detailed logging for development and troubleshooting
  • Comprehensive API: Support for messages, guilds, channels, reactions, and more

Installation

go mod init your-project
go get gitlab.com/capoverflow/dsbotgo

Quick Start

package main

import (
    "context"
    "log"
    
    "gitlab.com/capoverflow/dsbotgo"
)

func main() {
    config := dsbotgo.DefaultConfig("YOUR_DISCORD_TOKEN")
    config.Mode = dsbotgo.ModeTLS
    config.Debug = true
    
    client := dsbotgo.NewClient(config)
    
    ctx := context.Background()
    if err := client.Initialize(ctx); err != nil {
        log.Fatal(err)
    }
    defer client.Close()
    
    // Get current user
    user, err := client.GetCurrentUser(ctx)
    if err != nil {
        log.Fatal(err)
    }
    log.Printf("Logged in as: %s", user.Username)
    
    // Send a message
    message, err := client.SendMessage(ctx, "CHANNEL_ID", "Hello World!")
    if err != nil {
        log.Fatal(err)
    }
    log.Printf("Message sent: %s", message.ID)
}
Browser Mode (For complex automation)
package main

import (
    "context"
    "log"
    "time"
    
    "gitlab.com/capoverflow/dsbotgo"
)

func main() {
    config := dsbotgo.DefaultConfig("YOUR_DISCORD_TOKEN")
    config.Mode = dsbotgo.ModeBrowser
    config.Debug = true
    config.Timeout = 60 * time.Second
    
    client := dsbotgo.NewClient(config)
    
    ctx := context.Background()
    if err := client.Initialize(ctx); err != nil {
        log.Fatal(err)
    }
    defer client.Close()
    
    // Join a guild
    err := client.JoinGuild(ctx, "INVITE_CODE")
    if err != nil {
        log.Printf("Failed to join guild: %v", err)
    }
    
    // Get guilds
    guilds, err := client.GetGuilds(ctx)
    if err != nil {
        log.Fatal(err)
    }
    log.Printf("Found %d guilds", len(guilds))
}

Configuration

type Config struct {
    Token       string        // Discord user token
    Mode        Mode          // ModeTLS or ModeBrowser
    UserAgent   string        // Custom user agent
    Timeout     time.Duration // Request timeout
    ProxyURL    string        // Proxy URL (optional)
    Debug       bool          // Enable debug logging
    RateLimited bool          // Enable rate limiting
}
Default Configuration
config := dsbotgo.DefaultConfig("your_token")
// Defaults:
// Mode: ModeTLS
// UserAgent: Chrome 120 user agent
// Timeout: 30 seconds
// Debug: false
// RateLimited: true

API Methods

User Management
  • GetCurrentUser(ctx) (*User, error) - Get current user information
Messaging
  • SendMessage(ctx, channelID, content) (*Message, error) - Send a message
  • GetMessages(ctx, channelID, opts *GetMessagesOptions) ([]*Message, error) - Get recent messages with pagination (limit, before, after, around)
  • GetAllMessages(ctx, channelID, opts *GetAllMessagesOptions) ([]*Message, error) - Get all messages with auto-pagination (limit, before, after, oldestFirst)
  • AddReaction(ctx, channelID, messageID, emoji) error - Add reaction to message (emoji can be string, *Emoji, or EmojiReaction)
Guild Management
  • GetGuilds(ctx) ([]*Guild, error) - Get user's guilds
  • GetGuild(ctx, guildID) (*Guild, error) - Get guild information
  • JoinGuild(ctx, inviteCode) error - Join guild via invite
Channel Management
  • GetChannel(ctx, channelID) (*Channel, error) - Get channel information

Data Structures

User
type User struct {
    ID            string `json:"id"`
    Username      string `json:"username"`
    GlobalName    string `json:"global_name"`
    Discriminator string `json:"discriminator"`
    Avatar        string `json:"avatar"`
    Bot           bool   `json:"bot"`
    // ... more fields
}
Message
type Message struct {
    ID        string    `json:"id"`
    ChannelID string    `json:"channel_id"`
    GuildID   string    `json:"guild_id"`
    Author    *User     `json:"author"`
    Content   string    `json:"content"`
    Timestamp time.Time `json:"timestamp"`
    // ... more fields
}
Guild
type Guild struct {
    ID          string `json:"id"`
    Name        string `json:"name"`
    Icon        string `json:"icon"`
    Description string `json:"description"`
    OwnerID     string `json:"owner_id"`
    // ... more fields
}

Mode Comparison

Feature TLS Mode Browser Mode
Performance ⚡ Fast 🐌 Slower
Resource Usage 💾 Low 🖥️ High
Detection Risk 🟡 Medium 🟢 Low
Complex Actions ❌ Limited ✅ Full Support
Proxy Support ✅ Yes ✅ Yes
Headless ✅ Always ⚙️ Configurable

When to Use Each Mode

TLS Mode
  • Simple messaging and API calls
  • High-performance requirements
  • Resource-constrained environments
  • Bulk operations
Browser Mode
  • Complex user interactions
  • CAPTCHA handling
  • Full Discord UI automation
  • Maximum stealth requirements

Security Considerations

⚠️ Important: This package is for educational purposes only. Using selfbots violates Discord's Terms of Service and may result in account termination.

  • Keep your Discord token secure
  • Use rate limiting to avoid detection
  • Consider using proxies for additional anonymity
  • Monitor for Discord API changes

Dependencies

Contributing

Contributions are welcome! Please read our Contributing Guide for details on our code of conduct and the process for submitting merge requests.

Contributors

Thanks to all the people who have contributed to this project!

License

This project is licensed under the MIT License - see the LICENSE file for details.

Disclaimer

This software is provided for educational purposes only. The authors are not responsible for any misuse or damage caused by this software. Use at your own risk and ensure compliance with Discord's Terms of Service and applicable laws.

Documentation

Index

Constants

View Source
const (
	MessageFlagCrossposted                    = 1 << 0
	MessageFlagIsCrossposted                  = 1 << 1
	MessageFlagSuppressEmbeds                 = 1 << 2
	MessageFlagSourceMessageDeleted           = 1 << 3
	MessageFlagUrgent                         = 1 << 4
	MessageFlagHasThread                      = 1 << 5
	MessageFlagEphemeral                      = 1 << 6
	MessageFlagLoading                        = 1 << 7
	MessageFlagFailedToMentionSomeRolesInThrd = 1 << 8
	MessageFlagLinkNotDiscordWarning          = 1 << 10
	MessageFlagSuppressNotifications          = 1 << 12
	MessageFlagVoiceMessage                   = 1 << 13
	MessageFlagForwarded                      = 1 << 14
	MessageFlagComponentsV2                   = 1 << 15
)

Message flag bits (discord.py-self: MessageFlags).

View Source
const (
	ContextLocationFriends     = "Friends"
	ContextLocationContextMenu = "ContextMenu"
	ContextLocationUserProfile = "User Profile"
	ContextLocationDMChannel   = "DM Channel"
	ContextLocationAddFriend   = "Add Friend"
	ContextLocationGroupDM     = "Group DM"
	ContextLocationNewGroupDM  = "New Group DM"
)

Context locations used by the web client.

View Source
const (
	EventInitialGuild                              = "INITIAL_GUILD"
	EventReadySupplemental                         = "READY_SUPPLEMENTAL"
	EventReady                                     = "READY"
	EventStateUpdate                               = "STATE_UPDATE"
	EventExperimentSessionOverrideCreate           = "EXPERIMENT_SESSION_OVERRIDE_CREATE"
	EventExperimentSessionOverrideDelete           = "EXPERIMENT_SESSION_OVERRIDE_DELETE"
	EventResumed                                   = "RESUMED"
	EventTypingStart                               = "TYPING_START"
	EventActivityStart                             = "ACTIVITY_START"
	EventActivityUserAction                        = "ACTIVITY_USER_ACTION"
	EventMessageCreate                             = "MESSAGE_CREATE"
	EventMessageUpdate                             = "MESSAGE_UPDATE"
	EventMessageDelete                             = "MESSAGE_DELETE"
	EventMessageDeleteBulk                         = "MESSAGE_DELETE_BULK"
	EventMessageAck                                = "MESSAGE_ACK"
	EventGuildFeatureAck                           = "GUILD_FEATURE_ACK"
	EventUserNonChannelAck                         = "USER_NON_CHANNEL_ACK"
	EventConjuringProjectCreateProgress            = "CONJURING_PROJECT_CREATE_PROGRESS"
	EventConjuringProjectUpdate                    = "CONJURING_PROJECT_UPDATE"
	EventApplicationFrameUpdate                    = "APPLICATION_FRAME_UPDATE"
	EventConjuringTurnSettled                      = "CONJURING_TURN_SETTLED"
	EventChannelPinsAck                            = "CHANNEL_PINS_ACK"
	EventChannelPinsUpdate                         = "CHANNEL_PINS_UPDATE"
	EventChannelCreate                             = "CHANNEL_CREATE"
	EventChannelDelete                             = "CHANNEL_DELETE"
	EventVoiceChannelStatusUpdate                  = "VOICE_CHANNEL_STATUS_UPDATE"
	EventVoiceChannelStartTimeUpdate               = "VOICE_CHANNEL_START_TIME_UPDATE"
	EventChannelInfo                               = "CHANNEL_INFO"
	EventChannelMemberCountUpdate                  = "CHANNEL_MEMBER_COUNT_UPDATE"
	EventChannelUpdate                             = "CHANNEL_UPDATE"
	EventThreadCreate                              = "THREAD_CREATE"
	EventThreadUpdate                              = "THREAD_UPDATE"
	EventThreadDelete                              = "THREAD_DELETE"
	EventThreadListSync                            = "THREAD_LIST_SYNC"
	EventThreadMemberUpdate                        = "THREAD_MEMBER_UPDATE"
	EventThreadMembersUpdate                       = "THREAD_MEMBERS_UPDATE"
	EventForumUnreads                              = "FORUM_UNREADS"
	EventSoundboardSounds                          = "SOUNDBOARD_SOUNDS"
	EventChannelRecipientAdd                       = "CHANNEL_RECIPIENT_ADD"
	EventChannelRecipientRemove                    = "CHANNEL_RECIPIENT_REMOVE"
	EventGuildCreate                               = "GUILD_CREATE"
	EventGuildUpdate                               = "GUILD_UPDATE"
	EventGuildPruneUpdate                          = "GUILD_PRUNE_UPDATE"
	EventGuildBulkBanUpdate                        = "GUILD_BULK_BAN_UPDATE"
	EventGuildDelete                               = "GUILD_DELETE"
	EventGuildMembersChunk                         = "GUILD_MEMBERS_CHUNK"
	EventThreadMemberListUpdate                    = "THREAD_MEMBER_LIST_UPDATE"
	EventGuildBanAdd                               = "GUILD_BAN_ADD"
	EventGuildBanRemove                            = "GUILD_BAN_REMOVE"
	EventGuildMemberAdd                            = "GUILD_MEMBER_ADD"
	EventGuildMemberUpdate                         = "GUILD_MEMBER_UPDATE"
	EventGuildMemberRemove                         = "GUILD_MEMBER_REMOVE"
	EventGuildRoleCreate                           = "GUILD_ROLE_CREATE"
	EventGuildRoleUpdate                           = "GUILD_ROLE_UPDATE"
	EventGuildRoleDelete                           = "GUILD_ROLE_DELETE"
	EventGuildEmojisUpdate                         = "GUILD_EMOJIS_UPDATE"
	EventGuildStickersUpdate                       = "GUILD_STICKERS_UPDATE"
	EventGuildIntegrationsUpdate                   = "GUILD_INTEGRATIONS_UPDATE"
	EventIntegrationCreate                         = "INTEGRATION_CREATE"
	EventIntegrationUpdate                         = "INTEGRATION_UPDATE"
	EventIntegrationDelete                         = "INTEGRATION_DELETE"
	EventUserUpdate                                = "USER_UPDATE"
	EventUserSettingsProtoUpdate                   = "USER_SETTINGS_PROTO_UPDATE"
	EventUserGuildSettingsUpdate                   = "USER_GUILD_SETTINGS_UPDATE"
	EventUserConnectionsUpdate                     = "USER_CONNECTIONS_UPDATE"
	EventUserRequiredActionUpdate                  = "USER_REQUIRED_ACTION_UPDATE"
	EventUserNoteUpdate                            = "USER_NOTE_UPDATE"
	EventRelationshipAdd                           = "RELATIONSHIP_ADD"
	EventRelationshipRemove                        = "RELATIONSHIP_REMOVE"
	EventRelationshipUpdate                        = "RELATIONSHIP_UPDATE"
	EventGameRelationshipAdd                       = "GAME_RELATIONSHIP_ADD"
	EventGameRelationshipRemove                    = "GAME_RELATIONSHIP_REMOVE"
	EventPresenceUpdate                            = "PRESENCE_UPDATE"
	EventPresencesReplace                          = "PRESENCES_REPLACE"
	EventSessionsReplace                           = "SESSIONS_REPLACE"
	EventVoiceStateUpdate                          = "VOICE_STATE_UPDATE"
	EventVoiceStateUpdateBatch                     = "VOICE_STATE_UPDATE_BATCH"
	EventVoiceServerUpdate                         = "VOICE_SERVER_UPDATE"
	EventCallCreate                                = "CALL_CREATE"
	EventCallUpdate                                = "CALL_UPDATE"
	EventCallDelete                                = "CALL_DELETE"
	EventOAuth2TokenCreate                         = "OAUTH2_TOKEN_CREATE"
	EventOAuth2TokenDelete                         = "OAUTH2_TOKEN_DELETE"
	EventOAuth2TokenRevoke                         = "OAUTH2_TOKEN_REVOKE"
	EventRecentMentionDelete                       = "RECENT_MENTION_DELETE"
	EventSavedMessageCreate                        = "SAVED_MESSAGE_CREATE"
	EventSavedMessageDelete                        = "SAVED_MESSAGE_DELETE"
	EventFriendSuggestionCreate                    = "FRIEND_SUGGESTION_CREATE"
	EventFriendSuggestionDelete                    = "FRIEND_SUGGESTION_DELETE"
	EventWebhooksUpdate                            = "WEBHOOKS_UPDATE"
	EventMessageReactionAdd                        = "MESSAGE_REACTION_ADD"
	EventMessageReactionRemove                     = "MESSAGE_REACTION_REMOVE"
	EventMessagePollVoteAdd                        = "MESSAGE_POLL_VOTE_ADD"
	EventMessagePollVoteRemove                     = "MESSAGE_POLL_VOTE_REMOVE"
	EventMessagePollVoteAddMany                    = "MESSAGE_POLL_VOTE_ADD_MANY"
	EventMessageReactionRemoveAll                  = "MESSAGE_REACTION_REMOVE_ALL"
	EventMessageReactionRemoveEmoji                = "MESSAGE_REACTION_REMOVE_EMOJI"
	EventMessageReactionAddMany                    = "MESSAGE_REACTION_ADD_MANY"
	EventPaymentUpdate                             = "PAYMENT_UPDATE"
	EventOrderUpdate                               = "ORDER_UPDATE"
	EventEntitlementCreate                         = "ENTITLEMENT_CREATE"
	EventEntitlementUpdate                         = "ENTITLEMENT_UPDATE"
	EventEntitlementDelete                         = "ENTITLEMENT_DELETE"
	EventUserPaymentSourcesUpdate                  = "USER_PAYMENT_SOURCES_UPDATE"
	EventUserSubscriptionsUpdate                   = "USER_SUBSCRIPTIONS_UPDATE"
	EventWishlistItemPurchased                     = "WISHLIST_ITEM_PURCHASED"
	EventUserBadgeStateUpdate                      = "USER_BADGE_STATE_UPDATE"
	EventUserPremiumGuildSubscriptionSlotCreate    = "USER_PREMIUM_GUILD_SUBSCRIPTION_SLOT_CREATE"
	EventUserPremiumGuildSubscriptionSlotUpdate    = "USER_PREMIUM_GUILD_SUBSCRIPTION_SLOT_UPDATE"
	EventBillingPopupBridgeCallback                = "BILLING_POPUP_BRIDGE_CALLBACK"
	EventUserPaymentBrowserCheckoutDone            = "USER_PAYMENT_BROWSER_CHECKOUT_DONE"
	EventUserPaymentClientAdd                      = "USER_PAYMENT_CLIENT_ADD"
	EventGuildMemberListUpdate                     = "GUILD_MEMBER_LIST_UPDATE"
	EventGiftCodeUpdate                            = "GIFT_CODE_UPDATE"
	EventGiftCodeCreate                            = "GIFT_CODE_CREATE"
	EventLibraryApplicationUpdate                  = "LIBRARY_APPLICATION_UPDATE"
	EventStreamCreate                              = "STREAM_CREATE"
	EventStreamServerUpdate                        = "STREAM_SERVER_UPDATE"
	EventStreamUpdate                              = "STREAM_UPDATE"
	EventStreamDelete                              = "STREAM_DELETE"
	EventGenericPushNotificationSent               = "GENERIC_PUSH_NOTIFICATION_SENT"
	EventReactionNotificationSent                  = "REACTION_NOTIFICATION_SENT"
	EventNotificationCenterItemCreate              = "NOTIFICATION_CENTER_ITEM_CREATE"
	EventNotificationCenterItemDelete              = "NOTIFICATION_CENTER_ITEM_DELETE"
	EventNotificationCenterItemsAck                = "NOTIFICATION_CENTER_ITEMS_ACK"
	EventNotificationCenterItemCompleted           = "NOTIFICATION_CENTER_ITEM_COMPLETED"
	EventQuestsUserStatusUpdate                    = "QUESTS_USER_STATUS_UPDATE"
	EventOrbsArcadeGameStateUpdate                 = "ORBS_ARCADE_GAME_STATE_UPDATE"
	EventQuestsUserCompletionUpdate                = "QUESTS_USER_COMPLETION_UPDATE"
	EventQuestPreviewUpdate                        = "QUEST_PREVIEW_UPDATE"
	EventApplicationCommandPermissionsUpdate       = "APPLICATION_COMMAND_PERMISSIONS_UPDATE"
	EventGuildApplicationCommandIndexUpdate        = "GUILD_APPLICATION_COMMAND_INDEX_UPDATE"
	EventGuildJoinRequestCreate                    = "GUILD_JOIN_REQUEST_CREATE"
	EventGuildJoinRequestUpdate                    = "GUILD_JOIN_REQUEST_UPDATE"
	EventGuildJoinRequestDelete                    = "GUILD_JOIN_REQUEST_DELETE"
	EventInteractionCreate                         = "INTERACTION_CREATE"
	EventInteractionSuccess                        = "INTERACTION_SUCCESS"
	EventInteractionFailure                        = "INTERACTION_FAILURE"
	EventApplicationCommandAutocompleteResponse    = "APPLICATION_COMMAND_AUTOCOMPLETE_RESPONSE"
	EventInteractionModalCreate                    = "INTERACTION_MODAL_CREATE"
	EventInteractionIframeModalCreate              = "INTERACTION_IFRAME_MODAL_CREATE"
	EventStageInstanceCreate                       = "STAGE_INSTANCE_CREATE"
	EventStageInstanceUpdate                       = "STAGE_INSTANCE_UPDATE"
	EventStageInstanceDelete                       = "STAGE_INSTANCE_DELETE"
	EventGuildScheduledEventCreate                 = "GUILD_SCHEDULED_EVENT_CREATE"
	EventGuildScheduledEventUpdate                 = "GUILD_SCHEDULED_EVENT_UPDATE"
	EventGuildScheduledEventDelete                 = "GUILD_SCHEDULED_EVENT_DELETE"
	EventGuildScheduledEventExceptionCreate        = "GUILD_SCHEDULED_EVENT_EXCEPTION_CREATE"
	EventGuildScheduledEventExceptionUpdate        = "GUILD_SCHEDULED_EVENT_EXCEPTION_UPDATE"
	EventGuildScheduledEventExceptionDelete        = "GUILD_SCHEDULED_EVENT_EXCEPTION_DELETE"
	EventGuildScheduledEventUserAdd                = "GUILD_SCHEDULED_EVENT_USER_ADD"
	EventGuildScheduledEventUserRemove             = "GUILD_SCHEDULED_EVENT_USER_REMOVE"
	EventGuildDirectoryEntryCreate                 = "GUILD_DIRECTORY_ENTRY_CREATE"
	EventGuildDirectoryEntryUpdate                 = "GUILD_DIRECTORY_ENTRY_UPDATE"
	EventGuildDirectoryEntryDelete                 = "GUILD_DIRECTORY_ENTRY_DELETE"
	EventAutoModerationMentionRaidDetection        = "AUTO_MODERATION_MENTION_RAID_DETECTION"
	EventAutoModerationContentDeleted              = "AUTO_MODERATION_CONTENT_DELETED"
	EventVoiceChannelEffectSend                    = "VOICE_CHANNEL_EFFECT_SEND"
	EventClipsRemoteTrigger                        = "CLIPS_REMOTE_TRIGGER"
	EventGuildSoundboardSoundCreate                = "GUILD_SOUNDBOARD_SOUND_CREATE"
	EventGuildSoundboardSoundUpdate                = "GUILD_SOUNDBOARD_SOUND_UPDATE"
	EventGuildSoundboardSoundDelete                = "GUILD_SOUNDBOARD_SOUND_DELETE"
	EventGuildSoundboardSoundsUpdate               = "GUILD_SOUNDBOARD_SOUNDS_UPDATE"
	EventEmbeddedActivityUpdateV2                  = "EMBEDDED_ACTIVITY_UPDATE_V2"
	EventAuthSessionChange                         = "AUTH_SESSION_CHANGE"
	EventUserConnectionsLinkCallback               = "USER_CONNECTIONS_LINK_CALLBACK"
	EventUserConnectionsCallback                   = "USER_CONNECTIONS_CALLBACK"
	EventDeletedEntityIDs                          = "DELETED_ENTITY_IDS"
	EventChannelSync                               = "CHANNEL_SYNC"
	EventConsoleCommandUpdate                      = "CONSOLE_COMMAND_UPDATE"
	EventPassiveUpdateV2                           = "PASSIVE_UPDATE_V2"
	EventCreatorMonetizationRestrictionsUpdate     = "CREATOR_MONETIZATION_RESTRICTIONS_UPDATE"
	EventBillingReferralTrialOfferUpdate           = "BILLING_REFERRAL_TRIAL_OFFER_UPDATE"
	EventLastMessages                              = "LAST_MESSAGES"
	EventAuthenticatorUpdate                       = "AUTHENTICATOR_UPDATE"
	EventAuthenticatorCreate                       = "AUTHENTICATOR_CREATE"
	EventAuthenticatorDelete                       = "AUTHENTICATOR_DELETE"
	EventNotificationSettingsUpdate                = "NOTIFICATION_SETTINGS_UPDATE"
	EventConversationSummaryUpdate                 = "CONVERSATION_SUMMARY_UPDATE"
	EventPremiumMarketingPreview                   = "PREMIUM_MARKETING_PREVIEW"
	EventUserApplicationUpdate                     = "USER_APPLICATION_UPDATE"
	EventUserApplicationRemove                     = "USER_APPLICATION_REMOVE"
	EventDMSettingsUpsellShow                      = "DM_SETTINGS_UPSELL_SHOW"
	EventContentInventoryInboxStale                = "CONTENT_INVENTORY_INBOX_STALE"
	EventVirtualCurrencyBalanceUpdate              = "VIRTUAL_CURRENCY_BALANCE_UPDATE"
	EventUserDiscordAchievementStateUpdate         = "USER_DISCORD_ACHIEVEMENT_STATE_UPDATE"
	EventWalletBalanceUpdate                       = "WALLET_BALANCE_UPDATE"
	EventGuildPowerupEntitlementsCreate            = "GUILD_POWERUP_ENTITLEMENTS_CREATE"
	EventGuildPowerupEntitlementsDelete            = "GUILD_POWERUP_ENTITLEMENTS_DELETE"
	EventGameServerCreate                          = "GAME_SERVER_CREATE"
	EventGameServerUpdate                          = "GAME_SERVER_UPDATE"
	EventGameServerDelete                          = "GAME_SERVER_DELETE"
	EventGuildAppliedBoostsUpdate                  = "GUILD_APPLIED_BOOSTS_UPDATE"
	EventUserApplicationIdentityUpdate             = "USER_APPLICATION_IDENTITY_UPDATE"
	EventUserApplicationIdentityRemove             = "USER_APPLICATION_IDENTITY_REMOVE"
	EventSocialLayerSKUPurchaseEligibilityResponse = "SOCIAL_LAYER_SKU_PURCHASE_ELIGIBILITY_RESPONSE"
	EventGuildRoomConnect                          = "GUILD_ROOM_CONNECT"
	EventGuildRoomDisconnect                       = "GUILD_ROOM_DISCONNECT"
	EventGuildRoomUpdate                           = "GUILD_ROOM_UPDATE"
	EventGuildOfficialGameApplicationsUpdate       = "GUILD_OFFICIAL_GAME_APPLICATIONS_UPDATE"
	EventMessageRequestNotificationSent            = "MESSAGE_REQUEST_NOTIFICATION_SENT"
	EventAutoModerationActionExecution             = "AUTO_MODERATION_ACTION_EXECUTION" // not in the web dispatch table; handled by discord.py-self
	EventAutoModerationRuleCreate                  = "AUTO_MODERATION_RULE_CREATE"      // not in the web dispatch table; handled by discord.py-self
	EventAutoModerationRuleDelete                  = "AUTO_MODERATION_RULE_DELETE"      // not in the web dispatch table; handled by discord.py-self
	EventAutoModerationRuleUpdate                  = "AUTO_MODERATION_RULE_UPDATE"      // not in the web dispatch table; handled by discord.py-self
	EventGuildAuditLogEntryCreate                  = "GUILD_AUDIT_LOG_ENTRY_CREATE"     // not in the web dispatch table; handled by discord.py-self
	EventInteractionIframeModalClose               = "INTERACTION_IFRAME_MODAL_CLOSE"   // not in the web dispatch table; handled by discord.py-self
	EventInviteCreate                              = "INVITE_CREATE"                    // not in the web dispatch table; handled by discord.py-self
	EventInviteDelete                              = "INVITE_DELETE"                    // not in the web dispatch table; handled by discord.py-self
	EventPassiveUpdateV1                           = "PASSIVE_UPDATE_V1"                // sent only with CapabilityPassiveGuildUpdate (bit 11) and without bit 14
)

Dispatch event names. The set is the union of the 201 events the web client (build 673869, also run by the desktop app) registers in its gateway dispatch table and the events discord.py-self parses. Events not in the web table are marked; the web client ignores them, but the gateway may still send them.

View Source
const (
	// Deprecated: use EventGuildApplicationCommandIndexUpdate (same value).
	EventGuildApplicationCommandUpdate = "GUILD_APPLICATION_COMMAND_INDEX_UPDATE"
	// Deprecated: not a dispatch event in the web client (build 673869) or discord.py-self; kept for compatibility.
	EventApplicationCommandCreate = "APPLICATION_COMMAND_CREATE"
	// Deprecated: not a dispatch event in the web client (build 673869) or discord.py-self; kept for compatibility.
	EventApplicationCommandDelete = "APPLICATION_COMMAND_DELETE"
	// Deprecated: not a dispatch event in the web client (build 673869) or discord.py-self; kept for compatibility.
	EventApplicationCommandUpdate = "APPLICATION_COMMAND_UPDATE"
	// Deprecated: not a dispatch event; connections arrive as USER_CONNECTIONS_UPDATE (EventUserConnectionsUpdate).
	EventConnectionCreate = "CONNECTION_CREATE"
	// Deprecated: not a dispatch event; connections arrive as USER_CONNECTIONS_UPDATE (EventUserConnectionsUpdate).
	EventConnectionDelete = "CONNECTION_DELETE"
	// Deprecated: not a dispatch event; connections arrive as USER_CONNECTIONS_UPDATE (EventUserConnectionsUpdate).
	EventConnectionUpdate = "CONNECTION_UPDATE"
	// Deprecated: the dispatch name is USER_NON_CHANNEL_ACK (EventUserNonChannelAck).
	EventNonChannelAck = "NON_CHANNEL_ACK"
	// Deprecated: the dispatch name is GUILD_DIRECTORY_ENTRY_CREATE (EventGuildDirectoryEntryCreate).
	EventDirectoryEntryCreate = "DIRECTORY_ENTRY_CREATE"
	// Deprecated: the dispatch name is GUILD_DIRECTORY_ENTRY_UPDATE (EventGuildDirectoryEntryUpdate).
	EventDirectoryEntryUpdate = "DIRECTORY_ENTRY_UPDATE"
	// Deprecated: the dispatch name is GUILD_DIRECTORY_ENTRY_DELETE (EventGuildDirectoryEntryDelete).
	EventDirectoryEntryDelete = "DIRECTORY_ENTRY_DELETE"
	// Deprecated: TEST_EVENT is not a Discord dispatch event (it came from a local test harness). It is still delivered if received.
	EventTestEvent = "TEST_EVENT"
)

Historical identifiers kept so existing code compiles.

View Source
const (
	// DefaultGatewayURL is GLOBAL_ENV.GATEWAY_ENDPOINT in the web client.
	DefaultGatewayURL = "wss://gateway.discord.gg"
	// GatewayVersion is the gateway protocol version every reference client uses.
	GatewayVersion = 9
	// QOSHeartbeatVersion is the "ver" the web client puts in op 40 QOS payloads
	// (discord.py-self still sends 27).
	QOSHeartbeatVersion = 31
	// GatewayConnectReasonColdStart is the gateway_connect_reasons value the web
	// client sends until a bridge reason is registered.
	GatewayConnectReasonColdStart = "COLD_START"
)

Gateway protocol constants, as used by the web client (build 673869, which the desktop app also runs) and discord.py-self.

View Source
const (
	OpDispatch                           = 0  // receive: event dispatch
	OpHeartbeat                          = 1  // send (legacy keepalive) / receive (server asks for a beat now)
	OpIdentify                           = 2  // send
	OpPresenceUpdate                     = 3  // send
	OpVoiceStateUpdate                   = 4  // send
	OpVoiceServerPing                    = 5  // send
	OpResume                             = 6  // send
	OpReconnect                          = 7  // receive
	OpRequestGuildMembers                = 8  // send
	OpInvalidSession                     = 9  // receive
	OpHello                              = 10 // receive
	OpHeartbeatAck                       = 11 // receive
	OpCallConnect                        = 13 // send
	OpGuildSubscriptions                 = 14 // send (legacy; the web client sends op 37)
	OpStreamCreate                       = 18 // send
	OpStreamDelete                       = 19 // send
	OpStreamWatch                        = 20 // send
	OpStreamPing                         = 21 // send
	OpStreamSetPaused                    = 22 // send
	OpRequestGuildApplicationCommands    = 24 // send (no send site in either reference)
	OpRequestForumUnreads                = 28 // send
	OpRemoteCommand                      = 29 // send
	OpGetDeletedEntityIDsNotMatchingHash = 30 // send
	OpRequestSoundboardSounds            = 31 // send
	OpRequestLastMessages                = 34 // send
	OpSearchRecentMembers                = 35 // send
	OpGuildSubscriptionsBulk             = 37 // send
	OpGuildChannelsResync                = 38 // send
	OpRequestChannelMemberCount          = 39 // send
	OpQOSHeartbeat                       = 40 // send: the current keepalive
	OpUpdateTimeSpentSessionID           = 41 // send
	OpRequestChannelInfo                 = 43 // send

	// OpStatusUpdate is the historical name of OpPresenceUpdate.
	//
	// Deprecated: use OpPresenceUpdate.
	OpStatusUpdate = OpPresenceUpdate
	// OpDMUpdate is the historical name of opcode 13, which every client names
	// CALL_CONNECT.
	//
	// Deprecated: use OpCallConnect.
	OpDMUpdate = OpCallConnect
)

Gateway opcodes, named as the clients name them. The comment says who sends it.

View Source
const (
	CloseUnknownError         = 4000
	CloseUnknownOpcode        = 4001
	CloseDecodeError          = 4002
	CloseNotAuthenticated     = 4003
	CloseAuthenticationFailed = 4004
	CloseAlreadyAuthenticated = 4005
	CloseInvalidSeq           = 4007
	CloseRateLimited          = 4008
	CloseSessionTimedOut      = 4009
	CloseInvalidShard         = 4010
	CloseShardingRequired     = 4011
	CloseInvalidAPIVersion    = 4012
	CloseInvalidIntents       = 4013
	CloseDisallowedIntents    = 4014
)

Gateway close codes.

View Source
const (
	// CapabilitiesDiscordPySelf is what discord.py-self sends (22525). It is the
	// default because it only uses named bits whose effect on READY is known.
	CapabilitiesDiscordPySelf = CapabilityLazyUserNotes | CapabilityVersionedReadStates |
		CapabilityVersionedUserGuildSettings | CapabilityDedupeUserObjects | CapabilityPrioritizedReadyPayload |
		CapabilityMultipleGuildExperimentPopulation | CapabilityNonChannelReadStates | CapabilityAuthTokenRefresh |
		CapabilityUserSettingsProto | CapabilityClientStateV2 | CapabilityAutoCallConnect | CapabilityPassiveGuildUpdateV2

	// CapabilitiesWeb is what the web and desktop clients send (1734653). It adds
	// CapabilityDebounceMessageReactions and the unnamed bits 17, 19 and 20, which
	// may change payload shapes in ways nobody has verified against this library.
	CapabilitiesWeb = CapabilitiesDiscordPySelf | CapabilityDebounceMessageReactions |
		CapabilityUnnamedBit17 | CapabilityUnnamedBit19 | CapabilityUnnamedBit20

	// CapabilitiesWebChannelObfuscation is what the web client sends when the
	// "2026-02-private-channel-hiding" experiment enables obfuscation (1767421).
	CapabilitiesWebChannelObfuscation = CapabilitiesWeb | CapabilityUnnamedBit15

	// CapabilitiesDefault is sent when GatewayOptions.Capabilities is zero.
	CapabilitiesDefault = CapabilitiesDiscordPySelf
)

Capability presets.

View Source
const (
	DiscordClientBuildNumber = 673869
	DiscordClientVersion     = "1.0.9268" // Windows desktop app version (client_version)
	DiscordMacClientVersion  = "0.0.421"
	DiscordLinuxClientVer    = "1.0.169"
	DiscordElectronVersion   = "44.10.2"
	DiscordChromeVersion     = "158.0.0.0"
	DiscordOSVersion         = "10.0.19045" // Windows os_version as reported by Electron

	// DiscordBrowserVersion is the desktop app version.
	// Deprecated: use DiscordClientVersion. Kept for compatibility.
	DiscordBrowserVersion = DiscordClientVersion

	// DefaultPropertiesURL is the base URL of the cordapi info service.
	DefaultPropertiesURL = "https://cordapi.dolfi.es"
)

Built-in fallback values, used when neither cordapi nor discord.com can be reached. Values as of 2026-11-16.

View Source
const (
	PropertiesSourceCordAPI   = "cordapi"     // cordapi /api/v2/properties/{type}
	PropertiesSourceCordAPIv1 = "cordapi-v1"  // cordapi /api/v1/properties/web (build number only)
	PropertiesSourceScrape    = "discord.com" // build number scraped from discord.com/login
	PropertiesSourceBuiltin   = "builtin"     // compiled-in constants

)

Property sources, as reported in ClientProperties.Source.

View Source
const DefaultGuildTemplateCode = "2TffvPucqHkN"

DefaultGuildTemplateCode is the template code discord.py-self creates guilds from.

Variables

View Source
var (
	// EvInitialGuild decodes INITIAL_GUILD (shape: web).
	EvInitialGuild = defineEvent[GatewayGuild](EventInitialGuild)
	// EvReadySupplemental decodes READY_SUPPLEMENTAL (shape: discord.py-self, web, captured).
	EvReadySupplemental = defineEvent[ReadySupplementalEvent](EventReadySupplemental)
	// EvReady decodes READY (shape: discord.py-self, web, captured).
	EvReady = defineEvent[ReadyPayload](EventReady)
	// EvStateUpdate decodes STATE_UPDATE (shape: web).
	EvStateUpdate = defineEvent[StateUpdateEvent](EventStateUpdate)
	// EvExperimentSessionOverrideCreate decodes EXPERIMENT_SESSION_OVERRIDE_CREATE (shape: web).
	EvExperimentSessionOverrideCreate = defineEvent[ExperimentSessionOverrideEvent](EventExperimentSessionOverrideCreate)
	// EvExperimentSessionOverrideDelete decodes EXPERIMENT_SESSION_OVERRIDE_DELETE (shape: web).
	EvExperimentSessionOverrideDelete = defineEvent[ExperimentSessionOverrideEvent](EventExperimentSessionOverrideDelete)
	// EvResumed decodes RESUMED (shape: discord.py-self, web).
	EvResumed = defineEvent[ResumedEvent](EventResumed)
	// EvTypingStart decodes TYPING_START (shape: discord.py-self, web).
	EvTypingStart = defineEvent[TypingStartEvent](EventTypingStart)
	// EvActivityStart decodes ACTIVITY_START (shape: web).
	EvActivityStart = defineEvent[ActivityStartEvent](EventActivityStart)
	// EvActivityUserAction decodes ACTIVITY_USER_ACTION (shape: web).
	EvActivityUserAction = defineEvent[ActivityUserActionEvent](EventActivityUserAction)
	// EvMessageCreate decodes MESSAGE_CREATE (shape: discord.py-self, web, captured).
	EvMessageCreate = defineEvent[Message](EventMessageCreate)
	// EvMessageUpdate decodes MESSAGE_UPDATE (shape: discord.py-self, web, captured).
	EvMessageUpdate = defineEvent[Message](EventMessageUpdate)
	// EvMessageDelete decodes MESSAGE_DELETE (shape: discord.py-self, web, captured).
	EvMessageDelete = defineEvent[MessageDeleteEvent](EventMessageDelete)
	// EvMessageDeleteBulk decodes MESSAGE_DELETE_BULK (shape: discord.py-self, web).
	EvMessageDeleteBulk = defineEvent[MessageDeleteBulkEvent](EventMessageDeleteBulk)
	// EvMessageAck decodes MESSAGE_ACK (shape: discord.py-self, web).
	EvMessageAck = defineEvent[MessageAckEvent](EventMessageAck)
	// EvGuildFeatureAck decodes GUILD_FEATURE_ACK (shape: discord.py-self, web).
	EvGuildFeatureAck = defineEvent[NonChannelAckEvent](EventGuildFeatureAck)
	// EvUserNonChannelAck decodes USER_NON_CHANNEL_ACK (shape: discord.py-self, web).
	EvUserNonChannelAck = defineEvent[NonChannelAckEvent](EventUserNonChannelAck)
	// EvConjuringProjectCreateProgress decodes CONJURING_PROJECT_CREATE_PROGRESS (shape: web).
	EvConjuringProjectCreateProgress = defineEvent[ConjuringProjectCreateProgressEvent](EventConjuringProjectCreateProgress)
	// EvConjuringProjectUpdate decodes CONJURING_PROJECT_UPDATE (shape: web).
	EvConjuringProjectUpdate = defineEvent[ConjuringProjectUpdateEvent](EventConjuringProjectUpdate)
	// EvApplicationFrameUpdate decodes APPLICATION_FRAME_UPDATE (shape: web).
	EvApplicationFrameUpdate = defineEvent[ApplicationFrameUpdateEvent](EventApplicationFrameUpdate)
	// EvConjuringTurnSettled decodes CONJURING_TURN_SETTLED (shape: web).
	EvConjuringTurnSettled = defineEvent[ConjuringTurnSettledEvent](EventConjuringTurnSettled)
	// EvChannelPinsAck decodes CHANNEL_PINS_ACK (shape: discord.py-self, web).
	EvChannelPinsAck = defineEvent[ChannelPinsAckEvent](EventChannelPinsAck)
	// EvChannelPinsUpdate decodes CHANNEL_PINS_UPDATE (shape: discord.py-self, web).
	EvChannelPinsUpdate = defineEvent[ChannelPinsUpdateEvent](EventChannelPinsUpdate)
	// EvChannelCreate decodes CHANNEL_CREATE (shape: discord.py-self, web).
	EvChannelCreate = defineEvent[Channel](EventChannelCreate)
	// EvChannelDelete decodes CHANNEL_DELETE (shape: discord.py-self, web).
	EvChannelDelete = defineEvent[Channel](EventChannelDelete)
	// EvVoiceChannelStatusUpdate decodes VOICE_CHANNEL_STATUS_UPDATE (shape: web).
	EvVoiceChannelStatusUpdate = defineEvent[VoiceChannelStatusUpdateEvent](EventVoiceChannelStatusUpdate)
	// EvVoiceChannelStartTimeUpdate decodes VOICE_CHANNEL_START_TIME_UPDATE (shape: web).
	EvVoiceChannelStartTimeUpdate = defineEvent[VoiceChannelStartTimeUpdateEvent](EventVoiceChannelStartTimeUpdate)
	// EvChannelInfo decodes CHANNEL_INFO (shape: web).
	EvChannelInfo = defineEvent[ChannelInfoEvent](EventChannelInfo)
	// EvChannelMemberCountUpdate decodes CHANNEL_MEMBER_COUNT_UPDATE (shape: web).
	EvChannelMemberCountUpdate = defineEvent[ChannelMemberCountUpdateEvent](EventChannelMemberCountUpdate)
	// EvChannelUpdate decodes CHANNEL_UPDATE (shape: discord.py-self, web, captured).
	EvChannelUpdate = defineEvent[Channel](EventChannelUpdate)
	// EvThreadCreate decodes THREAD_CREATE (shape: discord.py-self, web).
	EvThreadCreate = defineEvent[ThreadEvent](EventThreadCreate)
	// EvThreadUpdate decodes THREAD_UPDATE (shape: discord.py-self, web).
	EvThreadUpdate = defineEvent[ThreadEvent](EventThreadUpdate)
	// EvThreadDelete decodes THREAD_DELETE (shape: discord.py-self, web).
	EvThreadDelete = defineEvent[ThreadDeleteEvent](EventThreadDelete)
	// EvThreadListSync decodes THREAD_LIST_SYNC (shape: discord.py-self, web).
	EvThreadListSync = defineEvent[ThreadListSyncEvent](EventThreadListSync)
	// EvThreadMemberUpdate decodes THREAD_MEMBER_UPDATE (shape: discord.py-self, web).
	EvThreadMemberUpdate = defineEvent[ThreadMemberUpdateEvent](EventThreadMemberUpdate)
	// EvThreadMembersUpdate decodes THREAD_MEMBERS_UPDATE (shape: discord.py-self, web).
	EvThreadMembersUpdate = defineEvent[ThreadMembersUpdateEvent](EventThreadMembersUpdate)
	// EvForumUnreads decodes FORUM_UNREADS (shape: web).
	EvForumUnreads = defineEvent[ForumUnreadsEvent](EventForumUnreads)
	// EvSoundboardSounds decodes SOUNDBOARD_SOUNDS (shape: web).
	EvSoundboardSounds = defineEvent[SoundboardSoundsEvent](EventSoundboardSounds)
	// EvChannelRecipientAdd decodes CHANNEL_RECIPIENT_ADD (shape: discord.py-self, web).
	EvChannelRecipientAdd = defineEvent[ChannelRecipientEvent](EventChannelRecipientAdd)
	// EvChannelRecipientRemove decodes CHANNEL_RECIPIENT_REMOVE (shape: discord.py-self, web).
	EvChannelRecipientRemove = defineEvent[ChannelRecipientEvent](EventChannelRecipientRemove)
	// EvGuildCreate decodes GUILD_CREATE (shape: discord.py-self, web).
	EvGuildCreate = defineEvent[GatewayGuild](EventGuildCreate)
	// EvGuildUpdate decodes GUILD_UPDATE (shape: discord.py-self, web).
	EvGuildUpdate = defineEvent[GatewayGuild](EventGuildUpdate)
	// EvGuildPruneUpdate decodes GUILD_PRUNE_UPDATE (shape: web).
	EvGuildPruneUpdate = defineEvent[GuildPruneUpdateEvent](EventGuildPruneUpdate)
	// EvGuildBulkBanUpdate decodes GUILD_BULK_BAN_UPDATE (shape: web).
	EvGuildBulkBanUpdate = defineEvent[GuildBulkBanUpdateEvent](EventGuildBulkBanUpdate)
	// EvGuildDelete decodes GUILD_DELETE (shape: discord.py-self, web).
	EvGuildDelete = defineEvent[GuildDeleteEvent](EventGuildDelete)
	// EvGuildMembersChunk decodes GUILD_MEMBERS_CHUNK (shape: discord.py-self, web).
	EvGuildMembersChunk = defineEvent[GuildMembersChunkEvent](EventGuildMembersChunk)
	// EvThreadMemberListUpdate decodes THREAD_MEMBER_LIST_UPDATE (shape: discord.py-self, web).
	EvThreadMemberListUpdate = defineEvent[ThreadMemberListUpdateEvent](EventThreadMemberListUpdate)
	// EvGuildBanAdd decodes GUILD_BAN_ADD (shape: discord.py-self, web).
	EvGuildBanAdd = defineEvent[GuildBanEvent](EventGuildBanAdd)
	// EvGuildBanRemove decodes GUILD_BAN_REMOVE (shape: discord.py-self, web).
	EvGuildBanRemove = defineEvent[GuildBanEvent](EventGuildBanRemove)
	// EvGuildMemberAdd decodes GUILD_MEMBER_ADD (shape: discord.py-self, web).
	EvGuildMemberAdd = defineEvent[GuildMemberEvent](EventGuildMemberAdd)
	// EvGuildMemberUpdate decodes GUILD_MEMBER_UPDATE (shape: discord.py-self, web).
	EvGuildMemberUpdate = defineEvent[GuildMemberEvent](EventGuildMemberUpdate)
	// EvGuildMemberRemove decodes GUILD_MEMBER_REMOVE (shape: discord.py-self, web).
	EvGuildMemberRemove = defineEvent[GuildMemberRemoveEvent](EventGuildMemberRemove)
	// EvGuildRoleCreate decodes GUILD_ROLE_CREATE (shape: discord.py-self, web).
	EvGuildRoleCreate = defineEvent[GuildRoleEvent](EventGuildRoleCreate)
	// EvGuildRoleUpdate decodes GUILD_ROLE_UPDATE (shape: discord.py-self, web).
	EvGuildRoleUpdate = defineEvent[GuildRoleEvent](EventGuildRoleUpdate)
	// EvGuildRoleDelete decodes GUILD_ROLE_DELETE (shape: discord.py-self, web).
	EvGuildRoleDelete = defineEvent[GuildRoleDeleteEvent](EventGuildRoleDelete)
	// EvGuildEmojisUpdate decodes GUILD_EMOJIS_UPDATE (shape: discord.py-self, web).
	EvGuildEmojisUpdate = defineEvent[GuildEmojisUpdateEvent](EventGuildEmojisUpdate)
	// EvGuildStickersUpdate decodes GUILD_STICKERS_UPDATE (shape: discord.py-self, web).
	EvGuildStickersUpdate = defineEvent[GuildStickersUpdateEvent](EventGuildStickersUpdate)
	// EvGuildIntegrationsUpdate decodes GUILD_INTEGRATIONS_UPDATE (shape: discord.py-self, web).
	EvGuildIntegrationsUpdate = defineEvent[GuildIntegrationsUpdateEvent](EventGuildIntegrationsUpdate)
	// EvIntegrationCreate decodes INTEGRATION_CREATE (shape: discord.py-self, web).
	EvIntegrationCreate = defineEvent[IntegrationEvent](EventIntegrationCreate)
	// EvIntegrationUpdate decodes INTEGRATION_UPDATE (shape: discord.py-self, web).
	EvIntegrationUpdate = defineEvent[IntegrationEvent](EventIntegrationUpdate)
	// EvIntegrationDelete decodes INTEGRATION_DELETE (shape: discord.py-self, web).
	EvIntegrationDelete = defineEvent[IntegrationDeleteEvent](EventIntegrationDelete)
	// EvUserUpdate decodes USER_UPDATE (shape: discord.py-self, web).
	EvUserUpdate = defineEvent[User](EventUserUpdate)
	// EvUserSettingsProtoUpdate decodes USER_SETTINGS_PROTO_UPDATE (shape: discord.py-self, web).
	EvUserSettingsProtoUpdate = defineEvent[UserSettingsProtoUpdateEvent](EventUserSettingsProtoUpdate)
	// EvUserGuildSettingsUpdate decodes USER_GUILD_SETTINGS_UPDATE (shape: discord.py-self, web).
	EvUserGuildSettingsUpdate = defineEvent[UserGuildSettings](EventUserGuildSettingsUpdate)
	// EvUserConnectionsUpdate decodes USER_CONNECTIONS_UPDATE (shape: discord.py-self, web).
	EvUserConnectionsUpdate = defineEvent[UserConnectionsUpdateEvent](EventUserConnectionsUpdate)
	// EvUserRequiredActionUpdate decodes USER_REQUIRED_ACTION_UPDATE (shape: discord.py-self, web).
	EvUserRequiredActionUpdate = defineEvent[RequiredActionUpdateEvent](EventUserRequiredActionUpdate)
	// EvUserNoteUpdate decodes USER_NOTE_UPDATE (shape: discord.py-self, web).
	EvUserNoteUpdate = defineEvent[UserNoteUpdateEvent](EventUserNoteUpdate)
	// EvRelationshipAdd decodes RELATIONSHIP_ADD (shape: discord.py-self, web).
	EvRelationshipAdd = defineEvent[RelationshipEvent](EventRelationshipAdd)
	// EvRelationshipRemove decodes RELATIONSHIP_REMOVE (shape: discord.py-self, web).
	EvRelationshipRemove = defineEvent[RelationshipEvent](EventRelationshipRemove)
	// EvRelationshipUpdate decodes RELATIONSHIP_UPDATE (shape: discord.py-self, web).
	EvRelationshipUpdate = defineEvent[RelationshipEvent](EventRelationshipUpdate)
	// EvGameRelationshipAdd decodes GAME_RELATIONSHIP_ADD (shape: web).
	EvGameRelationshipAdd = defineEvent[GameRelationshipEvent](EventGameRelationshipAdd)
	// EvGameRelationshipRemove decodes GAME_RELATIONSHIP_REMOVE (shape: web).
	EvGameRelationshipRemove = defineEvent[GameRelationshipRemoveEvent](EventGameRelationshipRemove)
	// EvPresenceUpdate decodes PRESENCE_UPDATE (shape: discord.py-self, web, captured).
	EvPresenceUpdate = defineEvent[PresenceUpdateEvent](EventPresenceUpdate)
	// EvPresencesReplace decodes PRESENCES_REPLACE (shape: discord.py-self, web).
	EvPresencesReplace = defineEvent[PresencesReplaceEvent](EventPresencesReplace)
	// EvSessionsReplace decodes SESSIONS_REPLACE (shape: discord.py-self, web, captured).
	EvSessionsReplace = defineEvent[SessionsReplaceEvent](EventSessionsReplace)
	// EvVoiceStateUpdate decodes VOICE_STATE_UPDATE (shape: discord.py-self, web, captured).
	EvVoiceStateUpdate = defineEvent[VoiceState](EventVoiceStateUpdate)
	// EvVoiceStateUpdateBatch decodes VOICE_STATE_UPDATE_BATCH (shape: web).
	EvVoiceStateUpdateBatch = defineEvent[VoiceStateUpdateBatchEvent](EventVoiceStateUpdateBatch)
	// EvVoiceServerUpdate decodes VOICE_SERVER_UPDATE (shape: discord.py-self, web).
	EvVoiceServerUpdate = defineEvent[VoiceServerUpdate](EventVoiceServerUpdate)
	// EvCallCreate decodes CALL_CREATE (shape: discord.py-self, web).
	EvCallCreate = defineEvent[CallCreateEvent](EventCallCreate)
	// EvCallUpdate decodes CALL_UPDATE (shape: discord.py-self, web).
	EvCallUpdate = defineEvent[CallUpdateEvent](EventCallUpdate)
	// EvCallDelete decodes CALL_DELETE (shape: discord.py-self, web).
	EvCallDelete = defineEvent[CallDeleteEvent](EventCallDelete)
	// EvOAuth2TokenCreate decodes OAUTH2_TOKEN_CREATE (shape: web).
	EvOAuth2TokenCreate = defineEvent[OAuth2TokenCreateEvent](EventOAuth2TokenCreate)
	// EvOAuth2TokenDelete decodes OAUTH2_TOKEN_DELETE (shape: web).
	EvOAuth2TokenDelete = defineEvent[OAuth2TokenDeleteEvent](EventOAuth2TokenDelete)
	// EvOAuth2TokenRevoke decodes OAUTH2_TOKEN_REVOKE (shape: discord.py-self, web).
	EvOAuth2TokenRevoke = defineEvent[OAuth2TokenRevokeEvent](EventOAuth2TokenRevoke)
	// EvRecentMentionDelete decodes RECENT_MENTION_DELETE (shape: discord.py-self, web).
	EvRecentMentionDelete = defineEvent[RecentMentionDeleteEvent](EventRecentMentionDelete)
	// EvFriendSuggestionCreate decodes FRIEND_SUGGESTION_CREATE (shape: discord.py-self, web).
	EvFriendSuggestionCreate = defineEvent[FriendSuggestion](EventFriendSuggestionCreate)
	// EvFriendSuggestionDelete decodes FRIEND_SUGGESTION_DELETE (shape: discord.py-self, web).
	EvFriendSuggestionDelete = defineEvent[FriendSuggestionDeleteEvent](EventFriendSuggestionDelete)
	// EvWebhooksUpdate decodes WEBHOOKS_UPDATE (shape: discord.py-self, web).
	EvWebhooksUpdate = defineEvent[WebhooksUpdateEvent](EventWebhooksUpdate)
	// EvMessageReactionAdd decodes MESSAGE_REACTION_ADD (shape: discord.py-self, web, captured).
	EvMessageReactionAdd = defineEvent[MessageReactionEvent](EventMessageReactionAdd)
	// EvMessageReactionRemove decodes MESSAGE_REACTION_REMOVE (shape: discord.py-self, web).
	EvMessageReactionRemove = defineEvent[MessageReactionEvent](EventMessageReactionRemove)
	// EvMessagePollVoteAdd decodes MESSAGE_POLL_VOTE_ADD (shape: discord.py-self, web).
	EvMessagePollVoteAdd = defineEvent[MessagePollVoteEvent](EventMessagePollVoteAdd)
	// EvMessagePollVoteRemove decodes MESSAGE_POLL_VOTE_REMOVE (shape: discord.py-self, web).
	EvMessagePollVoteRemove = defineEvent[MessagePollVoteEvent](EventMessagePollVoteRemove)
	// EvMessagePollVoteAddMany decodes MESSAGE_POLL_VOTE_ADD_MANY (shape: web).
	EvMessagePollVoteAddMany = defineEvent[MessagePollVoteAddManyEvent](EventMessagePollVoteAddMany)
	// EvMessageReactionRemoveAll decodes MESSAGE_REACTION_REMOVE_ALL (shape: discord.py-self, web).
	EvMessageReactionRemoveAll = defineEvent[MessageReactionRemoveAllEvent](EventMessageReactionRemoveAll)
	// EvMessageReactionRemoveEmoji decodes MESSAGE_REACTION_REMOVE_EMOJI (shape: discord.py-self, web).
	EvMessageReactionRemoveEmoji = defineEvent[MessageReactionRemoveEmojiEvent](EventMessageReactionRemoveEmoji)
	// EvMessageReactionAddMany decodes MESSAGE_REACTION_ADD_MANY (shape: discord.py-self, web).
	EvMessageReactionAddMany = defineEvent[MessageReactionAddManyEvent](EventMessageReactionAddMany)
	// EvPaymentUpdate decodes PAYMENT_UPDATE (shape: discord.py-self, web).
	EvPaymentUpdate = defineEvent[Payment](EventPaymentUpdate)
	// EvOrderUpdate decodes ORDER_UPDATE (shape: web).
	EvOrderUpdate = defineEvent[OrderUpdateEvent](EventOrderUpdate)
	// EvEntitlementCreate decodes ENTITLEMENT_CREATE (shape: discord.py-self, web).
	EvEntitlementCreate = defineEvent[Entitlement](EventEntitlementCreate)
	// EvEntitlementUpdate decodes ENTITLEMENT_UPDATE (shape: discord.py-self, web).
	EvEntitlementUpdate = defineEvent[Entitlement](EventEntitlementUpdate)
	// EvEntitlementDelete decodes ENTITLEMENT_DELETE (shape: discord.py-self, web).
	EvEntitlementDelete = defineEvent[Entitlement](EventEntitlementDelete)
	// EvUserPaymentSourcesUpdate decodes USER_PAYMENT_SOURCES_UPDATE (shape: discord.py-self, web).
	EvUserPaymentSourcesUpdate = defineEvent[EmptyEvent](EventUserPaymentSourcesUpdate)
	// EvUserSubscriptionsUpdate decodes USER_SUBSCRIPTIONS_UPDATE (shape: discord.py-self, web).
	EvUserSubscriptionsUpdate = defineEvent[EmptyEvent](EventUserSubscriptionsUpdate)
	// EvWishlistItemPurchased decodes WISHLIST_ITEM_PURCHASED (shape: web).
	EvWishlistItemPurchased = defineEvent[WishlistItemPurchasedEvent](EventWishlistItemPurchased)
	// EvUserBadgeStateUpdate decodes USER_BADGE_STATE_UPDATE (shape: web).
	EvUserBadgeStateUpdate = defineEvent[UserBadgeStateUpdateEvent](EventUserBadgeStateUpdate)
	// EvUserPremiumGuildSubscriptionSlotCreate decodes USER_PREMIUM_GUILD_SUBSCRIPTION_SLOT_CREATE (shape: discord.py-self, web).
	EvUserPremiumGuildSubscriptionSlotCreate = defineEvent[PremiumGuildSubscriptionSlot](EventUserPremiumGuildSubscriptionSlotCreate)
	// EvUserPremiumGuildSubscriptionSlotUpdate decodes USER_PREMIUM_GUILD_SUBSCRIPTION_SLOT_UPDATE (shape: discord.py-self, web).
	EvUserPremiumGuildSubscriptionSlotUpdate = defineEvent[PremiumGuildSubscriptionSlot](EventUserPremiumGuildSubscriptionSlotUpdate)
	// EvBillingPopupBridgeCallback decodes BILLING_POPUP_BRIDGE_CALLBACK (shape: discord.py-self, web).
	EvBillingPopupBridgeCallback = defineEvent[BillingPopupBridgeCallbackEvent](EventBillingPopupBridgeCallback)
	// EvUserPaymentBrowserCheckoutDone decodes USER_PAYMENT_BROWSER_CHECKOUT_DONE (shape: web).
	EvUserPaymentBrowserCheckoutDone = defineEvent[PaymentBrowserCheckoutDoneEvent](EventUserPaymentBrowserCheckoutDone)
	// EvUserPaymentClientAdd decodes USER_PAYMENT_CLIENT_ADD (shape: discord.py-self, web).
	EvUserPaymentClientAdd = defineEvent[PaymentClientAddEvent](EventUserPaymentClientAdd)
	// EvGuildMemberListUpdate decodes GUILD_MEMBER_LIST_UPDATE (shape: discord.py-self, web).
	EvGuildMemberListUpdate = defineEvent[GuildMemberListUpdateEvent](EventGuildMemberListUpdate)
	// EvGiftCodeUpdate decodes GIFT_CODE_UPDATE (shape: discord.py-self, web).
	EvGiftCodeUpdate = defineEvent[GatewayGift](EventGiftCodeUpdate)
	// EvGiftCodeCreate decodes GIFT_CODE_CREATE (shape: discord.py-self, web).
	EvGiftCodeCreate = defineEvent[GatewayGift](EventGiftCodeCreate)
	// EvLibraryApplicationUpdate decodes LIBRARY_APPLICATION_UPDATE (shape: discord.py-self, web).
	EvLibraryApplicationUpdate = defineEvent[LibraryApplication](EventLibraryApplicationUpdate)
	// EvStreamCreate decodes STREAM_CREATE (shape: discord.py-self, web).
	EvStreamCreate = defineEvent[StreamCreateEvent](EventStreamCreate)
	// EvStreamServerUpdate decodes STREAM_SERVER_UPDATE (shape: discord.py-self, web).
	EvStreamServerUpdate = defineEvent[StreamServerUpdateEvent](EventStreamServerUpdate)
	// EvStreamUpdate decodes STREAM_UPDATE (shape: discord.py-self, web).
	EvStreamUpdate = defineEvent[StreamEvent](EventStreamUpdate)
	// EvStreamDelete decodes STREAM_DELETE (shape: discord.py-self, web).
	EvStreamDelete = defineEvent[StreamDeleteEvent](EventStreamDelete)
	// EvGenericPushNotificationSent decodes GENERIC_PUSH_NOTIFICATION_SENT (shape: web).
	EvGenericPushNotificationSent = defineEvent[GenericPushNotificationSentEvent](EventGenericPushNotificationSent)
	// EvReactionNotificationSent decodes REACTION_NOTIFICATION_SENT (shape: web).
	EvReactionNotificationSent = defineEvent[ReactionNotificationSentEvent](EventReactionNotificationSent)
	// EvNotificationCenterItemDelete decodes NOTIFICATION_CENTER_ITEM_DELETE (shape: web).
	EvNotificationCenterItemDelete = defineEvent[NotificationCenterItemEvent](EventNotificationCenterItemDelete)
	// EvNotificationCenterItemsAck decodes NOTIFICATION_CENTER_ITEMS_ACK (shape: web).
	EvNotificationCenterItemsAck = defineEvent[NotificationCenterItemEvent](EventNotificationCenterItemsAck)
	// EvNotificationCenterItemCompleted decodes NOTIFICATION_CENTER_ITEM_COMPLETED (shape: web).
	EvNotificationCenterItemCompleted = defineEvent[NotificationCenterItemCompletedEvent](EventNotificationCenterItemCompleted)
	// EvQuestsUserStatusUpdate decodes QUESTS_USER_STATUS_UPDATE (shape: web).
	EvQuestsUserStatusUpdate = defineEvent[QuestsUserStatusUpdateEvent](EventQuestsUserStatusUpdate)
	// EvOrbsArcadeGameStateUpdate decodes ORBS_ARCADE_GAME_STATE_UPDATE (shape: web).
	EvOrbsArcadeGameStateUpdate = defineEvent[OrbsArcadeGameStateUpdateEvent](EventOrbsArcadeGameStateUpdate)
	// EvQuestsUserCompletionUpdate decodes QUESTS_USER_COMPLETION_UPDATE (shape: web).
	EvQuestsUserCompletionUpdate = defineEvent[QuestsUserCompletionUpdateEvent](EventQuestsUserCompletionUpdate)
	// EvQuestPreviewUpdate decodes QUEST_PREVIEW_UPDATE (shape: web).
	EvQuestPreviewUpdate = defineEvent[QuestPreviewUpdateEvent](EventQuestPreviewUpdate)
	// EvApplicationCommandPermissionsUpdate decodes APPLICATION_COMMAND_PERMISSIONS_UPDATE (shape: web).
	EvApplicationCommandPermissionsUpdate = defineEvent[GuildApplicationCommandPermissions](EventApplicationCommandPermissionsUpdate)
	// EvGuildApplicationCommandIndexUpdate decodes GUILD_APPLICATION_COMMAND_INDEX_UPDATE (shape: discord.py-self, web).
	EvGuildApplicationCommandIndexUpdate = defineEvent[GuildApplicationCommandIndexUpdateEvent](EventGuildApplicationCommandIndexUpdate)
	// EvGuildJoinRequestCreate decodes GUILD_JOIN_REQUEST_CREATE (shape: discord.py-self, web).
	EvGuildJoinRequestCreate = defineEvent[GuildJoinRequestEvent](EventGuildJoinRequestCreate)
	// EvGuildJoinRequestUpdate decodes GUILD_JOIN_REQUEST_UPDATE (shape: discord.py-self, web).
	EvGuildJoinRequestUpdate = defineEvent[GuildJoinRequestEvent](EventGuildJoinRequestUpdate)
	// EvGuildJoinRequestDelete decodes GUILD_JOIN_REQUEST_DELETE (shape: discord.py-self, web).
	EvGuildJoinRequestDelete = defineEvent[GuildJoinRequestDeleteEvent](EventGuildJoinRequestDelete)
	// EvInteractionCreate decodes INTERACTION_CREATE (shape: discord.py-self, web).
	EvInteractionCreate = defineEvent[InteractionEvent](EventInteractionCreate)
	// EvInteractionSuccess decodes INTERACTION_SUCCESS (shape: discord.py-self, web).
	EvInteractionSuccess = defineEvent[InteractionEvent](EventInteractionSuccess)
	// EvInteractionFailure decodes INTERACTION_FAILURE (shape: discord.py-self, web).
	EvInteractionFailure = defineEvent[InteractionFailureEvent](EventInteractionFailure)
	// EvApplicationCommandAutocompleteResponse decodes APPLICATION_COMMAND_AUTOCOMPLETE_RESPONSE (shape: discord.py-self, web).
	EvApplicationCommandAutocompleteResponse = defineEvent[ApplicationCommandAutocompleteEvent](EventApplicationCommandAutocompleteResponse)
	// EvInteractionModalCreate decodes INTERACTION_MODAL_CREATE (shape: discord.py-self, web).
	EvInteractionModalCreate = defineEvent[InteractionModalCreateEvent](EventInteractionModalCreate)
	// EvInteractionIframeModalCreate decodes INTERACTION_IFRAME_MODAL_CREATE (shape: discord.py-self, web).
	EvInteractionIframeModalCreate = defineEvent[InteractionIframeModalCreateEvent](EventInteractionIframeModalCreate)
	// EvStageInstanceCreate decodes STAGE_INSTANCE_CREATE (shape: discord.py-self, web).
	EvStageInstanceCreate = defineEvent[StageInstance](EventStageInstanceCreate)
	// EvStageInstanceUpdate decodes STAGE_INSTANCE_UPDATE (shape: discord.py-self, web).
	EvStageInstanceUpdate = defineEvent[StageInstance](EventStageInstanceUpdate)
	// EvStageInstanceDelete decodes STAGE_INSTANCE_DELETE (shape: discord.py-self, web).
	EvStageInstanceDelete = defineEvent[StageInstance](EventStageInstanceDelete)
	// EvGuildScheduledEventCreate decodes GUILD_SCHEDULED_EVENT_CREATE (shape: discord.py-self, web).
	EvGuildScheduledEventCreate = defineEvent[GuildScheduledEvent](EventGuildScheduledEventCreate)
	// EvGuildScheduledEventUpdate decodes GUILD_SCHEDULED_EVENT_UPDATE (shape: discord.py-self, web).
	EvGuildScheduledEventUpdate = defineEvent[GuildScheduledEvent](EventGuildScheduledEventUpdate)
	// EvGuildScheduledEventDelete decodes GUILD_SCHEDULED_EVENT_DELETE (shape: discord.py-self, web).
	EvGuildScheduledEventDelete = defineEvent[GuildScheduledEvent](EventGuildScheduledEventDelete)
	// EvGuildScheduledEventUserAdd decodes GUILD_SCHEDULED_EVENT_USER_ADD (shape: discord.py-self, web).
	EvGuildScheduledEventUserAdd = defineEvent[GuildScheduledEventUserEvent](EventGuildScheduledEventUserAdd)
	// EvGuildScheduledEventUserRemove decodes GUILD_SCHEDULED_EVENT_USER_REMOVE (shape: discord.py-self, web).
	EvGuildScheduledEventUserRemove = defineEvent[GuildScheduledEventUserEvent](EventGuildScheduledEventUserRemove)
	// EvGuildDirectoryEntryCreate decodes GUILD_DIRECTORY_ENTRY_CREATE (shape: discord.py-self, web).
	EvGuildDirectoryEntryCreate = defineEvent[DirectoryEntryEvent](EventGuildDirectoryEntryCreate)
	// EvGuildDirectoryEntryUpdate decodes GUILD_DIRECTORY_ENTRY_UPDATE (shape: discord.py-self, web).
	EvGuildDirectoryEntryUpdate = defineEvent[DirectoryEntryEvent](EventGuildDirectoryEntryUpdate)
	// EvGuildDirectoryEntryDelete decodes GUILD_DIRECTORY_ENTRY_DELETE (shape: discord.py-self, web).
	EvGuildDirectoryEntryDelete = defineEvent[DirectoryEntryDeleteEvent](EventGuildDirectoryEntryDelete)
	// EvAutoModerationMentionRaidDetection decodes AUTO_MODERATION_MENTION_RAID_DETECTION (shape: web).
	EvAutoModerationMentionRaidDetection = defineEvent[AutoModerationMentionRaidDetectionEvent](EventAutoModerationMentionRaidDetection)
	// EvAutoModerationContentDeleted decodes AUTO_MODERATION_CONTENT_DELETED (shape: web).
	EvAutoModerationContentDeleted = defineEvent[AutoModerationContentDeletedEvent](EventAutoModerationContentDeleted)
	// EvVoiceChannelEffectSend decodes VOICE_CHANNEL_EFFECT_SEND (shape: web).
	EvVoiceChannelEffectSend = defineEvent[VoiceChannelEffectSendEvent](EventVoiceChannelEffectSend)
	// EvClipsRemoteTrigger decodes CLIPS_REMOTE_TRIGGER (shape: web).
	EvClipsRemoteTrigger = defineEvent[ClipsRemoteTriggerEvent](EventClipsRemoteTrigger)
	// EvGuildSoundboardSoundCreate decodes GUILD_SOUNDBOARD_SOUND_CREATE (shape: web).
	EvGuildSoundboardSoundCreate = defineEvent[SoundboardSound](EventGuildSoundboardSoundCreate)
	// EvGuildSoundboardSoundUpdate decodes GUILD_SOUNDBOARD_SOUND_UPDATE (shape: web).
	EvGuildSoundboardSoundUpdate = defineEvent[SoundboardSound](EventGuildSoundboardSoundUpdate)
	// EvGuildSoundboardSoundDelete decodes GUILD_SOUNDBOARD_SOUND_DELETE (shape: web).
	EvGuildSoundboardSoundDelete = defineEvent[GuildSoundboardSoundDeleteEvent](EventGuildSoundboardSoundDelete)
	// EvGuildSoundboardSoundsUpdate decodes GUILD_SOUNDBOARD_SOUNDS_UPDATE (shape: web).
	EvGuildSoundboardSoundsUpdate = defineEvent[SoundboardSoundsEvent](EventGuildSoundboardSoundsUpdate)
	// EvEmbeddedActivityUpdateV2 decodes EMBEDDED_ACTIVITY_UPDATE_V2 (shape: web).
	EvEmbeddedActivityUpdateV2 = defineEvent[EmbeddedActivityUpdateV2Event](EventEmbeddedActivityUpdateV2)
	// EvAuthSessionChange decodes AUTH_SESSION_CHANGE (shape: discord.py-self, web).
	EvAuthSessionChange = defineEvent[AuthSessionChangeEvent](EventAuthSessionChange)
	// EvUserConnectionsLinkCallback decodes USER_CONNECTIONS_LINK_CALLBACK (shape: discord.py-self, web).
	EvUserConnectionsLinkCallback = defineEvent[ConnectionsLinkCallbackEvent](EventUserConnectionsLinkCallback)
	// EvUserConnectionsCallback decodes USER_CONNECTIONS_CALLBACK (shape: web).
	EvUserConnectionsCallback = defineEvent[ConnectionsCallbackEvent](EventUserConnectionsCallback)
	// EvDeletedEntityIDs decodes DELETED_ENTITY_IDS (shape: web).
	EvDeletedEntityIDs = defineEvent[DeletedEntityIDsEvent](EventDeletedEntityIDs)
	// EvChannelSync decodes CHANNEL_SYNC (shape: web).
	EvChannelSync = defineEvent[ChannelSyncEvent](EventChannelSync)
	// EvConsoleCommandUpdate decodes CONSOLE_COMMAND_UPDATE (shape: web).
	EvConsoleCommandUpdate = defineEvent[ConsoleCommandUpdateEvent](EventConsoleCommandUpdate)
	// EvPassiveUpdateV2 decodes PASSIVE_UPDATE_V2 (shape: discord.py-self, web, captured).
	EvPassiveUpdateV2 = defineEvent[PassiveUpdateV2Event](EventPassiveUpdateV2)
	// EvCreatorMonetizationRestrictionsUpdate decodes CREATOR_MONETIZATION_RESTRICTIONS_UPDATE (shape: web).
	EvCreatorMonetizationRestrictionsUpdate = defineEvent[CreatorMonetizationRestrictionsUpdateEvent](EventCreatorMonetizationRestrictionsUpdate)
	// EvBillingReferralTrialOfferUpdate decodes BILLING_REFERRAL_TRIAL_OFFER_UPDATE (shape: web).
	EvBillingReferralTrialOfferUpdate = defineEvent[BillingReferralTrialOfferUpdateEvent](EventBillingReferralTrialOfferUpdate)
	// EvLastMessages decodes LAST_MESSAGES (shape: web).
	EvLastMessages = defineEvent[LastMessagesEvent](EventLastMessages)
	// EvNotificationSettingsUpdate decodes NOTIFICATION_SETTINGS_UPDATE (shape: web).
	EvNotificationSettingsUpdate = defineEvent[NotificationSettingsUpdateEvent](EventNotificationSettingsUpdate)
	// EvConversationSummaryUpdate decodes CONVERSATION_SUMMARY_UPDATE (shape: web, captured).
	EvConversationSummaryUpdate = defineEvent[ConversationSummaryUpdateEvent](EventConversationSummaryUpdate)
	// EvUserApplicationUpdate decodes USER_APPLICATION_UPDATE (shape: web).
	EvUserApplicationUpdate = defineEvent[UserApplicationEvent](EventUserApplicationUpdate)
	// EvUserApplicationRemove decodes USER_APPLICATION_REMOVE (shape: web).
	EvUserApplicationRemove = defineEvent[UserApplicationEvent](EventUserApplicationRemove)
	// EvDMSettingsUpsellShow decodes DM_SETTINGS_UPSELL_SHOW (shape: web).
	EvDMSettingsUpsellShow = defineEvent[DMSettingsUpsellShowEvent](EventDMSettingsUpsellShow)
	// EvContentInventoryInboxStale decodes CONTENT_INVENTORY_INBOX_STALE (shape: web).
	EvContentInventoryInboxStale = defineEvent[ContentInventoryInboxStaleEvent](EventContentInventoryInboxStale)
	// EvVirtualCurrencyBalanceUpdate decodes VIRTUAL_CURRENCY_BALANCE_UPDATE (shape: web).
	EvVirtualCurrencyBalanceUpdate = defineEvent[VirtualCurrencyBalanceUpdateEvent](EventVirtualCurrencyBalanceUpdate)
	// EvWalletBalanceUpdate decodes WALLET_BALANCE_UPDATE (shape: web).
	EvWalletBalanceUpdate = defineEvent[WalletBalanceUpdateEvent](EventWalletBalanceUpdate)
	// EvGuildPowerupEntitlementsCreate decodes GUILD_POWERUP_ENTITLEMENTS_CREATE (shape: web).
	EvGuildPowerupEntitlementsCreate = defineEvent[GuildPowerupEntitlementsEvent](EventGuildPowerupEntitlementsCreate)
	// EvGuildPowerupEntitlementsDelete decodes GUILD_POWERUP_ENTITLEMENTS_DELETE (shape: web).
	EvGuildPowerupEntitlementsDelete = defineEvent[GuildPowerupEntitlementsEvent](EventGuildPowerupEntitlementsDelete)
	// EvGameServerCreate decodes GAME_SERVER_CREATE (shape: web).
	EvGameServerCreate = defineEvent[GameServerEvent](EventGameServerCreate)
	// EvGameServerUpdate decodes GAME_SERVER_UPDATE (shape: web).
	EvGameServerUpdate = defineEvent[GameServerEvent](EventGameServerUpdate)
	// EvGameServerDelete decodes GAME_SERVER_DELETE (shape: web).
	EvGameServerDelete = defineEvent[GameServerDeleteEvent](EventGameServerDelete)
	// EvGuildAppliedBoostsUpdate decodes GUILD_APPLIED_BOOSTS_UPDATE (shape: web).
	EvGuildAppliedBoostsUpdate = defineEvent[GuildAppliedBoostsUpdateEvent](EventGuildAppliedBoostsUpdate)
	// EvUserApplicationIdentityUpdate decodes USER_APPLICATION_IDENTITY_UPDATE (shape: web).
	EvUserApplicationIdentityUpdate = defineEvent[UserApplicationIdentityEvent](EventUserApplicationIdentityUpdate)
	// EvUserApplicationIdentityRemove decodes USER_APPLICATION_IDENTITY_REMOVE (shape: web).
	EvUserApplicationIdentityRemove = defineEvent[UserApplicationIdentityEvent](EventUserApplicationIdentityRemove)
	// EvSocialLayerSKUPurchaseEligibilityResponse decodes SOCIAL_LAYER_SKU_PURCHASE_ELIGIBILITY_RESPONSE (shape: web).
	EvSocialLayerSKUPurchaseEligibilityResponse = defineEvent[SocialLayerSKUPurchaseEligibilityEvent](EventSocialLayerSKUPurchaseEligibilityResponse)
	// EvGuildRoomDisconnect decodes GUILD_ROOM_DISCONNECT (shape: web).
	EvGuildRoomDisconnect = defineEvent[GuildRoomDisconnectEvent](EventGuildRoomDisconnect)
	// EvGuildOfficialGameApplicationsUpdate decodes GUILD_OFFICIAL_GAME_APPLICATIONS_UPDATE (shape: web).
	EvGuildOfficialGameApplicationsUpdate = defineEvent[GuildOfficialGameApplicationsUpdateEvent](EventGuildOfficialGameApplicationsUpdate)
	// EvMessageRequestNotificationSent decodes MESSAGE_REQUEST_NOTIFICATION_SENT (shape: web).
	EvMessageRequestNotificationSent = defineEvent[MessageRequestNotificationSentEvent](EventMessageRequestNotificationSent)
	// EvAutoModerationActionExecution decodes AUTO_MODERATION_ACTION_EXECUTION (shape: discord.py-self).
	EvAutoModerationActionExecution = defineEvent[AutoModerationActionExecution](EventAutoModerationActionExecution)
	// EvAutoModerationRuleCreate decodes AUTO_MODERATION_RULE_CREATE (shape: discord.py-self).
	EvAutoModerationRuleCreate = defineEvent[AutoModerationRule](EventAutoModerationRuleCreate)
	// EvAutoModerationRuleDelete decodes AUTO_MODERATION_RULE_DELETE (shape: discord.py-self).
	EvAutoModerationRuleDelete = defineEvent[AutoModerationRule](EventAutoModerationRuleDelete)
	// EvAutoModerationRuleUpdate decodes AUTO_MODERATION_RULE_UPDATE (shape: discord.py-self).
	EvAutoModerationRuleUpdate = defineEvent[AutoModerationRule](EventAutoModerationRuleUpdate)
	// EvGuildAuditLogEntryCreate decodes GUILD_AUDIT_LOG_ENTRY_CREATE (shape: discord.py-self).
	EvGuildAuditLogEntryCreate = defineEvent[GuildAuditLogEntryCreateEvent](EventGuildAuditLogEntryCreate)
	// EvInteractionIframeModalClose decodes INTERACTION_IFRAME_MODAL_CLOSE (shape: discord.py-self).
	EvInteractionIframeModalClose = defineEvent[InteractionIframeModalCloseEvent](EventInteractionIframeModalClose)
	// EvInviteCreate decodes INVITE_CREATE (shape: discord.py-self).
	EvInviteCreate = defineEvent[InviteEvent](EventInviteCreate)
	// EvInviteDelete decodes INVITE_DELETE (shape: discord.py-self).
	EvInviteDelete = defineEvent[InviteDeleteEvent](EventInviteDelete)
	// EvPassiveUpdateV1 decodes PASSIVE_UPDATE_V1 (shape: discord.py-self).
	EvPassiveUpdateV1 = defineEvent[PassiveUpdateV1Event](EventPassiveUpdateV1)

	// EvTestEvent decodes TEST_EVENT.
	//
	// Deprecated: TEST_EVENT is not a Discord dispatch event.
	EvTestEvent = defineEvent[TestEvent](EventTestEvent)
)

Typed dispatch event descriptors, for use with On:

dsbotgo.On(ws, dsbotgo.EvMessageCreate, func(m *dsbotgo.Message) error { ... })

Shape sources: "discord.py-self" = types/gateway.py and state.py parsers; "web" = field names read by the web client's gateway dispatch table (build 673869), with Go types inferred (uncertain scalars are json.RawMessage); "captured" = also checked against an event captured from the live gateway.

View Source
var CDNEndpoints cdnCatalog

CDNEndpoints is the catalog of CDN asset routes. Paths are relative to https://cdn.discordapp.com.

View Source
var Endpoints endpointCatalog

Endpoints is the catalog: one method per endpoint. Paths are relative to the API root, except where the method documents an absolute URL.

View Source
var ErrGatewayClosed = errors.New("dsbotgo: gateway connection closed")

ErrGatewayClosed is returned by Err after Close.

View Source
var ErrUnknownDispatchEvent = errors.New("dsbotgo: no payload type for dispatch event")

ErrUnknownDispatchEvent is returned by DecodeDispatch for a name that has no payload type (unknown to this library, or known but raw-only).

View Source
var Opcodes = map[int]string{
	OpDispatch: "DISPATCH", OpHeartbeat: "HEARTBEAT", OpIdentify: "IDENTIFY", OpPresenceUpdate: "PRESENCE_UPDATE",
	OpVoiceStateUpdate: "VOICE_STATE_UPDATE", OpVoiceServerPing: "VOICE_SERVER_PING", OpResume: "RESUME",
	OpReconnect: "RECONNECT", OpRequestGuildMembers: "REQUEST_GUILD_MEMBERS", OpInvalidSession: "INVALID_SESSION",
	OpHello: "HELLO", OpHeartbeatAck: "HEARTBEAT_ACK", OpCallConnect: "CALL_CONNECT",
	OpGuildSubscriptions: "GUILD_SUBSCRIPTIONS", OpStreamCreate: "STREAM_CREATE", OpStreamDelete: "STREAM_DELETE",
	OpStreamWatch: "STREAM_WATCH", OpStreamPing: "STREAM_PING", OpStreamSetPaused: "STREAM_SET_PAUSED",
	OpRequestGuildApplicationCommands: "REQUEST_GUILD_APPLICATION_COMMANDS", OpRequestForumUnreads: "REQUEST_FORUM_UNREADS",
	OpRemoteCommand: "REMOTE_COMMAND", OpGetDeletedEntityIDsNotMatchingHash: "GET_DELETED_ENTITY_IDS_NOT_MATCHING_HASH",
	OpRequestSoundboardSounds: "REQUEST_SOUNDBOARD_SOUNDS", OpRequestLastMessages: "REQUEST_LAST_MESSAGES",
	OpSearchRecentMembers: "SEARCH_RECENT_MEMBERS", OpGuildSubscriptionsBulk: "GUILD_SUBSCRIPTIONS_BULK",
	OpGuildChannelsResync: "GUILD_CHANNELS_RESYNC", OpRequestChannelMemberCount: "REQUEST_CHANNEL_MEMBER_COUNT",
	OpQOSHeartbeat: "QOS_HEARTBEAT", OpUpdateTimeSpentSessionID: "UPDATE_TIME_SPENT_SESSION_ID",
	OpRequestChannelInfo: "REQUEST_CHANNEL_INFO",
}

Opcodes maps every gateway opcode to the name the clients use.

Functions

func AttachmentURL

func AttachmentURL(channelID, attachmentID, filename string) string

AttachmentURL builds a CDN URL for a message attachment Example: https://cdn.discordapp.com/attachments/{channel_id}/{attachment_id}/{filename}

func BoolPtr

func BoolPtr(b bool) *bool

BoolPtr returns a pointer to b; handy for optional parameters.

func BuildAcceptLanguage

func BuildAcceptLanguage(locale string) string

BuildAcceptLanguage derives the Accept-Language header from a locale the way Chromium formats navigator.languages: e.g. "en-US" -> "en-US,en;q=0.9".

func DecodeDispatch

func DecodeDispatch(name string, data []byte) (any, error)

DecodeDispatch decodes a dispatch payload into the type the events table assigns to name and returns a pointer to it (for example *Message for MESSAGE_CREATE). It returns ErrUnknownDispatchEvent when the name has no type.

func DecodeProtoSettings

func DecodeProtoSettings(s string) ([]byte, error)

DecodeProtoSettings decodes ProtoSettings.Settings into the serialized protobuf message. The message itself is not parsed (no protobuf dependency).

func DefaultUserAvatarURL

func DefaultUserAvatarURL(index int, size int) string

DefaultUserAvatarURL builds a URL for a default user avatar index [0..5) If discriminator is available (legacy), use int(discriminator) % 5. Otherwise compute id % 6 per Discord docs.

func DispatchPayloadType

func DispatchPayloadType(name string) (reflect.Type, bool)

DispatchPayloadType returns the Go type the events table assigns to name.

func EmojiURL

func EmojiURL(emojiID string, animated bool, format string) string

EmojiURL builds a CDN URL for a custom emoji Example: https://cdn.discordapp.com/emojis/{emoji_id}.{ext}

func EncodeProtoSettings

func EncodeProtoSettings(b []byte) string

EncodeProtoSettings base64-encodes a serialized protobuf message for EditProtoSettings.

func GuildBannerURL

func GuildBannerURL(guildID, bannerHash string, size int, format string, animated bool) string

GuildBannerURL builds a CDN URL for a guild banner

func GuildIconURL

func GuildIconURL(guildID, iconHash string, size int, format string, animated bool) string

GuildIconURL builds a CDN URL for a guild icon Example: https://cdn.discordapp.com/icons/{guild_id}/{icon_hash}.{ext}?size=1024

func GuildSplashURL

func GuildSplashURL(guildID, splashHash string, size int, format string) string

GuildSplashURL builds a CDN URL for a guild splash

func ImageDataURI

func ImageDataURI(data []byte) (string, error)

ImageDataURI encodes image bytes as a data URI ("data:image/png;base64,...") as expected by the avatar, banner and icon fields. PNG, JPEG, GIF and WebP are accepted.

func IntPtr

func IntPtr(n int) *int

IntPtr returns a pointer to n; handy for optional parameters.

func KnownDispatchEvents

func KnownDispatchEvents() []string

KnownDispatchEvents returns every dispatch event name the library knows: the web client's dispatch table (build 673869) plus the events discord.py-self handles that the web client does not.

func LogEventHandlerExample

func LogEventHandlerExample(ws *DiscordWebSocket)

LogEventHandlerExample demonstrates how to use event handlers with logging

func On

func On[T any](ws *DiscordWebSocket, ev Event[T], handler func(*T) error) (remove func())

On registers a typed handler for one dispatch event. The handler gets its own decoded copy of the payload. A payload that does not decode is reported to the log as a handler error; it never affects the connection or the other handlers. The returned function removes the handler.

dsbotgo.On(ws, dsbotgo.EvMessageCreate, func(m *dsbotgo.Message) error { ... })

func OnEvent

func OnEvent[T any](ws *DiscordWebSocket, name string, handler func(*T) error) (remove func())

OnEvent registers a handler that decodes the named dispatch event into a type of the caller's choosing. Use it for raw-only events, for names this library does not know, or to decode into a narrower struct than the table's.

func RawOnlyDispatchEvents

func RawOnlyDispatchEvents() []string

RawOnlyDispatchEvents returns the known names whose payload shape the references do not establish. They are delivered to AddEventHandler and catch-all handlers with the raw JSON.

func StringPtr

func StringPtr(s string) *string

StringPtr returns a pointer to s; handy for optional parameters.

func TypedDispatchEvents

func TypedDispatchEvents() []string

TypedDispatchEvents returns the names that have a payload type, sorted.

func UploadCloudAttachment

func UploadCloudAttachment(ctx context.Context, client *http.Client, att CloudAttachment, data []byte) error

UploadCloudAttachment PUTs data to the upload URL returned by GetAttachmentURLs. It talks to Google Cloud Storage directly (not the Discord API), without a Content-Type header and without credentials, retrying 5xx answers up to 5 times. client nil means http.DefaultClient.

PUT <upload_url> discord.py-self: upload_to_cloud

func UserAvatarURL

func UserAvatarURL(userID, avatarHash string, size int, format string, animated bool) string

UserAvatarURL builds a CDN URL for a user avatar If avatarHash is empty, you should use DefaultUserAvatarURL with discriminator or user ID modulo 5 Example: https://cdn.discordapp.com/avatars/{user_id}/{avatar_hash}.{ext}?size=1024

func UserBannerURL

func UserBannerURL(userID, bannerHash string, size int, format string, animated bool) string

UserBannerURL builds a CDN URL for a user banner Example: https://cdn.discordapp.com/banners/{user_id}/{banner_hash}.{ext}?size=2048

Types

type API

type API struct {
	// contains filtered or unexported fields
}

API is the transport-independent REST surface shared by TLSClient and BrowserClient.

func (*API) AcceptAgreements

func (a *API) AcceptAgreements(ctx context.Context, terms, privacy bool) error

AcceptAgreements accepts the terms of service and/or privacy policy.

PATCH /users/@me/agreements

func (*API) AcceptInvite

func (a *API) AcceptInvite(ctx context.Context, code string, typ InviteType, params *AcceptInviteParams) (*AcceptedInvite, error)

AcceptInvite accepts an invite by code. typ is the invite's type (from GetInvite); it only selects the context properties location.

POST /invites/{invite_id} discord.py-self: accept_invite

func (*API) AcceptMessageRequest

func (a *API) AcceptMessageRequest(ctx context.Context, channelID string) (*DMChannel, error)

AcceptMessageRequest accepts a DM message request (consent_status 2).

PUT /channels/{channel_id}/recipients/@me discord.py-self: accept_message_request

func (*API) AcceptOAuth2Allowlist

func (a *API) AcceptOAuth2Allowlist(ctx context.Context, token string) error

AcceptOAuth2Allowlist accepts an invitation to the allowlist of an application.

POST /oauth2/allowlist/accept

func (*API) AckBulk

func (a *API) AckBulk(ctx context.Context, readStates []BulkReadState) error

AckBulk marks several channels as read at once.

POST /read-states/ack-bulk discord.py-self: ack_bulk

func (*API) AckDMUpsellSettings

func (a *API) AckDMUpsellSettings(ctx context.Context, guildID string) error

AckDMUpsellSettings acknowledges the "DM settings" upsell of a guild.

POST /users/@me/guilds/{guild_id}/member/ack-dm-upsell-settings

func (*API) AckGuild

func (a *API) AckGuild(ctx context.Context, guildID string) error

AckGuild marks every channel of a guild as read.

POST /guilds/{guild_id}/ack discord.py-self: ack_guild

func (*API) AckGuildFeature

func (a *API) AckGuildFeature(ctx context.Context, guildID string, featureType int, entityID string) (*AcknowledgementToken, error)

AckGuildFeature acknowledges a guild feature entity (for example a feature-specific read state) and returns the acknowledgement token.

POST /guilds/{guild_id}/ack/{type}/{entity_id} discord.py-self: ack_guild_feature

func (*API) AckJoinRequest

func (a *API) AckJoinRequest(ctx context.Context, guildID, requestID string) error

AckJoinRequest acknowledges the outcome of a join request.

POST /guilds/{guild_id}/requests/{request_id}/ack discord.py-self: ack_join_request

func (*API) AckMessage

func (a *API) AckMessage(ctx context.Context, channelID, messageID string, params *AckMessageParams) (*AcknowledgementToken, error)

AckMessage marks a channel as read up to a message and returns the ack token to pass to the next acknowledgement.

POST /channels/{channel_id}/messages/{message_id}/ack discord.py-self: ack_message

func (*API) AckOrbChallengesUnreadState

func (a *API) AckOrbChallengesUnreadState(ctx context.Context) (json.RawMessage, error)

AckOrbChallengesUnreadState marks the Orb challenges as read.

POST /users/@me/achievements/unread-ack

func (*API) AckPins

func (a *API) AckPins(ctx context.Context, channelID string) error

AckPins marks the pins of a channel as seen.

POST /channels/{channel_id}/pins/ack discord.py-self: ack_pins

func (*API) AckSafetyWarnings

func (a *API) AckSafetyWarnings(ctx context.Context, channelID string, warningIDs []string) error

AckSafetyWarnings dismisses safety warnings by ID.

POST /channels/{channel_id}/safety-warnings/ack

func (*API) AckTrialOffer

func (a *API) AckTrialOffer(ctx context.Context, trialID string) (*TrialOffer, error)

AckTrialOffer acknowledges a trial offer.

POST /users/@me/billing/user-trial-offer/{trial_id}/ack discord.py-self: ack_trial_offer

func (*API) AckUserBadge

func (a *API) AckUserBadge(ctx context.Context, badgeID string) error

AckUserBadge acknowledges a new badge.

POST /users/@me/badges/{badge_id}/acknowledge

func (*API) AckUserFeature

func (a *API) AckUserFeature(ctx context.Context, featureType int, entityID string) (*AcknowledgementToken, error)

AckUserFeature acknowledges a non-channel read state (notification center, message requests, ...) and returns the new acknowledgement token.

POST /users/@me/{type}/{entity_id}/ack discord.py-self: ack_user_feature

func (*API) AckUserOffer

func (a *API) AckUserOffer(ctx context.Context, params *AckUserOfferParams) (*UserOffer, error)

AckUserOffer acknowledges a user offer. The response is null when there is no follow-up offer.

POST /users/@me/billing/user-offer/ack discord.py-self: ack_user_offer

func (*API) ActionJoinRequest

func (a *API) ActionJoinRequest(ctx context.Context, guildID, requestID string, action JoinRequestAction, rejectionReason string) (*JoinRequest, error)

ActionJoinRequest approves or rejects a join request. rejectionReason is only sent when non-empty.

PATCH /guilds/{guild_id}/requests/{request_id} discord.py-self: action_join_request

func (*API) AddAppWhitelist

func (a *API) AddAppWhitelist(ctx context.Context, applicationID, username, discriminator string) (*WhitelistedUser, error)

AddAppWhitelist invites a user (by username and discriminator, "0" or empty for pomelo users) to the allowlist of an application.

POST /oauth2/applications/{application_id}/allowlist discord.py-self: add_app_whitelist

func (*API) AddConnection

func (a *API) AddConnection(ctx context.Context, connType, code, state string, insecure, friendSync bool, params *AddConnectionParams) error

AddConnection completes the OAuth flow and adds the connection.

POST /connections/{type}/callback discord.py-self: add_connection

func (*API) AddGroupRecipient

func (a *API) AddGroupRecipient(ctx context.Context, channelID, userID string, params *AddGroupRecipientParams) error

AddGroupRecipient adds a user to a group DM (X-Context-Properties {"location":"Add Friends to DM"}).

PUT /channels/{channel_id}/recipients/{user_id} discord.py-self: add_group_recipient

func (*API) AddMembersToRole

func (a *API) AddMembersToRole(ctx context.Context, guildID, roleID string, memberIDs []string, reason string) (map[string]Member, error)

AddMembersToRole gives a role to several members at once and returns the updated members by user ID.

PATCH /guilds/{guild_id}/roles/{role_id}/members discord.py-self: add_members_to_role

func (*API) AddPhone

func (a *API) AddPhone(ctx context.Context, phoneToken, password, changePhoneReason string) (json.RawMessage, error)

AddPhone adds a phone number using the token returned by the verification step.

POST /users/@me/phone

func (*API) AddPhoneWithoutPassword

func (a *API) AddPhoneWithoutPassword(ctx context.Context, code string) (json.RawMessage, error)

AddPhoneWithoutPassword verifies a phone number with the SMS code only.

POST /users/@me/phone/verify

func (*API) AddReaction

func (a *API) AddReaction(ctx context.Context, channelID, messageID string, emoji interface{}, typ ReactionType) error

AddReaction adds your reaction to a message. emoji is a unicode emoji ("👍"), "name:id" / "<:name:id>" for a custom emoji, an *Emoji or an EmojiReaction. typ is ReactionTypeNormal or ReactionTypeBurst (super reaction).

PUT /channels/{channel_id}/messages/{message_id}/reactions/{emoji}/@me?type={type} discord.py-self: add_reaction

func (*API) AddRelationship

func (a *API) AddRelationship(ctx context.Context, userID string, action RelationshipAction, params *RelationshipParams) error

AddRelationship accepts a friend request, sends one by user ID, or blocks a user, depending on action and params.Type.

PUT /users/@me/relationships/{user_id} discord.py-self: add_relationship

func (*API) AddRole

func (a *API) AddRole(ctx context.Context, guildID, userID, roleID, reason string) error

AddRole gives a role to a member.

PUT /guilds/{guild_id}/members/{user_id}/roles/{role_id} discord.py-self: add_role

func (*API) AddSafetyWarning

func (a *API) AddSafetyWarning(ctx context.Context, channelID string, warningType int) error

AddSafetyWarning adds a safety warning of the given type to a DM channel (the web client sends the "stranger danger" type).

POST /channels/{channel_id}/add-safety-warning

func (*API) AddUserToThread

func (a *API) AddUserToThread(ctx context.Context, channelID, userID string) error

AddUserToThread adds a user to a thread.

PUT /channels/{channel_id}/thread-members/{user_id} discord.py-self: add_user_to_thread

func (*API) AddWishlistItem

func (a *API) AddWishlistItem(ctx context.Context, skuID string, params *WishlistParams) (json.RawMessage, error)

AddWishlistItem adds a SKU to your wishlist.

POST /users/@me/wishlist/items

func (*API) ApplicationCommandIndex

func (a *API) ApplicationCommandIndex(ctx context.Context, applicationID string) (*ApplicationCommandIndex, error)

ApplicationCommandIndex returns every command of one application usable by you.

GET /applications/{application_id}/application-command-index discord.py-self: application_command_index

func (*API) ApplyGuildSubscriptionSlots

func (a *API) ApplyGuildSubscriptionSlots(ctx context.Context, guildID string, slotIDs []string) ([]PremiumGuildSubscription, error)

ApplyGuildSubscriptionSlots boosts a guild with the given boost slots.

PUT /guilds/{guild_id}/premium/subscriptions discord.py-self: apply_guild_subscription_slots

func (*API) ArchiveRoleSubscriptionListing

func (a *API) ArchiveRoleSubscriptionListing(ctx context.Context, guildID, groupListingID, listingID string) (json.RawMessage, error)

ArchiveRoleSubscriptionListing archives a subscription tier.

POST /guilds/{guild_id}/role-subscriptions/group-listings/{group_listing_id}/subscription-listings/{subscription_listing_id}/archive

func (*API) AssignGuildRoleConnection

func (a *API) AssignGuildRoleConnection(ctx context.Context, guildID, roleID string) error

AssignGuildRoleConnection claims a linked role.

POST /guilds/{guild_id}/roles/{role_id}/connections/assign

func (*API) AuthorizeConnection

func (a *API) AuthorizeConnection(ctx context.Context, connType string, params *AuthorizeConnectionParams) (*ConnectionAuthorization, error)

AuthorizeConnection starts the OAuth flow of a connection type and returns the authorization URL.

GET /connections/{type}/authorize discord.py-self: authorize_connection

func (*API) AuthorizeIP

func (a *API) AuthorizeIP(ctx context.Context, token string) error

AuthorizeIP approves a new login location from the emailed token.

POST /auth/authorize-ip

func (*API) AuthorizeOAuth2

func (a *API) AuthorizeOAuth2(ctx context.Context, applicationID string, scopes []string, params *AuthorizeOAuth2Params) (*OAuth2Location, error)

AuthorizeOAuth2 authorizes an application (adds a bot to a guild, grants scopes) and returns the redirect location.

POST /oauth2/authorize discord.py-self: authorize_oauth2

func (*API) AuthorizePayment

func (a *API) AuthorizePayment(ctx context.Context, token string) error

AuthorizePayment confirms a purchase request from the emailed token.

POST /billing/verify-purchase-request

func (*API) AutocompleteGames

func (a *API) AutocompleteGames(ctx context.Context, query, filterGroup string) (json.RawMessage, error)

AutocompleteGames searches games by name. filterGroup may be empty.

GET /games/autocomplete

func (*API) AwardAccountLinkingAchievement

func (a *API) AwardAccountLinkingAchievement(ctx context.Context, applicationID string) (json.RawMessage, error)

AwardAccountLinkingAchievement awards the account linking achievement of an application.

POST /oauth2/account-linking-achievement

func (*API) Ban

func (a *API) Ban(ctx context.Context, guildID, userID string, params *BanParams, reason string) error

Ban bans a user from a guild.

PUT /guilds/{guild_id}/bans/{user_id} discord.py-self: ban

func (*API) BeginAddPhone

func (a *API) BeginAddPhone(ctx context.Context, phone, changePhoneReason string) (json.RawMessage, error)

BeginAddPhone sends a verification code to a new phone number.

POST /users/@me/phone

func (*API) BeginReverifyPhone

func (a *API) BeginReverifyPhone(ctx context.Context, phone, changePhoneReason string) (json.RawMessage, error)

BeginReverifyPhone sends a verification code to re-verify a phone number.

POST /users/@me/phone/reverify

func (*API) BillingPopupBridgeCallback

func (a *API) BillingPopupBridgeCallback(ctx context.Context, paymentSourceType, state, path, query string, insecure bool) (json.RawMessage, error)

BillingPopupBridgeCallback reports the result of the popup bridge redirect (path and query of the redirected URL).

POST /billing/popup-bridge/{payment_source_type}/callback

func (*API) BotifyApp

func (a *API) BotifyApp(ctx context.Context, applicationID string) (*ApplicationOptionalToken, error)

BotifyApp adds a bot user to an application.

POST /applications/{application_id}/bot discord.py-self: botify_app

func (*API) BulkActionJoinRequests

func (a *API) BulkActionJoinRequests(ctx context.Context, guildID string, action JoinRequestAction) error

BulkActionJoinRequests approves or rejects every pending join request.

PATCH /guilds/{guild_id}/requests discord.py-self: bulk_action_join_requests

func (*API) BulkBan

func (a *API) BulkBan(ctx context.Context, guildID string, userIDs []string, params *BanParams, reason string) (*BulkBanUserResponse, error)

BulkBan bans up to 200 users at once. The answer lists who was banned and who failed.

POST /guilds/{guild_id}/bulk-ban discord.py-self: bulk_ban

func (*API) BulkBanV2

func (a *API) BulkBanV2(ctx context.Context, guildID string, userIDs []string, params *BanParams, reason string) (json.RawMessage, error)

BulkBanV2 bans several users in the background (the web client's bulk ban). The answer is not modelled, so it is returned raw.

POST /guilds/{guild_id}/bulk-ban/v2

func (*API) BulkChannelUpdate

func (a *API) BulkChannelUpdate(ctx context.Context, guildID string, updates []ChannelPositionUpdate, reason string) error

BulkChannelUpdate moves several channels at once (positions, parents, permission sync).

PATCH /guilds/{guild_id}/channels discord.py-self: bulk_channel_update

func (*API) BulkLeaveGroupDMs

func (a *API) BulkLeaveGroupDMs(ctx context.Context, channelIDs []string) error

BulkLeaveGroupDMs leaves several group DMs at once.

POST /users/@me/channels/bulk-leave

func (*API) CancelConsoleDeviceCommand

func (a *API) CancelConsoleDeviceCommand(ctx context.Context, platform, deviceID, commandID string) error

CancelConsoleDeviceCommand cancels a pending command on a console device.

DELETE /consoles/{platform}/devices/{device_id}/commands/{command_id}

func (*API) CancelGuildSubscriptionSlot

func (a *API) CancelGuildSubscriptionSlot(ctx context.Context, slotID string) (*PremiumGuildSubscriptionSlot, error)

CancelGuildSubscriptionSlot cancels a boost slot.

POST /users/@me/guilds/premium/subscription-slots/{slot_id}/cancel discord.py-self: cancel_guild_subscription_slot

func (*API) ChangeCallVoiceRegion

func (a *API) ChangeCallVoiceRegion(ctx context.Context, channelID, region string) error

ChangeCallVoiceRegion changes the voice region of a call.

PATCH /channels/{channel_id}/call discord.py-self: change_call_voice_region

func (*API) ChangeHypesquadHouse

func (a *API) ChangeHypesquadHouse(ctx context.Context, houseID int) error

ChangeHypesquadHouse joins a HypeSquad house (1 Bravery, 2 Brilliance, 3 Balance).

POST /hypesquad/online discord.py-self: change_hypesquad_house

func (*API) ChangeVanityCode

func (a *API) ChangeVanityCode(ctx context.Context, guildID, code, reason string) error

ChangeVanityCode sets the vanity invite code of a guild.

PATCH /guilds/{guild_id}/vanity-url discord.py-self: change_vanity_code

func (*API) ChannelApplicationCommandIndex

func (a *API) ChannelApplicationCommandIndex(ctx context.Context, channelID string) (*ApplicationCommandIndex, error)

ChannelApplicationCommandIndex lists the application commands usable in a channel.

GET /channels/{channel_id}/application-command-index discord.py-self: channel_application_command_index

func (*API) ChannelWebhooks

func (a *API) ChannelWebhooks(ctx context.Context, channelID string) ([]*Webhook, error)

ChannelWebhooks lists the webhooks of a channel.

GET /channels/{channel_id}/webhooks discord.py-self: channel_webhooks

func (a *API) CheckActivityTrustedLink(ctx context.Context, applicationID, linkURL string) (bool, error)

CheckActivityTrustedLink reports whether a URL is trusted by an embedded activity.

GET /applications/{application_id}/trusted-links/check

func (*API) CheckPartnerStorefrontSKUEligibility

func (a *API) CheckPartnerStorefrontSKUEligibility(ctx context.Context, applicationID, skuID string) (json.RawMessage, error)

CheckPartnerStorefrontSKUEligibility starts a purchase eligibility check for a storefront SKU and returns the interaction to wait for.

POST /partner-sdk/applications/{application_id}/storefront/skus/{sku_id}/eligibility

func (*API) CheckoutRecoveryEligibility

func (a *API) CheckoutRecoveryEligibility(ctx context.Context) (*CheckoutRecovery, error)

CheckoutRecoveryEligibility tells whether an abandoned checkout can be recovered.

GET /users/@me/billing/checkout-recovery discord.py-self: checkout_recovery_eligibility

func (*API) ClaimOrbChallenge

func (a *API) ClaimOrbChallenge(ctx context.Context, achievementID string) (json.RawMessage, error)

ClaimOrbChallenge claims the reward of a completed Orb challenge.

POST /users/@me/achievements/{achievement_id}/claim

func (*API) ClaimPremiumCollectiblesProduct

func (a *API) ClaimPremiumCollectiblesProduct(ctx context.Context, skuID string) (json.RawMessage, error)

ClaimPremiumCollectiblesProduct claims a collectible included with Nitro.

PUT /users/@me/claim-premium-collectibles-product

func (*API) ClaimPromotion

func (a *API) ClaimPromotion(ctx context.Context, promotionID string) (*ClaimedPromotion, error)

ClaimPromotion claims an outbound promotion code.

POST /outbound-promotions/{promotion_id}/claim discord.py-self: claim_promotion

func (*API) ClaimQuestCreativeReward

func (a *API) ClaimQuestCreativeReward(ctx context.Context, creativeID string, params *QuestCreativeParams) error

ClaimQuestCreativeReward claims the reward of a quest ad creative.

POST /quests/creatives/{creative_id}/claim-reward

func (*API) ClaimQuestReward

func (a *API) ClaimQuestReward(ctx context.Context, questID, platform string, params *QuestActionParams) (json.RawMessage, error)

ClaimQuestReward claims the reward of a completed quest for a platform (for example "desktop" or "xbox"); the response lists entitlements and errors.

POST /quests/{quest_id}/claim-reward

func (*API) ClaimStorefrontPromotion

func (a *API) ClaimStorefrontPromotion(ctx context.Context, promotionID string) (json.RawMessage, error)

ClaimStorefrontPromotion claims a storefront promotion.

POST /storefront/promotions/{promotion_id}/claim

func (*API) ClearMentionRaid

func (a *API) ClearMentionRaid(ctx context.Context, guildID string) error

ClearMentionRaid lifts the restrictions a mention raid detection set.

POST /guilds/{guild_id}/auto-moderation/clear-mention-raid

func (*API) ClearReactions

func (a *API) ClearReactions(ctx context.Context, channelID, messageID string) error

ClearReactions removes all reactions from a message (needs Manage Messages).

DELETE /channels/{channel_id}/messages/{message_id}/reactions discord.py-self: clear_reactions

func (*API) ClearSingleReaction

func (a *API) ClearSingleReaction(ctx context.Context, channelID, messageID string, emoji interface{}) error

ClearSingleReaction removes every reaction of one emoji from a message.

DELETE /channels/{channel_id}/messages/{message_id}/reactions/{emoji} discord.py-self: clear_single_reaction

func (*API) CompleteCheckpoint

func (a *API) CompleteCheckpoint(ctx context.Context, character map[string]interface{}) error

CompleteCheckpoint stores the chosen character; body is the character object.

POST /checkpoint/complete

func (*API) CompleteNewMemberAction

func (a *API) CompleteNewMemberAction(ctx context.Context, guildID, actionID string) error

CompleteNewMemberAction marks a new member checklist action (the channel whose action you took) as done.

POST /guilds/{guild_id}/new-member-action/{new_member_action_id}

func (*API) CompleteQuestPreview

func (a *API) CompleteQuestPreview(ctx context.Context, questID string, percent int) (json.RawMessage, error)

CompleteQuestPreview marks a quest preview as percent complete.

POST /quests/{quest_id}/preview/complete

func (*API) ConfirmTutorialIndicator

func (a *API) ConfirmTutorialIndicator(ctx context.Context, indicator string) error

ConfirmTutorialIndicator marks a tutorial indicator as seen.

PUT /tutorial/indicators/{indicator} discord.py-self: confirm_tutorial_indicator

func (*API) ConnectGuildRoom

func (a *API) ConnectGuildRoom(ctx context.Context, guildID, roomID string, body interface{}) (json.RawMessage, error)

ConnectGuildRoom joins a room. body holds {"position", "seat"}.

POST /guilds/{guild_id}/rooms/{room_id}/connect

func (*API) ConnectionSessionHandoff

func (a *API) ConnectionSessionHandoff(ctx context.Context, connType, state, code string, openIDParams, iss interface{}) (json.RawMessage, error)

ConnectionSessionHandoff completes a connection OAuth flow started on another device with the callback values.

POST /connections/{type}/callback/session-handoff

func (*API) ConsumeAppEntitlement

func (a *API) ConsumeAppEntitlement(ctx context.Context, applicationID, entitlementID string) error

ConsumeAppEntitlement marks a consumable entitlement as consumed.

POST /applications/{application_id}/entitlements/{entitlement_id}/consume discord.py-self: consume_app_entitlement

func (*API) ConvertDM

func (a *API) ConvertDM(ctx context.Context, channelID, userID string) (*GroupDMChannel, error)

ConvertDM adds a user to a one-to-one DM, converting it into a group DM (X-Context-Properties {"location":"Add Friends to DM"}).

PUT /channels/{channel_id}/recipients/{user_id} discord.py-self: convert_dm

func (*API) ConvertToGuild

func (a *API) ConvertToGuild(ctx context.Context, channelID string) (json.RawMessage, error)

ConvertToGuild turns a group DM into a server (the web client's "convert to server" action). The response is returned raw.

POST /channels/{channel_id}/convert

func (*API) CreateAchievement

func (a *API) CreateAchievement(ctx context.Context, applicationID, name, description, icon string, secure, secret bool, params *CreateAchievementParams) (*ApplicationAchievement, error)

CreateAchievement creates an achievement. icon is a data URI.

POST /applications/{application_id}/achievements discord.py-self: create_achievement

func (*API) CreateApp

func (a *API) CreateApp(ctx context.Context, name string, params *CreateAppParams) (*Application, error)

CreateApp creates an application.

POST /applications discord.py-self: create_app

discord.py-self builds the body as {name, team_id: team_id} with a variable as key (a bug); this sends the intended {"name", "team_id"}.

func (*API) CreateAppBranch

func (a *API) CreateAppBranch(ctx context.Context, applicationID, name string) (*ApplicationBranch, error)

CreateAppBranch creates a branch.

POST /applications/{application_id}/branches discord.py-self: create_app_branch

func (*API) CreateAppExternalAssets

func (a *API) CreateAppExternalAssets(ctx context.Context, applicationID string, urls []string) ([]ExternalAsset, error)

CreateAppExternalAssets registers image URLs as external rich presence assets.

POST /applications/{application_id}/external-assets discord.py-self: create_app_external_assets

func (*API) CreateAsset

func (a *API) CreateAsset(ctx context.Context, applicationID, name string, assetType int, image string) (*ApplicationAsset, error)

CreateAsset uploads a rich presence asset. assetType is 1 (large) or 2 (small); image is a data URI (see ImageDataURI).

POST /oauth2/applications/{application_id}/assets discord.py-self: create_asset

func (*API) CreateAutoModerationRule

func (a *API) CreateAutoModerationRule(ctx context.Context, guildID string, params *AutoModerationRuleParams, reason string) (*AutoModerationRule, error)

CreateAutoModerationRule creates an auto moderation rule.

POST /guilds/{guild_id}/auto-moderation/rules discord.py-self: create_auto_moderation_rule

func (*API) CreateBranchBuild

func (a *API) CreateBranchBuild(ctx context.Context, applicationID, branchID string, payload map[string]interface{}) (*ApplicationCreatedBuild, error)

CreateBranchBuild creates a build on a branch. payload is the build manifest description (manifests, ...), as in discord.py-self.

POST /applications/{application_id}/branches/{branch_id}/builds discord.py-self: create_branch_build

func (*API) CreateConnection

func (a *API) CreateConnection(ctx context.Context, connType, id, name string, params *CreateConnectionParams) (*Connection, error)

CreateConnection adds a connection that needs no OAuth flow (a name only, as the web client does for Steam and similar).

PUT /users/@me/connections/{type}/{id}

func (*API) CreateConsoleConnectRequest

func (a *API) CreateConsoleConnectRequest(ctx context.Context, handoffType string) (json.RawMessage, error)

CreateConsoleConnectRequest creates a console connect request and returns its nonce. handoffType is sent as analytics_properties.handoff_type.

POST /consoles/connect-request

func (*API) CreateCustomEmoji

func (a *API) CreateCustomEmoji(ctx context.Context, guildID, name, image string, params *CreateCustomEmojiParams, reason string) (*Emoji, error)

CreateCustomEmoji uploads a custom emoji. image is a data URI (see ImageDataURI).

POST /guilds/{guild_id}/emojis discord.py-self: create_custom_emoji

func (*API) CreateDirectoryEntry

func (a *API) CreateDirectoryEntry(ctx context.Context, channelID, entityID string, params *DirectoryEntryParams) (*DirectoryEntry, error)

CreateDirectoryEntry adds a guild or event to a directory channel.

POST /channels/{channel_id}/directory-entry/{entity_id} discord.py-self: create_directory_entry

func (*API) CreateForumTag

func (a *API) CreateForumTag(ctx context.Context, channelID, name string, params *ForumTagParams, reason string) (*ForumChannel, error)

CreateForumTag creates a tag on a forum or media channel and returns the updated channel.

POST /channels/{channel_id}/tags discord.py-self: create_forum_tag

func (*API) CreateFriendInvite

func (a *API) CreateFriendInvite(ctx context.Context) (*InviteWithMetadata, error)

CreateFriendInvite creates a friend invite link.

POST /users/@me/invites discord.py-self: create_friend_invite

func (*API) CreateFromTemplate

func (a *API) CreateFromTemplate(ctx context.Context, code, name string, icon *string) (*GuildWithCounts, error)

CreateFromTemplate creates a guild from a template. icon is an optional data URI.

POST /guilds/templates/{code} discord.py-self: create_from_template

func (*API) CreateGift

func (a *API) CreateGift(ctx context.Context, skuID string, params *CreateGiftParams) (*Gift, error)

CreateGift creates a gift code for a SKU.

POST /users/@me/entitlements/gift-codes discord.py-self: create_gift

func (*API) CreateGiftBatch

func (a *API) CreateGiftBatch(ctx context.Context, applicationID, skuID string, amount int, description string, params *CreateGiftBatchParams) (*GiftBatch, error)

CreateGiftBatch creates a batch of gift codes for a SKU.

POST /applications/{application_id}/gift-code-batches discord.py-self: create_gift_batch

func (*API) CreateGiftCodeDeliveries

func (a *API) CreateGiftCodeDeliveries(ctx context.Context, checkoutSessionID string, recipientIDs []string) (json.RawMessage, error)

CreateGiftCodeDeliveries sends the gift codes of a checkout session to recipients.

POST /users/@me/gift-code-deliveries

func (*API) CreateGroupDMShell

func (a *API) CreateGroupDMShell(ctx context.Context, recipientID, location string) (*Channel, error)

CreateGroupDMShell starts a group DM shell with one recipient (web client "create group DM" flow). location is the context location ("" for none).

POST /users/@me/channels/group-dm-shell

func (*API) CreateGroupInvite

func (a *API) CreateGroupInvite(ctx context.Context, channelID string, params *CreateGroupInviteParams) (*InviteWithMetadata, error)

CreateGroupInvite creates an invite to a group DM (X-Context-Properties {"location":"Group DM Invite Create"}).

POST /channels/{channel_id}/invites discord.py-self: create_group_invite

func (*API) CreateGuild

func (a *API) CreateGuild(ctx context.Context, name string, params *CreateGuildParams) (*GuildWithCounts, error)

CreateGuild creates a guild from a template.

POST /guilds discord.py-self: create_guild

func (*API) CreateGuildChannel

func (a *API) CreateGuildChannel(ctx context.Context, guildID string, channelType ChannelType, params *CreateGuildChannelParams, reason string) (*GuildChannel, error)

CreateGuildChannel creates a channel (text, voice, category, stage, forum, ...) in a guild.

POST /guilds/{guild_id}/channels discord.py-self: create_channel

func (*API) CreateGuildRoomObject

func (a *API) CreateGuildRoomObject(ctx context.Context, guildID, roomID string, body interface{}) (json.RawMessage, error)

CreateGuildRoomObject adds an object (a note) to a room. body holds {"object_type", "content", "position"}.

POST /guilds/{guild_id}/rooms/{room_id}/objects

func (*API) CreateGuildScheduledEvent

func (a *API) CreateGuildScheduledEvent(ctx context.Context, guildID string, params *ScheduledEventParams, reason string) (*GuildScheduledEventWithUserCount, error)

CreateGuildScheduledEvent creates a scheduled event.

POST /guilds/{guild_id}/scheduled-events discord.py-self: create_guild_scheduled_event

func (*API) CreateGuildSticker

func (a *API) CreateGuildSticker(ctx context.Context, guildID string, sticker CreateGuildSticker, file File, reason string) (*GuildSticker, error)

CreateGuildSticker uploads a sticker. sticker.Name and sticker.Tags are required (Tags is the related unicode emoji or keyword); the description is always sent, empty by default. file is a PNG, APNG, GIF or Lottie JSON; its content type is sniffed when File.ContentType is empty. The request is multipart/form-data with the fields name, description, tags and a "file" part, built here because the REST layer's multipart form only models payload_json plus files[N].

POST /guilds/{guild_id}/stickers discord.py-self: create_guild_sticker

func (*API) CreateIncodeSession

func (a *API) CreateIncodeSession(ctx context.Context, previousInterviewID string) (json.RawMessage, error)

CreateIncodeSession starts an Incode age-verification session. previousInterviewID may be empty.

POST /age-verification/incode/session

func (*API) CreateIntegration

func (a *API) CreateIntegration(ctx context.Context, guildID string, typ IntegrationType, integrationID, reason string) error

CreateIntegration attaches one of your connected accounts as an integration of a guild.

POST /guilds/{guild_id}/integrations discord.py-self: create_integration

func (*API) CreateInvite

func (a *API) CreateInvite(ctx context.Context, channelID string, params *CreateInviteParams, reason string) (*InviteWithMetadata, error)

CreateInvite creates an invite to a guild channel.

POST /channels/{channel_id}/invites discord.py-self: create_invite

func (*API) CreateJoinRequest

func (a *API) CreateJoinRequest(ctx context.Context, guildID string, formFields []MemberVerificationFormField, version *string) (*JoinRequest, error)

CreateJoinRequest submits your answers to a guild's member verification form. version is the form version from GetMemberVerification (nil sends null).

PUT /guilds/{guild_id}/requests/@me discord.py-self: create_join_request

func (*API) CreateJoinRequestInterview

func (a *API) CreateJoinRequestInterview(ctx context.Context, requestID string) (*GroupDMChannel, error)

CreateJoinRequestInterview opens an interview group DM for a join request.

POST /join-requests/{request_id}/interview discord.py-self: create_join_request_interview

func (*API) CreateOnboardingResponses

func (a *API) CreateOnboardingResponses(ctx context.Context, guildID string, params *OnboardingResponsesParams) (json.RawMessage, error)

CreateOnboardingResponses submits your first set of onboarding answers. The answer holds the stored "onboarding_responses" and "onboarding_prompts_seen".

POST /guilds/{guild_id}/onboarding-responses

func (*API) CreateOrder

func (a *API) CreateOrder(ctx context.Context, skuID, paymentSourceID, gatewayCountryCode string, params *CreateOrderParams) (json.RawMessage, error)

CreateOrder creates an order for one unit of a SKU, as the web checkout does. Nothing is charged until SignOrder.

POST /billing/orders

func (*API) CreatePaymentSource

func (a *API) CreatePaymentSource(ctx context.Context, token string, gateway PaymentGateway, billingAddress BillingAddress, params *CreatePaymentSourceParams) (*PaymentSource, error)

CreatePaymentSource adds a payment source from a gateway token (Stripe token, PayPal billing agreement token, ...).

POST /users/@me/billing/payment-sources discord.py-self: create_payment_source

func (*API) CreateReferral

func (a *API) CreateReferral(ctx context.Context, userID string) (*TrialOffer, error)

CreateReferral sends a Nitro referral (free trial) to a user.

POST /users/@me/referrals/{user_id}

func (*API) CreateRole

func (a *API) CreateRole(ctx context.Context, guildID string, params *RoleParams, reason string) (*Role, error)

CreateRole creates a role.

POST /guilds/{guild_id}/roles discord.py-self: create_role

func (*API) CreateRoleSubscriptionGroupListing

func (a *API) CreateRoleSubscriptionGroupListing(ctx context.Context, guildID string, body interface{}) (json.RawMessage, error)

CreateRoleSubscriptionGroupListing creates a subscription group listing.

POST /guilds/{guild_id}/role-subscriptions/group-listings

func (*API) CreateRoleSubscriptionListing

func (a *API) CreateRoleSubscriptionListing(ctx context.Context, guildID, groupListingID string, body interface{}) (json.RawMessage, error)

CreateRoleSubscriptionListing creates a subscription tier in a group listing. body holds the tier fields plus "price_tier".

POST /guilds/{guild_id}/role-subscriptions/group-listings/{group_listing_id}/subscription-listings

func (*API) CreateSKU

func (a *API) CreateSKU(ctx context.Context, payload map[string]interface{}) (*PrivateSKU, error)

CreateSKU creates a SKU; payload holds the SKU fields (application_id, name, type, ...).

POST /store/skus discord.py-self: create_sku

func (*API) CreateSKUDiscount

func (a *API) CreateSKUDiscount(ctx context.Context, skuID, userID string, percentOff, ttl int) error

CreateSKUDiscount gives a user a temporary discount on a SKU. ttl is the lifetime in seconds (0 means the discord.py-self default of 600).

PUT /store/skus/{sku_id}/discounts/{user_id} discord.py-self: create_sku_discount

func (*API) CreateScheduledEventException

func (a *API) CreateScheduledEventException(ctx context.Context, guildID, eventID string, params *ScheduledEventExceptionParams) (json.RawMessage, error)

CreateScheduledEventException creates an exception (a moved or cancelled occurrence) of a recurring event. The answer shape is not modelled, so it is returned raw.

POST /guilds/{guild_id}/scheduled-events/{guild_scheduled_event_id}/exceptions

func (*API) CreateScheduledEventUser

func (a *API) CreateScheduledEventUser(ctx context.Context, guildID, eventID string) (*SubscribedGuildScheduledEvent, error)

CreateScheduledEventUser marks you as interested in a scheduled event.

PUT /guilds/{guild_id}/scheduled-events/{guild_scheduled_event_id}/users/@me discord.py-self: create_scheduled_event_user

func (*API) CreateScheduledMessage

func (a *API) CreateScheduledMessage(ctx context.Context, params *CreateScheduledMessageParams) (json.RawMessage, error)

CreateScheduledMessage schedules a message.

POST /users/@me/scheduled-messages

func (*API) CreateSoundboardSound

func (a *API) CreateSoundboardSound(ctx context.Context, guildID string, params *SoundboardSoundParams) (*SoundboardSound, error)

CreateSoundboardSound uploads a soundboard sound to a guild.

POST /guilds/{guild_id}/soundboard-sounds

func (*API) CreateStageInstance

func (a *API) CreateStageInstance(ctx context.Context, channelID, topic string, params *CreateStageInstanceParams, reason string) (*StageInstance, error)

CreateStageInstance starts a stage in a stage channel.

POST /stage-instances discord.py-self: create_stage_instance

func (*API) CreateStoreAsset

func (a *API) CreateStoreAsset(ctx context.Context, applicationID string, file File) (*StoreAsset, error)

CreateStoreAsset uploads a store asset (image or JSON).

POST /store/applications/{application_id}/assets discord.py-self: create_store_asset

The upload is a multipart form whose only part is named "assets", as discord.py-self sends it; file.Field is overridden.

func (*API) CreateStoreListing

func (a *API) CreateStoreListing(ctx context.Context, applicationID, skuID string, payload map[string]interface{}) (*PrivateStoreListing, error)

CreateStoreListing creates a store listing for a SKU; payload holds the listing fields (summary, description, thumbnail, ...).

POST /store/listings discord.py-self: create_store_listing

func (*API) CreateStripePaymentElementsSetupIntent

func (a *API) CreateStripePaymentElementsSetupIntent(ctx context.Context) (json.RawMessage, error)

CreateStripePaymentElementsSetupIntent creates a Stripe setup intent for the Payment Elements flow.

POST /users/@me/billing/stripe/payment-elements/setup-intents

func (*API) CreateStripeSetupIntent

func (a *API) CreateStripeSetupIntent(ctx context.Context) (json.RawMessage, error)

CreateStripeSetupIntent creates a Stripe setup intent for adding a card.

POST /users/@me/billing/stripe/setup-intents

func (*API) CreateSubscription

func (a *API) CreateSubscription(ctx context.Context, items []SubscriptionItemParams, paymentSourceID, currency string, params *CreateSubscriptionParams) (*Subscription, error)

CreateSubscription subscribes (Nitro, ...). The unset optional keys are sent as null, like discord.py-self does.

POST /users/@me/billing/subscriptions discord.py-self: create_subscription

func (*API) CreateTeam

func (a *API) CreateTeam(ctx context.Context, name string) (*Team, error)

CreateTeam creates a team.

POST /teams discord.py-self: create_team

func (*API) CreateTeamCompany

func (a *API) CreateTeamCompany(ctx context.Context, teamID, name string) (*ApplicationCompany, error)

CreateTeamCompany creates a company for a team.

POST /teams/{team_id}/companies discord.py-self: create_team_company

func (*API) CreateTemplate

func (a *API) CreateTemplate(ctx context.Context, guildID, name string, description *string) (*GuildTemplate, error)

CreateTemplate creates a template from a guild. description is optional.

POST /guilds/{guild_id}/templates discord.py-self: create_template

func (*API) CreateVideoFilterAsset

func (a *API) CreateVideoFilterAsset(ctx context.Context, assetType int, asset string, lastUsed *bool) (json.RawMessage, error)

CreateVideoFilterAsset uploads a custom video background; asset is the data URI or asset reference the web client sends.

POST /users/@me/video-filters/assets

func (*API) CreateWebhook

func (a *API) CreateWebhook(ctx context.Context, channelID, name string, params *CreateWebhookParams, reason string) (*Webhook, error)

CreateWebhook creates a webhook in a channel.

POST /channels/{channel_id}/webhooks discord.py-self: create_webhook

func (*API) CreateWidgetAssetUpload

func (a *API) CreateWidgetAssetUpload(ctx context.Context, filename string, fileSize int64) (*WidgetUploadURL, error)

CreateWidgetAssetUpload reserves an upload slot for a profile widget image. PUT the file to WidgetUploadURL.UploadURL, then reference UploadFilename in PutUserWidgets.

POST /users/@me/widgets/assets/upload

func (*API) CreateWidgetClipUpload

func (a *API) CreateWidgetClipUpload(ctx context.Context, fileSize int64) (*WidgetUploadURL, error)

CreateWidgetClipUpload reserves an upload slot for a profile widget clip.

POST /users/@me/widgets/clips/upload

func (*API) DeclineMessageRequest

func (a *API) DeclineMessageRequest(ctx context.Context, channelID string) (*DMChannel, error)

DeclineMessageRequest declines (closes) a DM message request.

DELETE /channels/{channel_id}/recipients/@me discord.py-self: decline_message_request

func (*API) DeleteAccount

func (a *API) DeleteAccount(ctx context.Context, password string) error

DeleteAccount schedules the account for deletion. This is destructive.

POST /users/@me/delete

func (*API) DeleteAchievement

func (a *API) DeleteAchievement(ctx context.Context, applicationID, achievementID string) error

DeleteAchievement deletes an achievement.

DELETE /applications/{application_id}/achievements/{achievement_id} discord.py-self: delete_achievement

func (*API) DeleteAppBranch

func (a *API) DeleteAppBranch(ctx context.Context, applicationID, branchID string) error

DeleteAppBranch deletes a branch.

DELETE /applications/{application_id}/branches/{branch_id} discord.py-self: delete_app_branch

func (*API) DeleteAppEntitlement

func (a *API) DeleteAppEntitlement(ctx context.Context, applicationID, entitlementID string) error

DeleteAppEntitlement deletes a test entitlement of an application.

DELETE /applications/{application_id}/entitlements/{entitlement_id} discord.py-self: delete_app_entitlement

func (*API) DeleteAppWhitelist

func (a *API) DeleteAppWhitelist(ctx context.Context, applicationID, userID string) error

DeleteAppWhitelist removes a user from the allowlist of an application.

DELETE /oauth2/applications/{application_id}/allowlist/{user_id} discord.py-self: delete_app_whitelist

func (*API) DeleteApplication

func (a *API) DeleteApplication(ctx context.Context, applicationID string) error

DeleteApplication deletes an application. Discord may ask for MFA.

POST /applications/{application_id}/delete discord.py-self: delete_application

func (*API) DeleteAsset

func (a *API) DeleteAsset(ctx context.Context, applicationID, assetID string) error

DeleteAsset deletes a rich presence asset.

DELETE /oauth2/applications/{application_id}/assets/{asset_id} discord.py-self: delete_asset

func (*API) DeleteAttachment

func (a *API) DeleteAttachment(ctx context.Context, uploadedFilename string) error

DeleteAttachment deletes a file previously uploaded to the cloud, by its upload_filename, before it was attached to a message.

DELETE /attachments/{uploaded_filename} discord.py-self: delete_attachment

func (*API) DeleteAutoModerationRule

func (a *API) DeleteAutoModerationRule(ctx context.Context, guildID, ruleID, reason string) error

DeleteAutoModerationRule deletes an auto moderation rule.

DELETE /guilds/{guild_id}/auto-moderation/rules/{rule_id} discord.py-self: delete_auto_moderation_rule

func (*API) DeleteBuild

func (a *API) DeleteBuild(ctx context.Context, applicationID, buildID string) error

DeleteBuild deletes a build.

DELETE /applications/{application_id}/builds/{build_id} discord.py-self: delete_build

func (*API) DeleteChannel

func (a *API) DeleteChannel(ctx context.Context, channelID string, params *DeleteChannelParams, reason string) (*Channel, error)

DeleteChannel deletes a guild channel, thread, or closes a DM / leaves a group DM.

DELETE /channels/{channel_id} discord.py-self: delete_channel

func (*API) DeleteChannelPermissions

func (a *API) DeleteChannelPermissions(ctx context.Context, channelID, target, reason string) error

DeleteChannelPermissions removes a permission overwrite.

DELETE /channels/{channel_id}/permissions/{target} discord.py-self: delete_channel_permissions

func (*API) DeleteConjureProject

func (a *API) DeleteConjureProject(ctx context.Context, projectID string) error

DeleteConjureProject deletes a Conjure project.

DELETE /conjure/projects/{project_id}

func (*API) DeleteConnection

func (a *API) DeleteConnection(ctx context.Context, connType, id string) error

DeleteConnection removes a connected account.

DELETE /users/@me/connections/{type}/{id} discord.py-self: delete_connection

func (*API) DeleteConsoleConnectRequest

func (a *API) DeleteConsoleConnectRequest(ctx context.Context, nonce string) error

DeleteConsoleConnectRequest cancels a console connect request.

DELETE /consoles/connect-request/{nonce}

func (*API) DeleteContentInventoryOutboxEntryHistory

func (a *API) DeleteContentInventoryOutboxEntryHistory(ctx context.Context, entryID string) error

DeleteContentInventoryOutboxEntryHistory deletes the history of one of your outbox entries.

DELETE /content-inventory/users/@me/outbox/entries/id/{entry_id}/history

func (*API) DeleteCustomEmoji

func (a *API) DeleteCustomEmoji(ctx context.Context, guildID, emojiID, reason string) error

DeleteCustomEmoji deletes a custom emoji.

DELETE /guilds/{guild_id}/emojis/{emoji_id} discord.py-self: delete_custom_emoji

func (*API) DeleteDirectoryEntry

func (a *API) DeleteDirectoryEntry(ctx context.Context, channelID, entityID string) error

DeleteDirectoryEntry removes an entry from a directory channel.

DELETE /channels/{channel_id}/directory-entry/{entity_id} discord.py-self: delete_directory_entry

func (*API) DeleteForumTag

func (a *API) DeleteForumTag(ctx context.Context, channelID, tagID string) (*ForumChannel, error)

DeleteForumTag deletes a tag and returns the updated channel.

DELETE /channels/{channel_id}/tags/{tag_id} discord.py-self: delete_forum_tag

func (*API) DeleteFriendInvites

func (a *API) DeleteFriendInvites(ctx context.Context) ([]InviteWithMetadata, error)

DeleteFriendInvites revokes all your friend invites and returns them.

DELETE /users/@me/invites discord.py-self: delete_friend_invites

func (*API) DeleteFriendSuggestion

func (a *API) DeleteFriendSuggestion(ctx context.Context, userID string) error

DeleteFriendSuggestion dismisses a friend suggestion.

DELETE /friend-suggestions/{user_id} discord.py-self: delete_friend_suggestion

func (*API) DeleteGameRelationship

func (a *API) DeleteGameRelationship(ctx context.Context, userID, applicationID string) error

DeleteGameRelationship removes a user from an application's game friends.

DELETE /users/@me/game-relationships/{user_id}/{application_id}

func (*API) DeleteGift

func (a *API) DeleteGift(ctx context.Context, code string) error

DeleteGift revokes one of your gift codes.

DELETE /users/@me/entitlements/gift-codes/{code} discord.py-self: delete_gift

func (*API) DeleteGuild

func (a *API) DeleteGuild(ctx context.Context, guildID string) error

DeleteGuild deletes a guild you own.

POST /guilds/{guild_id}/delete discord.py-self: delete_guild

func (*API) DeleteGuildRoomObject

func (a *API) DeleteGuildRoomObject(ctx context.Context, guildID, roomID, objectID string, body interface{}) error

DeleteGuildRoomObject removes an object from a room. body holds {"object_type"}.

DELETE /guilds/{guild_id}/rooms/{room_id}/objects/{object_id}

func (*API) DeleteGuildSticker

func (a *API) DeleteGuildSticker(ctx context.Context, guildID, stickerID, reason string) error

DeleteGuildSticker deletes a guild sticker.

DELETE /guilds/{guild_id}/stickers/{sticker_id} discord.py-self: delete_guild_sticker

func (*API) DeleteGuildSubscription

func (a *API) DeleteGuildSubscription(ctx context.Context, guildID, subscriptionID string) error

DeleteGuildSubscription removes one of your boosts from a guild.

DELETE /guilds/{guild_id}/premium/subscriptions/{subscription_id} discord.py-self: delete_guild_subscription

func (*API) DeleteIntegration

func (a *API) DeleteIntegration(ctx context.Context, guildID, integrationID, reason string) error

DeleteIntegration removes an integration from a guild.

DELETE /guilds/{guild_id}/integrations/{integration_id} discord.py-self: delete_integration

func (*API) DeleteInvite

func (a *API) DeleteInvite(ctx context.Context, code, reason string) (*PartialInvite, error)

DeleteInvite revokes an invite.

DELETE /invites/{invite_id} discord.py-self: delete_invite

func (*API) DeleteJoinRequest

func (a *API) DeleteJoinRequest(ctx context.Context, guildID string) (*JoinRequest, error)

DeleteJoinRequest cancels your join request. The answer is empty or the deleted request; nil is returned for an empty answer.

DELETE /guilds/{guild_id}/requests/@me discord.py-self: delete_join_request

func (*API) DeleteLibraryEntry

func (a *API) DeleteLibraryEntry(ctx context.Context, applicationID, branchID string) error

DeleteLibraryEntry removes a library entry.

DELETE /users/@me/library/{application_id}/{branch_id} discord.py-self: delete_library_entry

func (*API) DeleteMessage

func (a *API) DeleteMessage(ctx context.Context, channelID, messageID, reason string) error

DeleteMessage deletes a message. reason is the audit-log reason ("" for none).

DELETE /channels/{channel_id}/messages/{message_id} discord.py-self: delete_message

func (*API) DeletePaymentSource

func (a *API) DeletePaymentSource(ctx context.Context, sourceID string) error

DeletePaymentSource removes a payment source.

DELETE /users/@me/billing/payment-sources/{source_id} discord.py-self: delete_payment_source

func (*API) DeleteQuestPreviewDismissibility

func (a *API) DeleteQuestPreviewDismissibility(ctx context.Context, questID string) (json.RawMessage, error)

DeleteQuestPreviewDismissibility resets the dismissal state of a quest preview.

DELETE /quests/{quest_id}/preview/dismissibility

func (*API) DeleteQuestPreviewStatus

func (a *API) DeleteQuestPreviewStatus(ctx context.Context, questID string) (json.RawMessage, error)

DeleteQuestPreviewStatus resets the preview user status of a quest.

DELETE /quests/{quest_id}/preview/status

func (*API) DeleteReadState

func (a *API) DeleteReadState(ctx context.Context, channelID string, typ ReadStateType) error

DeleteReadState removes a channel's read state (read state protocol v2).

DELETE /channels/{channel_id}/messages/ack discord.py-self: delete_read_state

func (*API) DeleteRecentAvatar

func (a *API) DeleteRecentAvatar(ctx context.Context, avatarID string) error

DeleteRecentAvatar removes an entry from the recent avatars.

DELETE /users/@me/avatars/{avatar_id} discord.py-self: delete_recent_avatar

func (*API) DeleteRecentMention

func (a *API) DeleteRecentMention(ctx context.Context, messageID string) error

DeleteRecentMention removes a message from your recent mentions.

DELETE /users/@me/mentions/{message_id} discord.py-self: delete_recent_mention

func (*API) DeleteRole

func (a *API) DeleteRole(ctx context.Context, guildID, roleID, reason string) error

DeleteRole deletes a role.

DELETE /guilds/{guild_id}/roles/{role_id} discord.py-self: delete_role

func (*API) DeleteRoleSubscriptionListing

func (a *API) DeleteRoleSubscriptionListing(ctx context.Context, guildID, groupListingID, listingID string) error

DeleteRoleSubscriptionListing deletes a subscription tier.

DELETE /guilds/{guild_id}/role-subscriptions/group-listings/{group_listing_id}/subscription-listings/{subscription_listing_id}

func (*API) DeleteSKUDiscount

func (a *API) DeleteSKUDiscount(ctx context.Context, skuID, userID string) error

DeleteSKUDiscount removes a user's discount on a SKU.

DELETE /store/skus/{sku_id}/discounts/{user_id} discord.py-self: delete_sku_discount

func (*API) DeleteSavedMessage

func (a *API) DeleteSavedMessage(ctx context.Context, channelID, messageID string) error

DeleteSavedMessage removes a bookmark or reminder.

DELETE /users/@me/saved-messages/{channel_id}/{message_id}

func (*API) DeleteScheduledEvent

func (a *API) DeleteScheduledEvent(ctx context.Context, guildID, eventID, reason string) error

DeleteScheduledEvent deletes a scheduled event.

DELETE /guilds/{guild_id}/scheduled-events/{guild_scheduled_event_id} discord.py-self: delete_scheduled_event

func (*API) DeleteScheduledEventException

func (a *API) DeleteScheduledEventException(ctx context.Context, guildID, eventID, exceptionID string) error

DeleteScheduledEventException deletes an exception of a recurring event.

DELETE /guilds/{guild_id}/scheduled-events/{guild_scheduled_event_id}/exceptions/{exception_id}

func (*API) DeleteScheduledEventUser

func (a *API) DeleteScheduledEventUser(ctx context.Context, guildID, eventID string) error

DeleteScheduledEventUser removes your interest in a scheduled event.

DELETE /guilds/{guild_id}/scheduled-events/{guild_scheduled_event_id}/users/@me discord.py-self: delete_scheduled_event_user

func (*API) DeleteScheduledMessage

func (a *API) DeleteScheduledMessage(ctx context.Context, scheduledMessageID string) error

DeleteScheduledMessage cancels a scheduled message.

DELETE /users/@me/scheduled-messages/{scheduled_message_id}

func (*API) DeleteSoundboardSound

func (a *API) DeleteSoundboardSound(ctx context.Context, guildID, soundID string) error

DeleteSoundboardSound deletes a soundboard sound of a guild.

DELETE /guilds/{guild_id}/soundboard-sounds/{soundboard_sound_id}

func (*API) DeleteStageInstance

func (a *API) DeleteStageInstance(ctx context.Context, channelID, reason string) error

DeleteStageInstance ends a stage.

DELETE /stage-instances/{channel_id} discord.py-self: delete_stage_instance

func (*API) DeleteStoreAsset

func (a *API) DeleteStoreAsset(ctx context.Context, applicationID, assetID string) error

DeleteStoreAsset deletes a store asset.

DELETE /store/applications/{application_id}/assets/{asset_id} discord.py-self: delete_store_asset

func (*API) DeleteStoreListing

func (a *API) DeleteStoreListing(ctx context.Context, listingID string) error

DeleteStoreListing deletes a store listing.

DELETE /store/listings/{listing_id} discord.py-self: delete_store_listing

func (*API) DeleteSubscription

func (a *API) DeleteSubscription(ctx context.Context, subscriptionID string, params *SubscriptionLocationParams) error

DeleteSubscription cancels a subscription.

DELETE /users/@me/billing/subscriptions/{subscription_id} discord.py-self: delete_subscription

func (*API) DeleteTeam

func (a *API) DeleteTeam(ctx context.Context, teamID string) error

DeleteTeam deletes a team.

POST /teams/{team_id}/delete discord.py-self: delete_team

func (*API) DeleteTemplate

func (a *API) DeleteTemplate(ctx context.Context, guildID, code string) error

DeleteTemplate deletes a template.

DELETE /guilds/{guild_id}/templates/{code} discord.py-self: delete_template

func (*API) DeleteVideoFilterAsset

func (a *API) DeleteVideoFilterAsset(ctx context.Context, assetID string) error

DeleteVideoFilterAsset deletes a custom video background.

DELETE /users/@me/video-filters/assets/{asset_id}

func (*API) DeleteWebAuthnCredential

func (a *API) DeleteWebAuthnCredential(ctx context.Context, credentialID string) error

DeleteWebAuthnCredential removes a security key.

DELETE /users/@me/mfa/webauthn/credentials/{credential_id}

func (*API) DeleteWebhook

func (a *API) DeleteWebhook(ctx context.Context, webhookID, reason string) error

DeleteWebhook deletes a webhook with your account's credentials.

DELETE /webhooks/{webhook_id} discord.py-self: delete_webhook

func (*API) DeleteWebhookMessage

func (a *API) DeleteWebhookMessage(ctx context.Context, webhookID, token, messageID, threadID string) error

DeleteWebhookMessage deletes a message previously sent by the webhook.

DELETE /webhooks/{webhook_id}/{webhook_token}/messages/{message_id} discord.py-self: delete_webhook_message

func (*API) DeleteWebhookWithToken

func (a *API) DeleteWebhookWithToken(ctx context.Context, webhookID, token, reason string) error

DeleteWebhookWithToken deletes a webhook using its token (no account credentials sent).

DELETE /webhooks/{webhook_id}/{webhook_token} discord.py-self: delete_webhook_with_token

func (*API) DisableAccount

func (a *API) DisableAccount(ctx context.Context, password string) error

DisableAccount disables the account.

POST /users/@me/disable

func (*API) DisableGuildPowerup

func (a *API) DisableGuildPowerup(ctx context.Context, guildID, skuID, entitlementID string) error

DisableGuildPowerup cancels a powerup entitlement of a guild.

DELETE /guilds/{guild_id}/skus/{sku_id}

func (*API) DismissBlockedUserWarning

func (a *API) DismissBlockedUserWarning(ctx context.Context, channelID string) error

DismissBlockedUserWarning dismisses the "you blocked this user" warning of a channel.

POST /channels/{channel_id}/blocked-user-warning-dismissal

func (*API) DismissGiftIntent

func (a *API) DismissGiftIntent(ctx context.Context, intentType int, targetID string) error

DismissGiftIntent dismisses a gift suggestion for a user.

POST /users/@me/gift-intents/dismiss

func (*API) DismissQuestContent

func (a *API) DismissQuestContent(ctx context.Context, questID, content string, params *QuestActionParams) (json.RawMessage, error)

DismissQuestContent dismisses a quest content placement (content is the client's dismissible content ID).

POST /quests/{quest_id}/dismissible-content/{content}/dismiss

func (*API) DismissQuestCreative

func (a *API) DismissQuestCreative(ctx context.Context, creativeID string, params *QuestCreativeParams) error

DismissQuestCreative dismisses a quest ad creative.

POST /quests/creatives/{creative_id}/dismiss

func (*API) DismissibleContentArbitrate

func (a *API) DismissibleContentArbitrate(ctx context.Context, candidates []string) (json.RawMessage, error)

DismissibleContentArbitrate asks which of the candidate dismissible contents should be shown.

POST /dismissible-content/arbitrate

func (*API) Do

func (a *API) Do(ctx context.Context, method, path string, opts *RequestOptions, out interface{}) error

Do is Request plus json.Unmarshal of the body into out. out may be nil (body discarded). An empty body or 204 never errors.

func (*API) EditAccountNotificationSettings

func (a *API) EditAccountNotificationSettings(ctx context.Context, flags int) error

EditAccountNotificationSettings edits the account-wide notification flags.

PATCH /users/@me/notification-settings

func (*API) EditAchievement

func (a *API) EditAchievement(ctx context.Context, applicationID, achievementID string, payload map[string]interface{}) (*ApplicationAchievement, error)

EditAchievement edits an achievement; payload holds the fields to change.

PATCH /applications/{application_id}/achievements/{achievement_id} discord.py-self: edit_achievement

func (*API) EditApplication

func (a *API) EditApplication(ctx context.Context, applicationID string, payload map[string]interface{}) (*Application, error)

EditApplication edits an application. payload holds the fields to change (name, description, icon, cover_image, flags, tags, ...), as in discord.py-self.

PATCH /applications/{application_id} discord.py-self: edit_application

func (*API) EditApplicationCommandPermissions

func (a *API) EditApplicationCommandPermissions(ctx context.Context, applicationID, guildID, commandID string, permissions []ApplicationCommandPermissions) (*GuildApplicationCommandPermissions, error)

EditApplicationCommandPermissions replaces the permissions of one command in a guild.

PUT /applications/{application_id}/guilds/{guild_id}/commands/{command_id}/permissions discord.py-self: edit_application_command_permissions

func (*API) EditApplicationIdentityConfig

func (a *API) EditApplicationIdentityConfig(ctx context.Context, applicationID, identityID string, config map[string]interface{}) error

EditApplicationIdentityConfig edits the display settings of one of your application identities; config is sent as the body.

PATCH /users/@me/application-identities/{application_id}/{identity_id}/config

func (*API) EditAutoModerationRule

func (a *API) EditAutoModerationRule(ctx context.Context, guildID, ruleID string, params *AutoModerationRuleParams, reason string) (*AutoModerationRule, error)

EditAutoModerationRule edits an auto moderation rule.

PATCH /guilds/{guild_id}/auto-moderation/rules/{rule_id} discord.py-self: edit_auto_moderation_rule

func (*API) EditBot

func (a *API) EditBot(ctx context.Context, applicationID string, payload map[string]interface{}) (*User, error)

EditBot edits the bot user of an application (username, avatar, banner, bio, ...).

PATCH /applications/{application_id}/bot discord.py-self: edit_bot

func (*API) EditBuild

func (a *API) EditBuild(ctx context.Context, applicationID, buildID, status string) error

EditBuild sets the status of a build (for example "SUCCEEDED" or "FAILED").

PATCH /applications/{application_id}/builds/{build_id} discord.py-self: edit_build

func (*API) EditChannel

func (a *API) EditChannel(ctx context.Context, channelID string, params *EditChannelParams, reason string) (*Channel, error)

EditChannel edits a channel, thread or group DM. reason is the audit-log reason.

PATCH /channels/{channel_id} discord.py-self: edit_channel

func (*API) EditChannelPermissions

func (a *API) EditChannelPermissions(ctx context.Context, channelID, target, allow, deny string, typ OverwriteType, reason string) error

EditChannelPermissions creates or replaces a permission overwrite for a role or member (target). allow and deny are the permission bit sets as decimal strings.

PUT /channels/{channel_id}/permissions/{target} discord.py-self: edit_channel_permissions

func (*API) EditConnection

func (a *API) EditConnection(ctx context.Context, connType, id string, params *EditConnectionParams) (*Connection, error)

EditConnection edits a connected account. connType is the connection type ("steam", "github", ...) and id the connection ID.

PATCH /users/@me/connections/{type}/{id} discord.py-self: edit_connection

func (*API) EditContentInventoryApplication

func (a *API) EditContentInventoryApplication(ctx context.Context, applicationID string, isSharing bool) error

EditContentInventoryApplication toggles sharing of an application in the content inventory.

PATCH /content-inventory/users/@me/applications/{application_id}

func (*API) EditCustomEmoji

func (a *API) EditCustomEmoji(ctx context.Context, guildID, emojiID string, params *EditCustomEmojiParams, reason string) (*Emoji, error)

EditCustomEmoji edits a custom emoji.

PATCH /guilds/{guild_id}/emojis/{emoji_id} discord.py-self: edit_custom_emoji

func (*API) EditDirectoryEntry

func (a *API) EditDirectoryEntry(ctx context.Context, channelID, entityID string, params *DirectoryEntryParams) (*DirectoryEntry, error)

EditDirectoryEntry edits a directory entry. A nil Description is not sent; discord.py-self turns a None description into "" (use a pointer to "").

PATCH /channels/{channel_id}/directory-entry/{entity_id} discord.py-self: edit_directory_entry

func (*API) EditEmailSettings

func (a *API) EditEmailSettings(ctx context.Context, params *EditEmailSettingsParams) (*EmailSettings, error)

EditEmailSettings edits the e-mail notification settings.

PATCH /users/@me/email-settings discord.py-self: edit_email_settings

func (*API) EditEmbeddedActivityConfig

func (a *API) EditEmbeddedActivityConfig(ctx context.Context, applicationID string, params *EditEmbeddedActivityConfigParams) (*EmbeddedActivityConfig, error)

EditEmbeddedActivityConfig edits the embedded activity config of an application.

PATCH /applications/{application_id}/embedded-activity-config discord.py-self: edit_embedded_activity_config

func (*API) EditFamilyCenterTeenConsents

func (a *API) EditFamilyCenterTeenConsents(ctx context.Context, teenID string, grant, revoke []string) (json.RawMessage, error)

EditFamilyCenterTeenConsents grants and revokes consents for a teen.

PATCH /family-center/{teen_id}/consents

func (*API) EditFamilyCenterTeenSettings

func (a *API) EditFamilyCenterTeenSettings(ctx context.Context, teenID, settings string) (json.RawMessage, error)

EditFamilyCenterTeenSettings updates a teen's settings. settings is the encoded settings proto exactly as the web client sends it.

PATCH /family-center/{teen_id}/settings-proto

func (*API) EditForumTag

func (a *API) EditForumTag(ctx context.Context, channelID, tagID, name string, params *ForumTagParams, reason string) (*ForumChannel, error)

EditForumTag replaces a tag. Like discord.py-self it always sends emoji_id, emoji_name (null when empty) and moderated.

PUT /channels/{channel_id}/tags/{tag_id} discord.py-self: edit_forum_tag

func (*API) EditGuild

func (a *API) EditGuild(ctx context.Context, guildID string, params *EditGuildParams, reason string) (*GuildWithCounts, error)

EditGuild edits a guild. reason is the audit-log reason.

PATCH /guilds/{guild_id} discord.py-self: edit_guild

func (*API) EditGuildIncidentActions

func (a *API) EditGuildIncidentActions(ctx context.Context, guildID string, params *EditIncidentActionsParams) (*IncidentData, error)

EditGuildIncidentActions sets or clears the invite and DM pauses of a guild. Use NullField to clear a pause.

PUT /guilds/{guild_id}/incident-actions discord.py-self: edit_incident_actions

func (*API) EditGuildMFALevel

func (a *API) EditGuildMFALevel(ctx context.Context, guildID string, level MFALevel, reason string) (*GuildMFALevel, error)

EditGuildMFALevel sets the MFA requirement for moderation actions.

POST /guilds/{guild_id}/mfa discord.py-self: edit_guild_mfa_level

func (*API) EditGuildOnboarding

func (a *API) EditGuildOnboarding(ctx context.Context, guildID string, params *EditGuildOnboardingParams, reason string) (*Onboarding, error)

EditGuildOnboarding replaces parts of the onboarding configuration of a guild.

PUT /guilds/{guild_id}/onboarding discord.py-self: edit_guild_onboarding

func (*API) EditGuildProfile

func (a *API) EditGuildProfile(ctx context.Context, guildID string, params *EditGuildProfileParams) (*GuildProfile, error)

EditGuildProfile edits the public guild profile.

PATCH /guilds/{guild_id}/profile discord.py-self: edit_guild_profile

func (*API) EditGuildSettings

func (a *API) EditGuildSettings(ctx context.Context, guildID string, params *EditGuildSettingsParams) (*UserGuildSettings, error)

EditGuildSettings edits the notification settings of a guild. Use guildID "@me" for direct messages.

PATCH /users/@me/guilds/{guild_id}/settings discord.py-self: edit_guild_settings

func (*API) EditGuildSettingsBulk

func (a *API) EditGuildSettingsBulk(ctx context.Context, guilds map[string]*EditGuildSettingsParams) ([]UserGuildSettings, error)

EditGuildSettingsBulk edits the notification settings of several guilds at once.

PATCH /users/@me/guilds/settings

func (*API) EditIntegration

func (a *API) EditIntegration(ctx context.Context, guildID, integrationID string, params *EditIntegrationParams) error

EditIntegration edits a stream integration.

PATCH /guilds/{guild_id}/integrations/{integration_id} discord.py-self: edit_integration

func (*API) EditLibraryEntry

func (a *API) EditLibraryEntry(ctx context.Context, applicationID, branchID string, params *EditLibraryEntryParams) (*LibraryApplication, error)

EditLibraryEntry edits a library entry (hidden, favorite, ... flags).

PATCH /users/@me/library/{application_id}/{branch_id} discord.py-self: edit_library_entry

func (*API) EditMe

func (a *API) EditMe(ctx context.Context, guildID string, params *EditMemberParams, reason string) (*Member, error)

EditMe edits your own member (nickname, per-guild avatar, banner, bio).

PATCH /guilds/{guild_id}/members/@me discord.py-self: edit_me

func (*API) EditMember

func (a *API) EditMember(ctx context.Context, guildID, userID string, params *EditMemberParams, reason string) (*Member, error)

EditMember edits a guild member. reason is the audit-log reason.

PATCH /guilds/{guild_id}/members/{user_id} discord.py-self: edit_member

func (*API) EditMemberNick

func (a *API) EditMemberNick(ctx context.Context, guildID, memberID string, nick *string) (*MemberNickname, error)

EditMemberNick sets (or, with a nil nick, clears) the nickname of a member through the dedicated nickname route.

PATCH /guilds/{guild_id}/members/{member_id}/nick

func (*API) EditMemberVerification

func (a *API) EditMemberVerification(ctx context.Context, guildID string, params *EditMemberVerificationParams, reason string) (*MemberVerification, error)

EditMemberVerification edits the member verification gate of a guild.

PATCH /guilds/{guild_id}/member-verification discord.py-self: edit_member_verification

func (*API) EditMessage

func (a *API) EditMessage(ctx context.Context, channelID, messageID string, params *EditMessageParams) (*Message, error)

EditMessage edits one of your messages.

PATCH /channels/{channel_id}/messages/{message_id} discord.py-self: edit_message

func (*API) EditMyVoiceState

func (a *API) EditMyVoiceState(ctx context.Context, guildID string, params *EditVoiceStateParams) error

EditMyVoiceState edits your own voice state in a stage channel.

PATCH /guilds/{guild_id}/voice-states/@me discord.py-self: edit_my_voice_state

func (*API) EditOnboardingResponses

func (a *API) EditOnboardingResponses(ctx context.Context, guildID string, params *OnboardingResponsesParams) (json.RawMessage, error)

EditOnboardingResponses replaces your onboarding answers.

PUT /guilds/{guild_id}/onboarding-responses

func (*API) EditPaymentSource

func (a *API) EditPaymentSource(ctx context.Context, sourceID string, params *EditPaymentSourceParams) (*PaymentSource, error)

EditPaymentSource edits a payment source.

PATCH /users/@me/billing/payment-sources/{source_id} discord.py-self: edit_payment_source

func (*API) EditProfile

func (a *API) EditProfile(ctx context.Context, params *EditProfileParams) (*UserWithToken, error)

EditProfile edits the account (profile fields, credentials, avatar, banner). The response carries the account token; after a password change the old token is invalid, so use UserWithToken.Token to build a new client.

PATCH /users/@me discord.py-self: edit_profile

func (*API) EditProtoSettings

func (a *API) EditProtoSettings(ctx context.Context, settingsType ProtoSettingsType, settings string, params *EditProtoSettingsParams) (*ProtoSettings, error)

EditProtoSettings replaces a protobuf settings blob. settings is the base64-encoded protobuf message (see EncodeProtoSettings).

PATCH /users/@me/settings-proto/{type} discord.py-self: edit_proto_settings

func (*API) EditRelationship

func (a *API) EditRelationship(ctx context.Context, userID string, params *EditRelationshipParams) error

EditRelationship edits a relationship (friend nickname).

PATCH /users/@me/relationships/{user_id} discord.py-self: edit_relationship

func (*API) EditRole

func (a *API) EditRole(ctx context.Context, guildID, roleID string, params *RoleParams, reason string) (*Role, error)

EditRole edits a role.

PATCH /guilds/{guild_id}/roles/{role_id} discord.py-self: edit_role

func (*API) EditRoleSubscriptionListing

func (a *API) EditRoleSubscriptionListing(ctx context.Context, guildID, groupListingID, listingID string, body interface{}) (json.RawMessage, error)

EditRoleSubscriptionListing edits a subscription tier.

PATCH /guilds/{guild_id}/role-subscriptions/group-listings/{group_listing_id}/subscription-listings/{subscription_listing_id}

func (*API) EditRoleSubscriptionListingTrial

func (a *API) EditRoleSubscriptionListingTrial(ctx context.Context, guildID, listingID string, body interface{}) (json.RawMessage, error)

EditRoleSubscriptionListingTrial edits the free trial of a subscription tier.

PATCH /guilds/{guild_id}/role-subscriptions/subscription-listings/{subscription_listing_id}/trial

func (*API) EditRoleSubscriptionSettings

func (a *API) EditRoleSubscriptionSettings(ctx context.Context, guildID string, body interface{}) (json.RawMessage, error)

EditRoleSubscriptionSettings edits the server subscription settings of a guild.

PATCH /guilds/{guild_id}/role-subscriptions/settings

func (*API) EditSKU

func (a *API) EditSKU(ctx context.Context, skuID string, payload map[string]interface{}) (*PrivateSKU, error)

EditSKU edits a SKU.

PATCH /store/skus/{sku_id} discord.py-self: edit_sku

func (*API) EditScheduledEvent

func (a *API) EditScheduledEvent(ctx context.Context, guildID, eventID string, params *ScheduledEventParams, reason string) (*GuildScheduledEventWithUserCount, error)

EditScheduledEvent edits a scheduled event (including starting, ending or cancelling it through Status).

PATCH /guilds/{guild_id}/scheduled-events/{guild_scheduled_event_id} discord.py-self: edit_scheduled_event

func (*API) EditScheduledEventException

func (a *API) EditScheduledEventException(ctx context.Context, guildID, eventID, exceptionID string, params *ScheduledEventExceptionParams) (json.RawMessage, error)

EditScheduledEventException edits an exception of a recurring event.

PATCH /guilds/{guild_id}/scheduled-events/{guild_scheduled_event_id}/exceptions/{exception_id}

func (*API) EditScheduledMessage

func (a *API) EditScheduledMessage(ctx context.Context, scheduledMessageID string, params *EditScheduledMessageParams) (json.RawMessage, error)

EditScheduledMessage edits a scheduled message.

PATCH /users/@me/scheduled-messages/{scheduled_message_id}

func (*API) EditSettings

func (a *API) EditSettings(ctx context.Context, params *EditSettingsParams) (*LegacyUserSettings, error)

EditSettings edits the legacy JSON user settings.

PATCH /users/@me/settings discord.py-self: edit_settings

func (*API) EditSoundboardSound

func (a *API) EditSoundboardSound(ctx context.Context, guildID, soundID string, params *SoundboardSoundParams) (*SoundboardSound, error)

EditSoundboardSound edits a soundboard sound of a guild.

PATCH /guilds/{guild_id}/soundboard-sounds/{soundboard_sound_id}

func (*API) EditStageInstance

func (a *API) EditStageInstance(ctx context.Context, channelID string, params *EditStageInstanceParams, reason string) (*StageInstance, error)

EditStageInstance edits the topic or privacy level of a running stage.

PATCH /stage-instances/{channel_id} discord.py-self: edit_stage_instance

func (*API) EditStoreListing

func (a *API) EditStoreListing(ctx context.Context, listingID string, payload map[string]interface{}) (*PrivateStoreListing, error)

EditStoreListing edits a store listing.

PATCH /store/listings/{listing_id} discord.py-self: edit_store_listing

func (*API) EditStreamRegion

func (a *API) EditStreamRegion(ctx context.Context, streamKey, region string) error

EditStreamRegion changes the voice region used by your stream.

PATCH /streams/{stream_key}/stream

func (*API) EditSubscription

func (a *API) EditSubscription(ctx context.Context, subscriptionID string, params *EditSubscriptionParams) (*Subscription, error)

EditSubscription edits a subscription (plan, payment source, cancel/reactivate via status).

PATCH /users/@me/billing/subscriptions/{subscription_id} discord.py-self: edit_subscription

func (*API) EditTeam

func (a *API) EditTeam(ctx context.Context, teamID string, payload map[string]interface{}) (*Team, error)

EditTeam edits a team (name, icon, owner_user_id, ...); payload holds the fields to change.

PATCH /teams/{team_id} discord.py-self: edit_team

func (*API) EditTemplate

func (a *API) EditTemplate(ctx context.Context, guildID, code string, params *EditTemplateParams) (*GuildTemplate, error)

EditTemplate edits the name or description of a template.

PATCH /guilds/{guild_id}/templates/{code} discord.py-self: edit_template

func (*API) EditTracking

func (a *API) EditTracking(ctx context.Context, grant, revoke []string) (*ConsentSettings, error)

EditTracking grants and revokes tracking consent categories ("personalization", "usage_statistics").

POST /users/@me/consent discord.py-self: edit_tracking

func (*API) EditVoiceChannelStatus

func (a *API) EditVoiceChannelStatus(ctx context.Context, channelID string, status *string, reason string) error

EditVoiceChannelStatus sets (or, with a nil status, clears) the status line of a voice channel.

PUT /channels/{channel_id}/voice-status discord.py-self: edit_voice_channel_status

func (*API) EditVoiceState

func (a *API) EditVoiceState(ctx context.Context, guildID, userID string, params *EditVoiceStateParams) error

EditVoiceState edits another member's voice state in a stage channel.

PATCH /guilds/{guild_id}/voice-states/{user_id} discord.py-self: edit_voice_state

func (*API) EditWebhook

func (a *API) EditWebhook(ctx context.Context, webhookID string, params *EditWebhookParams, reason string) (*Webhook, error)

EditWebhook edits a webhook with your account's credentials.

PATCH /webhooks/{webhook_id} discord.py-self: edit_webhook

func (*API) EditWebhookMessage

func (a *API) EditWebhookMessage(ctx context.Context, webhookID, token, messageID string, params *EditWebhookMessageParams) (*Message, error)

EditWebhookMessage edits a message previously sent by the webhook.

PATCH /webhooks/{webhook_id}/{webhook_token}/messages/{message_id} discord.py-self: edit_webhook_message

func (*API) EditWebhookWithToken

func (a *API) EditWebhookWithToken(ctx context.Context, webhookID, token string, params *EditWebhookParams, reason string) (*Webhook, error)

EditWebhookWithToken edits a webhook using its token (no account credentials sent).

PATCH /webhooks/{webhook_id}/{webhook_token} discord.py-self: edit_webhook_with_token

func (*API) EditWelcomeScreen

func (a *API) EditWelcomeScreen(ctx context.Context, guildID string, params *EditWelcomeScreenParams, reason string) (*WelcomeScreen, error)

EditWelcomeScreen edits the welcome screen of a guild.

PATCH /guilds/{guild_id}/welcome-screen discord.py-self: edit_welcome_screen

func (*API) EditWidget

func (a *API) EditWidget(ctx context.Context, guildID string, params *EditWidgetParams, reason string) (*GuildWidgetSettings, error)

EditWidget edits the widget settings of a guild. NullField on ChannelID removes the widget invite channel.

PATCH /guilds/{guild_id}/widget discord.py-self: edit_widget

func (*API) EnableGuildPowerup

func (a *API) EnableGuildPowerup(ctx context.Context, guildID, skuID string, params *PowerupGameServerParams) (json.RawMessage, error)

EnableGuildPowerup buys or enables a powerup SKU for a guild.

POST /guilds/{guild_id}/skus/{sku_id}

func (*API) EndPoll

func (a *API) EndPoll(ctx context.Context, channelID, messageID string) (*Message, error)

EndPoll ends a poll you created immediately and returns the updated message.

POST /channels/{channel_id}/polls/{message_id}/expire discord.py-self: end_poll

func (*API) EnrollActiveDeveloper

func (a *API) EnrollActiveDeveloper(ctx context.Context, applicationID, channelID string) (*ActiveDeveloperResponse, error)

EnrollActiveDeveloper enrolls an application in the Active Developer program.

POST /developers/active-program discord.py-self: enroll_active_developer

func (*API) EnrollQuest

func (a *API) EnrollQuest(ctx context.Context, questID string, params *QuestActionParams) (json.RawMessage, error)

EnrollQuest enrols you in a quest and returns your user status.

POST /quests/{quest_id}/enroll

func (*API) EstimatePrunedMembers

func (a *API) EstimatePrunedMembers(ctx context.Context, guildID string, days int, params *PruneMembersParams) (*GuildPrune, error)

EstimatePrunedMembers counts the members a prune would remove.

GET /guilds/{guild_id}/prune discord.py-self: estimate_pruned_members

func (*API) ExecuteWebhook

func (a *API) ExecuteWebhook(ctx context.Context, webhookID, token string, params *ExecuteWebhookParams) (*Message, error)

ExecuteWebhook posts a message through a webhook (no account credentials are sent; the token in the URL authorises the call). The returned message is nil unless params.Wait is set.

POST /webhooks/{webhook_id}/{webhook_token}?wait={0|1}&thread_id={thread_id} discord.py-self: execute_webhook

func (*API) FinishOAuth2Device

func (a *API) FinishOAuth2Device(ctx context.Context, userCode, result string) error

FinishOAuth2Device completes the device flow for a user code with the result chosen on the consent screen (for example "authorize" or "deny").

POST /oauth2/device/finish

func (*API) FinishWebAuthnConditionalLogin

func (a *API) FinishWebAuthnConditionalLogin(ctx context.Context, credential, ticket string, params *FinishWebAuthnLoginParams) (*LoginResponse, error)

FinishWebAuthnConditionalLogin completes a passkey login with the credential JSON produced by the authenticator.

POST /auth/conditional/finish

func (*API) FinishWebAuthnRegistration

func (a *API) FinishWebAuthnRegistration(ctx context.Context, name, ticket string, credential interface{}) (*WebAuthnRegistration, error)

FinishWebAuthnRegistration completes the registration with the browser's credential (the JSON of the WebAuthn attestation response).

POST /users/@me/mfa/webauthn/credentials

func (*API) FollowWebhook

func (a *API) FollowWebhook(ctx context.Context, channelID, webhookChannelID, reason string) (*FollowerWebhook, error)

FollowWebhook makes channelID (the destination) follow the announcement channel webhookChannelID, creating a channel-follower webhook.

POST /channels/{channel_id}/followers discord.py-self: follow_webhook

func (*API) ForgotPassword

func (a *API) ForgotPassword(ctx context.Context, login string) (string, error)

ForgotPassword sends a password reset email (or SMS) and returns the delivery method Discord used ("email" or "sms").

POST /auth/forgot

func (*API) GetAchievement

func (a *API) GetAchievement(ctx context.Context, applicationID, achievementID string) (*ApplicationAchievement, error)

GetAchievement returns one achievement.

GET /applications/{application_id}/achievements/{achievement_id} discord.py-self: get_achievement

func (*API) GetAchievements

func (a *API) GetAchievements(ctx context.Context, applicationID string) ([]ApplicationAchievement, error)

GetAchievements lists the achievements of an application.

GET /applications/{application_id}/achievements discord.py-self: get_achievements

func (*API) GetActivityJoinSecret

func (a *API) GetActivityJoinSecret(ctx context.Context, userID, sessionID, applicationID string, params *GetActivitySecretParams) (*ActivityJoinSecret, error)

GetActivityJoinSecret returns the join secret and URL of a user's activity session.

GET /users/{user_id}/sessions/{session_id}/activities/{application_id}/1

func (*API) GetActivityMetadata

func (a *API) GetActivityMetadata(ctx context.Context, userID, sessionID, applicationID string) (map[string]interface{}, error)

GetActivityMetadata returns the metadata of a user's activity session (nil when there is none).

GET /users/{user_id}/sessions/{session_id}/activities/{application_id}/metadata discord.py-self: get_activity_metadata

func (*API) GetActivitySecret

func (a *API) GetActivitySecret(ctx context.Context, userID, sessionID, applicationID string, actionType int, params *GetActivitySecretParams) (*ActivitySecret, error)

GetActivitySecret returns the join (1) or spectate (2) secret of a user's activity.

GET /users/{user_id}/sessions/{session_id}/activities/{application_id}/{action_type} discord.py-self: get_activity_secret

func (*API) GetActivityShelf

func (a *API) GetActivityShelf(ctx context.Context, guildID string) (json.RawMessage, error)

GetActivityShelf lists the embedded activities available to launch. guildID may be "".

GET /activities/shelf

func (*API) GetActivityStatistics

func (a *API) GetActivityStatistics(ctx context.Context) ([]UserActivityStatistics, error)

GetActivityStatistics lists your play time per application.

GET /users/@me/activities/statistics/applications discord.py-self: get_activity_statistics

func (*API) GetActivityTestMode

func (a *API) GetActivityTestMode(ctx context.Context, applicationID string) error

GetActivityTestMode checks whether an application is in activity test mode.

GET /activities/{application_id}/test-mode

func (*API) GetAdminServerEligibility

func (a *API) GetAdminServerEligibility(ctx context.Context, guildID string) (*AdminServerEligibility, error)

GetAdminServerEligibility reports whether the guild may join the admin server.

GET /guilds/{guild_id}/admin-server-eligibility discord.py-self: get_admin_server_eligibility

func (*API) GetAgeVerificationMethods

func (a *API) GetAgeVerificationMethods(ctx context.Context) (json.RawMessage, error)

GetAgeVerificationMethods lists the available age verification methods.

GET /age-verification/methods

func (*API) GetAgeVerificationMethodsV2

func (a *API) GetAgeVerificationMethodsV2(ctx context.Context) (json.RawMessage, error)

GetAgeVerificationMethodsV2 lists the available age verification methods (v2).

GET /age-verification/methods/v2

func (*API) GetAllCustomEmojis

func (a *API) GetAllCustomEmojis(ctx context.Context, guildID string) ([]Emoji, error)

GetAllCustomEmojis lists the custom emojis of a guild.

GET /guilds/{guild_id}/emojis discord.py-self: get_all_custom_emojis

func (*API) GetAllGuildChannels

func (a *API) GetAllGuildChannels(ctx context.Context, guildID string) ([]GuildChannel, error)

GetAllGuildChannels lists the channels of a guild (threads excluded).

GET /guilds/{guild_id}/channels discord.py-self: get_all_guild_channels

func (*API) GetAllGuildStickers

func (a *API) GetAllGuildStickers(ctx context.Context, guildID string) ([]GuildSticker, error)

GetAllGuildStickers lists the stickers of a guild.

GET /guilds/{guild_id}/stickers discord.py-self: get_all_guild_stickers

func (*API) GetAllIntegrations

func (a *API) GetAllIntegrations(ctx context.Context, guildID string, params *GetAllIntegrationsParams) ([]Integration, error)

GetAllIntegrations lists the integrations of a guild.

GET /guilds/{guild_id}/integrations discord.py-self: get_all_integrations

func (*API) GetApexExperiments

func (a *API) GetApexExperiments(ctx context.Context, surface int) (*ApexExperimentResponse, error)

GetApexExperiments returns the Apex experiment assignments of a surface.

GET /apex/experiments discord.py-self: get_apex_experiments

func (*API) GetApexExperimentsMetadata

func (a *API) GetApexExperimentsMetadata(ctx context.Context, surface int) (json.RawMessage, error)

GetApexExperimentsMetadata returns the metadata (titles, variants) of the Apex experiments of a surface.

GET /apex/experiments/metadata

func (*API) GetAppActivityStatistics

func (a *API) GetAppActivityStatistics(ctx context.Context, applicationID string) ([]ApplicationActivityStatistics, error)

GetAppActivityStatistics lists the play time of users on an application.

GET /activities/statistics/applications/{application_id} discord.py-self: get_app_activity_statistics

func (*API) GetAppAssets

func (a *API) GetAppAssets(ctx context.Context, applicationID string) ([]ApplicationAsset, error)

GetAppAssets lists the rich presence assets of an application.

GET /oauth2/applications/{application_id}/assets discord.py-self: get_app_assets

func (*API) GetAppBranches

func (a *API) GetAppBranches(ctx context.Context, applicationID string) ([]ApplicationBranch, error)

GetAppBranches lists the branches of an application.

GET /applications/{application_id}/branches discord.py-self: get_app_branches

func (*API) GetAppDirectoryApplication

func (a *API) GetAppDirectoryApplication(ctx context.Context, applicationID, locale string) (json.RawMessage, error)

GetAppDirectoryApplication returns one application directory listing.

GET /application-directory-static/applications/{application_id}

func (*API) GetAppDirectoryCategories

func (a *API) GetAppDirectoryCategories(ctx context.Context, locale string) (json.RawMessage, error)

GetAppDirectoryCategories lists the application directory categories.

GET /application-directory-static/categories

func (*API) GetAppDirectoryCollections

func (a *API) GetAppDirectoryCollections(ctx context.Context, query url.Values) (json.RawMessage, error)

GetAppDirectoryCollections lists the directory collections (surface, active_state, platform, locale, cache).

GET /application-directory-static/collections

func (*API) GetAppDirectoryEmbedApplication

func (a *API) GetAppDirectoryEmbedApplication(ctx context.Context, applicationID string) (json.RawMessage, error)

GetAppDirectoryEmbedApplication returns the embeddable listing of an application.

GET /application-directory/applications/{application_id}/embed

func (*API) GetAppDirectorySimilar

func (a *API) GetAppDirectorySimilar(ctx context.Context, applicationID string, query url.Values) (json.RawMessage, error)

GetAppDirectorySimilar lists applications similar to the given one.

GET /application-directory-static/applications/{application_id}/similar

func (*API) GetAppDisclosures

func (a *API) GetAppDisclosures(ctx context.Context, applicationID string) (json.RawMessage, error)

GetAppDisclosures returns the disclosures of an application.

GET /applications/{application_id}/disclosures

func (*API) GetAppDiscoverability

func (a *API) GetAppDiscoverability(ctx context.Context, applicationID string) (*ApplicationDiscoverability, error)

GetAppDiscoverability returns the discoverability checklist of an application.

GET /applications/{application_id}/discoverability-state discord.py-self: get_app_discoverability

func (*API) GetAppEntitlement

func (a *API) GetAppEntitlement(ctx context.Context, applicationID, entitlementID string) (*Entitlement, error)

GetAppEntitlement returns one application entitlement.

GET /applications/{application_id}/entitlements/{entitlement_id} discord.py-self: get_app_entitlement

func (*API) GetAppEntitlementTicket

func (a *API) GetAppEntitlementTicket(ctx context.Context, applicationID string, testMode bool) (*ApplicationTicket, error)

GetAppEntitlementTicket returns a ticket proving you own an application's entitlement.

POST /users/@me/applications/{application_id}/entitlement-ticket discord.py-self: get_app_entitlement_ticket

func (*API) GetAppEntitlements

func (a *API) GetAppEntitlements(ctx context.Context, applicationID string, params *GetAppEntitlementsParams) ([]Entitlement, error)

GetAppEntitlements lists the entitlements of an application.

GET /applications/{application_id}/entitlements discord.py-self: get_app_entitlements

func (a *API) GetAppManagedActivityLink(ctx context.Context, applicationID, linkID string) (json.RawMessage, error)

GetAppManagedActivityLink resolves a managed activity link.

GET /applications/{application_id}/managed-links/{link_id}

func (*API) GetAppManifestLabels

func (a *API) GetAppManifestLabels(ctx context.Context, applicationID string) ([]ApplicationManifestLabel, error)

GetAppManifestLabels lists the manifest labels of an application.

GET /applications/{application_id}/manifest-labels discord.py-self: get_app_manifest_labels

func (a *API) GetAppQuickActivityLink(ctx context.Context, applicationID, linkID string) (json.RawMessage, error)

GetAppQuickActivityLink resolves a quick activity link.

GET /applications/{application_id}/quick-links/{link_id}

func (*API) GetAppSKUs

func (a *API) GetAppSKUs(ctx context.Context, applicationID string, params *GetAppSKUsParams) ([]PrivateSKU, error)

GetAppSKUs lists the SKUs of an application.

GET /applications/{application_id}/skus discord.py-self: get_app_skus

func (*API) GetAppStoreListing

func (a *API) GetAppStoreListing(ctx context.Context, applicationID string, params *StoreLookupParams) (*PublicStoreListing, error)

GetAppStoreListing returns the published listing of an application.

GET /store/published-listings/applications/{application_id} discord.py-self: get_app_store_listing

func (*API) GetAppStoreListings

func (a *API) GetAppStoreListings(ctx context.Context, applicationID string, params *StoreLookupParams) ([]PublicStoreListing, error)

GetAppStoreListings lists the published listings of an application's SKUs.

GET /store/published-listings/skus discord.py-self: get_app_store_listings

func (*API) GetAppSubscriptionGroupListing

func (a *API) GetAppSubscriptionGroupListing(ctx context.Context, applicationID, listingID string) (json.RawMessage, error)

GetAppSubscriptionGroupListing returns an application subscription group listing.

GET /applications/{application_id}/subscription-group-listings/{listing_id}

func (*API) GetAppTicket

func (a *API) GetAppTicket(ctx context.Context, applicationID string, testMode bool) (*ApplicationTicket, error)

GetAppTicket returns a ticket proving you own an application.

POST /users/@me/applications/{application_id}/ticket discord.py-self: get_app_ticket

func (*API) GetAppWhitelisted

func (a *API) GetAppWhitelisted(ctx context.Context, applicationID string) ([]WhitelistedUser, error)

GetAppWhitelisted lists the users allowed to authorize an application (allowlist).

GET /oauth2/applications/{application_id}/allowlist discord.py-self: get_app_whitelisted

func (*API) GetAppWidgetConfigs

func (a *API) GetAppWidgetConfigs(ctx context.Context, applicationID string) (json.RawMessage, error)

GetAppWidgetConfigs returns the widget configuration of an application.

GET /applications/{application_id}/widget-configs

func (*API) GetApplicationCommandPermissions

func (a *API) GetApplicationCommandPermissions(ctx context.Context, applicationID, guildID, commandID string) (*GuildApplicationCommandPermissions, error)

GetApplicationCommandPermissions returns the permissions of one command in a guild.

GET /applications/{application_id}/guilds/{guild_id}/commands/{command_id}/permissions discord.py-self: get_application_command_permissions

func (*API) GetApplicationCommands

func (a *API) GetApplicationCommands(ctx context.Context, applicationID string) ([]ApplicationCommand, error)

GetApplicationCommands lists the commands of an application (as that application's owner; use the index calls to see commands usable as a user).

GET /applications/{application_id}/commands discord.py-self: get_application_commands

func (*API) GetApplicationsWithAssets

func (a *API) GetApplicationsWithAssets(ctx context.Context) (json.RawMessage, error)

GetApplicationsWithAssets lists your applications with their rich presence assets.

GET /applications-with-assets

func (*API) GetAppliedGuildSubscriptions

func (a *API) GetAppliedGuildSubscriptions(ctx context.Context) ([]PremiumGuildSubscription, error)

GetAppliedGuildSubscriptions lists the boosts you applied to guilds.

GET /users/@me/guilds/premium/subscriptions discord.py-self: get_applied_guild_subscriptions

func (*API) GetAppsStoreListing

func (a *API) GetAppsStoreListing(ctx context.Context, applicationIDs []string, params *StoreLookupParams) ([]PublicStoreListing, error)

GetAppsStoreListing returns the published listings of several applications.

GET /store/published-listings/applications discord.py-self: get_apps_store_listing

func (*API) GetArchivedThreads

func (a *API) GetArchivedThreads(ctx context.Context, channelID, kind string, opts *ArchivedThreadsOptions) (*ThreadPaginationPayload, error)

GetArchivedThreads is the generic form of the two calls above; kind is "public" or "private" (the web client's ALL_ARCHIVED_THREADS route).

GET /channels/{channel_id}/threads/archived/{kind}

func (*API) GetAttachmentURLs

func (a *API) GetAttachmentURLs(ctx context.Context, channelID string, attachments []UploadedAttachment) (*CloudAttachments, error)

GetAttachmentURLs asks for upload URLs for files that will be uploaded straight to Discord's cloud storage (see UploadCloudAttachment). Each UploadedAttachment needs an ID (the index as a string), Filename and FileSize.

POST /channels/{channel_id}/attachments discord.py-self: get_attachment_urls

func (*API) GetAuditLogs

func (a *API) GetAuditLogs(ctx context.Context, guildID string, params *GetAuditLogsParams) (*AuditLog, error)

GetAuditLogs fetches a page of the audit log of a guild.

GET /guilds/{guild_id}/audit-logs discord.py-self: get_audit_logs

func (*API) GetAuthLocationMetadata

func (a *API) GetAuthLocationMetadata(ctx context.Context) (json.RawMessage, error)

GetAuthLocationMetadata returns the login-location metadata (whether consent is required for the visitor's region).

GET /auth/location-metadata

func (*API) GetAutoModerationRule

func (a *API) GetAutoModerationRule(ctx context.Context, guildID, ruleID string) (*AutoModerationRule, error)

GetAutoModerationRule fetches one auto moderation rule.

GET /guilds/{guild_id}/auto-moderation/rules/{rule_id} discord.py-self: get_auto_moderation_rule

func (*API) GetAutoModerationRules

func (a *API) GetAutoModerationRules(ctx context.Context, guildID string) ([]AutoModerationRule, error)

GetAutoModerationRules lists the auto moderation rules of a guild.

GET /guilds/{guild_id}/auto-moderation/rules discord.py-self: get_auto_moderation_rules

func (*API) GetBan

func (a *API) GetBan(ctx context.Context, guildID, userID string) (*GuildBan, error)

GetBan fetches the ban of one user.

GET /guilds/{guild_id}/bans/{user_id} discord.py-self: get_ban

func (*API) GetBans

func (a *API) GetBans(ctx context.Context, guildID string, params *GetBansParams) ([]GuildBan, error)

GetBans lists the bans of a guild.

GET /guilds/{guild_id}/bans discord.py-self: get_bans

func (*API) GetBillingPopupBridgeState

func (a *API) GetBillingPopupBridgeState(ctx context.Context, paymentSourceType string) (string, error)

GetBillingPopupBridgeState starts a popup bridge for a payment source type (for example "paypal") and returns its state token.

POST /billing/popup-bridge/{payment_source_type}

func (*API) GetBranchBuild

func (a *API) GetBranchBuild(ctx context.Context, applicationID, branchID, buildID string) (*ApplicationBuild, error)

GetBranchBuild returns one build of a branch.

GET /applications/{application_id}/branches/{branch_id}/builds/{build_id} discord.py-self: get_branch_build

func (*API) GetBranchBuildDownloadSignatures

func (a *API) GetBranchBuildDownloadSignatures(ctx context.Context, applicationID, branchID, buildID string, manifestLabelIDs []string) (map[string]ApplicationDownloadSignature, error)

GetBranchBuildDownloadSignatures returns signed download URLs per manifest label.

POST /applications/{application_id}/download-signatures discord.py-self: get_branch_build_download_signatures

func (*API) GetBranchBuildSize

func (a *API) GetBranchBuildSize(ctx context.Context, applicationID, branchID, buildID string, manifestIDs []string) (*ApplicationBranchSize, error)

GetBranchBuildSize returns the download size of the given manifests of a build.

POST /applications/{application_id}/branches/{branch_id}/builds/{build_id}/size discord.py-self: get_branch_build_size

func (*API) GetBranchBuilds

func (a *API) GetBranchBuilds(ctx context.Context, applicationID, branchID string) ([]ApplicationBuild, error)

GetBranchBuilds lists the builds of a branch.

GET /applications/{application_id}/branches/{branch_id}/builds discord.py-self: get_branch_builds

func (*API) GetBuildIDs

func (a *API) GetBuildIDs(ctx context.Context, branchIDs []string) ([]ApplicationBranch, error)

GetBuildIDs resolves branches to their build IDs.

POST /branches discord.py-self: get_build_ids

func (*API) GetBuildUploadURLs

func (a *API) GetBuildUploadURLs(ctx context.Context, applicationID, buildID string, files []BuildUploadFile) ([]ApplicationCreatedBuildFile, error)

GetBuildUploadURLs requests signed upload URLs for the files of a build.

POST /applications/{application_id}/builds/{build_id}/files discord.py-self: get_build_upload_urls

func (*API) GetChannel

func (a *API) GetChannel(ctx context.Context, channelID string) (*Channel, error)

GetChannel fetches a channel (guild channel, thread, DM or group DM).

GET /channels/{channel_id} discord.py-self: get_channel

func (*API) GetChannelAffinities

func (a *API) GetChannelAffinities(ctx context.Context) (*ChannelAffinities, error)

GetChannelAffinities returns how active you are in each channel.

GET /users/@me/affinities/channels discord.py-self: get_channel_affinities

func (*API) GetChannelConversation

func (a *API) GetChannelConversation(ctx context.Context, channelID, conversationID string) (json.RawMessage, error)

GetChannelConversation fetches one conversation (returned raw).

GET /channels/{channel_id}/conversations/{conversation_id}

func (*API) GetChannelConversations

func (a *API) GetChannelConversations(ctx context.Context, channelID string, params *ChannelConversationsParams) (*ChannelConversations, error)

GetChannelConversations lists the AI-detected conversation threads of a channel.

GET /channels/{channel_id}/conversations

func (*API) GetCheckpoint

func (a *API) GetCheckpoint(ctx context.Context) (json.RawMessage, error)

GetCheckpoint returns the checkpoint recap data.

GET /checkpoint

func (*API) GetChurnUserOffer

func (a *API) GetChurnUserOffer(ctx context.Context) (json.RawMessage, error)

GetChurnUserOffer returns the retention offer shown when cancelling.

GET /users/@me/billing/churn-user-offer

func (*API) GetClaimedPromotions

func (a *API) GetClaimedPromotions(ctx context.Context, locale string) ([]ClaimedPromotion, error)

GetClaimedPromotions lists the outbound promotion codes you claimed. locale defaults to "en-US" when empty.

GET /users/@me/outbound-promotions/codes discord.py-self: get_claimed_promotions

func (*API) GetClaimedQuests

func (a *API) GetClaimedQuests(ctx context.Context) (json.RawMessage, error)

GetClaimedQuests lists the quests whose rewards you claimed.

GET /quests/@me/claimed

func (*API) GetClipsAutoclipsGameCapabilities

func (a *API) GetClipsAutoclipsGameCapabilities(ctx context.Context, gameID string) (json.RawMessage, error)

GetClipsAutoclipsGameCapabilities returns the autoclip capabilities of a game.

GET /clips/autoclips/game-capabilities/{game_id}

func (*API) GetClipsModuleAssets

func (a *API) GetClipsModuleAssets(ctx context.Context, modelSetVersion string) (json.RawMessage, error)

GetClipsModuleAssets lists the clip module asset catalogue.

GET /clips/module-assets

func (*API) GetCollectiblesCategories

func (a *API) GetCollectiblesCategories(ctx context.Context, query url.Values) (json.RawMessage, error)

GetCollectiblesCategories returns the collectibles shop categories (v2).

GET /collectibles-categories/v2

func (*API) GetCollectiblesMarketing

func (a *API) GetCollectiblesMarketing(ctx context.Context, platform string) (json.RawMessage, error)

GetCollectiblesMarketing returns the collectibles marketing content for a platform ("DESKTOP", ...).

GET /users/@me/collectibles-marketing

func (*API) GetCollectiblesProduct

func (a *API) GetCollectiblesProduct(ctx context.Context, skuID string, includeBundles *bool) (json.RawMessage, error)

GetCollectiblesProduct returns one collectibles shop product by SKU.

GET /collectibles-products/{sku_id}

func (*API) GetCollectiblesPurchases

func (a *API) GetCollectiblesPurchases(ctx context.Context, variantsReturnStyle string) (json.RawMessage, error)

GetCollectiblesPurchases lists the collectibles you own. variantsReturnStyle is passed as variants_return_style when not "".

GET /users/@me/collectibles-purchases

func (*API) GetCollectiblesSequencedOffers

func (a *API) GetCollectiblesSequencedOffers(ctx context.Context) (json.RawMessage, error)

GetCollectiblesSequencedOffers returns the current sequenced collection offers.

GET /collectibles-collection-sequenced-offers

func (*API) GetCollectiblesShop

func (a *API) GetCollectiblesShop(ctx context.Context, query url.Values) (json.RawMessage, error)

GetCollectiblesShop returns the collectibles shop home. query carries the options the web client sets (include_unpublished, no_cache, ...).

GET /collectibles-shop

func (*API) GetCompany

func (a *API) GetCompany(ctx context.Context, companyID string) (*ApplicationCompany, error)

GetCompany returns one company.

GET /company/{company_id} discord.py-self: get_company

func (*API) GetConjureApplicationChannels

func (a *API) GetConjureApplicationChannels(ctx context.Context, applicationID string) (json.RawMessage, error)

GetConjureApplicationChannels lists the channels a Conjure application can post to.

GET /conjure/applications/{application_id}/channels

func (*API) GetConjureProjectLimit

func (a *API) GetConjureProjectLimit(ctx context.Context) (json.RawMessage, error)

GetConjureProjectLimit returns how many Conjure projects you may have (max_projects).

GET /conjure/project-limit

func (*API) GetConjureProjects

func (a *API) GetConjureProjects(ctx context.Context, guildID string) (json.RawMessage, error)

GetConjureProjects lists your Conjure projects: those of a guild, or all projects including shared ones when guildID is empty.

GET /conjure/projects

func (*API) GetConnectionSessionHandoffStatus

func (a *API) GetConnectionSessionHandoffStatus(ctx context.Context, connType, state string) (json.RawMessage, error)

GetConnectionSessionHandoffStatus polls a session handoff by its state.

GET /connections/{type}/callback/session-handoff

func (*API) GetConnectionToken

func (a *API) GetConnectionToken(ctx context.Context, connType, id string) (*ConnectionAccessToken, error)

GetConnectionToken returns the access token of a connected account (Spotify, Twitch, ...).

GET /users/@me/connections/{type}/{id}/access-token discord.py-self: get_connection_token

func (*API) GetConnections

func (a *API) GetConnections(ctx context.Context) ([]Connection, error)

GetConnections lists the connected accounts of the current user.

GET /users/@me/connections discord.py-self: get_connections

func (*API) GetConsoleDevices

func (a *API) GetConsoleDevices(ctx context.Context, platform string) (json.RawMessage, error)

GetConsoleDevices lists the devices of a console platform (xbox, playstation).

GET /consoles/{platform}/devices

func (*API) GetContentInventoryOutbox

func (a *API) GetContentInventoryOutbox(ctx context.Context, userID string) (json.RawMessage, error)

GetContentInventoryOutbox returns a user's shared content outbox.

GET /content-inventory/users/{user_id}/outbox

func (*API) GetConversationMessages

func (a *API) GetConversationMessages(ctx context.Context, channelID, conversationID string, params *ConversationMessagesParams) (*ConversationMessages, error)

GetConversationMessages lists the messages of one conversation.

GET /channels/{channel_id}/conversations/{conversation_id}/messages

func (*API) GetCountryCode

func (a *API) GetCountryCode(ctx context.Context) (*CountryCode, error)

GetCountryCode returns the billing country code detected for you.

GET /users/@me/billing/country-code discord.py-self: get_country_code

func (*API) GetCreatorMonetizationRestrictions

func (a *API) GetCreatorMonetizationRestrictions(ctx context.Context, guildID string) (json.RawMessage, error)

GetCreatorMonetizationRestrictions fetches the monetization restrictions of a guild.

GET /guilds/{guild_id}/creator-monetization/restrictions

func (*API) GetCurrentQuests

func (a *API) GetCurrentQuests(ctx context.Context) (json.RawMessage, error)

GetCurrentQuests lists the quests currently available to you, with quest_enrollment_blocked_until and quest_access_suspended_until.

GET /quests/@me

func (*API) GetCustomEmoji

func (a *API) GetCustomEmoji(ctx context.Context, guildID, emojiID string) (*Emoji, error)

GetCustomEmoji fetches one custom emoji of a guild.

GET /guilds/{guild_id}/emojis/{emoji_id} discord.py-self: get_custom_emoji

func (*API) GetDMChannel

func (a *API) GetDMChannel(ctx context.Context, userID string) (*Channel, error)

GetDMChannel returns the existing DM channel with a user.

GET /users/@me/dms/{user_id}

func (*API) GetDetectableApplications

func (a *API) GetDetectableApplications(ctx context.Context) ([]DetectableApplication, error)

GetDetectableApplications lists the detectable (game detection) applications.

GET /applications/detectable discord.py-self: get_detectable_applications

func (*API) GetDetectableGames

func (a *API) GetDetectableGames(ctx context.Context) ([]DetectableApplication, error)

GetDetectableGames returns the detectable game list.

GET /games/detectable

func (*API) GetDetectableNonGames

func (a *API) GetDetectableNonGames(ctx context.Context) ([]DetectableApplication, error)

GetDetectableNonGames returns the detectable non-game applications.

GET /applications/non-games/detectable

func (*API) GetDeveloperWidgetConfigs

func (a *API) GetDeveloperWidgetConfigs(ctx context.Context) (*WidgetConfigs, error)

GetDeveloperWidgetConfigs lists the widget configs of your own applications.

GET /widget-configs/developer

func (*API) GetDirectoryBroadcastInfo

func (a *API) GetDirectoryBroadcastInfo(ctx context.Context, guildID string, entryType int, entityID string) (*DirectoryBroadcast, error)

GetDirectoryBroadcastInfo reports whether a guild can broadcast an entity to its linked directory channels (type 1 is a scheduled event).

GET /guilds/{guild_id}/directory-entries/broadcast discord.py-self: get_directory_broadcast_info

func (*API) GetDirectoryCounts

func (a *API) GetDirectoryCounts(ctx context.Context, channelID string) (DirectoryCounts, error)

GetDirectoryCounts returns the entry count per category.

GET /channels/{channel_id}/directory-entries/counts discord.py-self: get_directory_counts

func (*API) GetDirectoryEntries

func (a *API) GetDirectoryEntries(ctx context.Context, channelID string, params *DirectoryEntriesParams) ([]*DirectoryEntry, error)

GetDirectoryEntries lists the entries of a directory channel.

GET /channels/{channel_id}/directory-entries discord.py-self: get_directory_entries

func (*API) GetDirectoryEntry

func (a *API) GetDirectoryEntry(ctx context.Context, channelID, entityID string) (*DirectoryEntry, error)

GetDirectoryEntry fetches one directory entry.

GET /channels/{channel_id}/directory-entry/{entity_id} discord.py-self: get_directory_entry

func (*API) GetDiscoverableGuilds

func (a *API) GetDiscoverableGuilds(ctx context.Context, params *GetDiscoverableGuildsParams) (json.RawMessage, error)

GetDiscoverableGuilds lists the guilds of the server discovery page ({"total", "guilds"}).

GET /discoverable-guilds

func (*API) GetEULA

func (a *API) GetEULA(ctx context.Context, eulaID string) (*ApplicationEULA, error)

GetEULA returns an end user license agreement.

GET /store/eulas/{eula_id} discord.py-self: get_eula

func (*API) GetEligibleApplicationSubscriptionGuilds

func (a *API) GetEligibleApplicationSubscriptionGuilds(ctx context.Context, applicationID, skuID string) (json.RawMessage, error)

GetEligibleApplicationSubscriptionGuilds lists the guilds where an application subscription SKU can be bought.

GET /users/@me/billing/eligible-application-subscription-guilds

func (*API) GetEmailSettings

func (a *API) GetEmailSettings(ctx context.Context) (*EmailSettings, error)

GetEmailSettings returns the e-mail notification settings.

GET /users/@me/email-settings discord.py-self: get_email_settings

func (*API) GetEmbeddedActivityConfig

func (a *API) GetEmbeddedActivityConfig(ctx context.Context, applicationID string) (*EmbeddedActivityConfig, error)

GetEmbeddedActivityConfig returns the embedded activity config of an application.

GET /applications/{application_id}/embedded-activity-config discord.py-self: get_embedded_activity_config

func (*API) GetEmbeddedSurvey

func (a *API) GetEmbeddedSurvey(ctx context.Context, surveyID string) (json.RawMessage, error)

GetEmbeddedSurvey returns the details of an embedded (Qualtrics) survey.

GET /users/@me/embedded-survey/{survey_id}

func (*API) GetEmojiGuild

func (a *API) GetEmojiGuild(ctx context.Context, emojiID string) (*GuildWithCounts, error)

GetEmojiGuild fetches the guild an emoji belongs to.

GET /emojis/{emoji_id} discord.py-self: get_emoji_guild

func (*API) GetEmojiPacks

func (a *API) GetEmojiPacks(ctx context.Context) (json.RawMessage, error)

GetEmojiPacks lists the emoji packs. Discord answers 404 when emoji packs are not enabled for the account. The shape is not modelled, so it is returned raw.

GET /emoji-packs

func (*API) GetEmojiSource

func (a *API) GetEmojiSource(ctx context.Context, emojiID string) (*EmojiSource, error)

GetEmojiSource looks up the guild, application or pack an emoji belongs to.

GET /emojis/{emoji_id}/source

func (*API) GetExperiments

func (a *API) GetExperiments(ctx context.Context, params *GetExperimentsParams) (*ExperimentResponseWithGuild, error)

GetExperiments returns the experiment assignments of the account and the fingerprint of this session. The fingerprint of the response is what the REST layer can later send as the X-Fingerprint header (set it with RequestOptions.Headers or the Fingerprint field of LoginParams; the REST layer does not store it).

GET /experiments discord.py-self: get_experiments

func (*API) GetFamilyCenterConnectionPrerequisites

func (a *API) GetFamilyCenterConnectionPrerequisites(ctx context.Context, teenID, linkCode string) (json.RawMessage, error)

GetFamilyCenterConnectionPrerequisites checks whether a teen/link code pair can be connected.

GET /family-center/connection-prerequisites

func (*API) GetFamilyCenterLinkCode

func (a *API) GetFamilyCenterLinkCode(ctx context.Context) (json.RawMessage, error)

GetFamilyCenterLinkCode returns a fresh parent link code.

GET /family-center/@me/link-code

func (*API) GetFamilyCenterMe

func (a *API) GetFamilyCenterMe(ctx context.Context) (json.RawMessage, error)

GetFamilyCenterMe returns the family center state of the current user (teen activity, linked users, age group).

GET /family-center/@me

func (*API) GetFamilyCenterMoreActivity

func (a *API) GetFamilyCenterMoreActivity(ctx context.Context, teenID, rangeStartID, rangeEndID, actionType string) (json.RawMessage, error)

GetFamilyCenterMoreActivity pages a teen activity report. The four path segments are the web client's (teen id, range start id, range end id, action type) arguments in order.

GET /family-center/more-activity/{a}/{b}/{c}/{d}

func (*API) GetFamilyCenterTeenActivity

func (a *API) GetFamilyCenterTeenActivity(ctx context.Context, teenID string) (json.RawMessage, error)

GetFamilyCenterTeenActivity returns the activity report of a linked teen.

GET /family-center/{teen_id}/activity

func (*API) GetFamilyCenterTeenSettings

func (a *API) GetFamilyCenterTeenSettings(ctx context.Context, teenID string) (json.RawMessage, error)

GetFamilyCenterTeenSettings returns a teen's settings and consents.

GET /family-center/{teen_id}/settings-and-consents

func (*API) GetFeaturedWidgetConfigs

func (a *API) GetFeaturedWidgetConfigs(ctx context.Context) (*WidgetConfigs, error)

GetFeaturedWidgetConfigs lists the featured application widget configs.

GET /widget-configs/featured

func (*API) GetForumPosts

func (a *API) GetForumPosts(ctx context.Context, channelID string, threadIDs []string) ([]*Thread, error)

GetForumPosts fetches several forum posts (threads with their first message) of a forum channel by thread ID (the web client batches up to 10).

POST /channels/{channel_id}/post-data

func (*API) GetFriendInvites

func (a *API) GetFriendInvites(ctx context.Context) ([]InviteWithMetadata, error)

GetFriendInvites lists your active friend invites.

GET /users/@me/invites discord.py-self: get_friend_invites

func (*API) GetFriendSuggestions

func (a *API) GetFriendSuggestions(ctx context.Context) ([]FriendSuggestion, error)

GetFriendSuggestions lists suggested friends.

GET /friend-suggestions discord.py-self: get_friend_suggestions

func (*API) GetGameOrganizationInvite

func (a *API) GetGameOrganizationInvite(ctx context.Context, code string) (json.RawMessage, error)

GetGameOrganizationInvite returns a game organization invite.

GET /game-organization-invites/{code}

func (*API) GetGameOrganizationInviteCharacters

func (a *API) GetGameOrganizationInviteCharacters(ctx context.Context, code string) (json.RawMessage, error)

GetGameOrganizationInviteCharacters lists the characters you can join a game organization with.

GET /game-organization-invites/{code}/characters

func (*API) GetGameServerRegions

func (a *API) GetGameServerRegions(ctx context.Context) (json.RawMessage, error)

GetGameServerRegions lists the regions where you can create a game server.

GET /users/@me/game-server-regions

func (*API) GetGamesBlocklist

func (a *API) GetGamesBlocklist(ctx context.Context, etag string) (json.RawMessage, error)

GetGamesBlocklist returns the game-detection exclusions (executables and patterns). etag, when not empty, is sent as If-None-Match; a 304 is returned as an *APIError.

GET /games/detectable/exclusions

func (*API) GetGateway

func (a *API) GetGateway(ctx context.Context) (*GatewayResponse, error)

GetGateway returns the gateway URL. discord.py-self sends the account token on this call (it is not an unauthenticated route there).

GET /gateway discord.py-self: get_gateway

func (*API) GetGatewayNoAuth

func (a *API) GetGatewayNoAuth(ctx context.Context) (*GatewayResponse, error)

GetGatewayNoAuth is GetGateway without the Authorization header (the route is public).

GET /gateway

func (*API) GetGift

func (a *API) GetGift(ctx context.Context, code string, params *GetGiftParams) (*Gift, error)

GetGift resolves a gift code.

GET /entitlements/gift-codes/{code} discord.py-self: get_gift

func (*API) GetGiftBatchCSV

func (a *API) GetGiftBatchCSV(ctx context.Context, applicationID, batchID string) ([]byte, error)

GetGiftBatchCSV downloads the codes of a gift code batch as CSV.

GET /applications/{application_id}/gift-code-batches/{batch_id} discord.py-self: get_gift_batch_csv

func (*API) GetGiftBatches

func (a *API) GetGiftBatches(ctx context.Context, applicationID string) ([]GiftBatch, error)

GetGiftBatches lists the gift code batches of an application.

GET /applications/{application_id}/gift-code-batches discord.py-self: get_gift_batches

func (*API) GetGiftIntentDismissals

func (a *API) GetGiftIntentDismissals(ctx context.Context) (json.RawMessage, error)

GetGiftIntentDismissals lists the gift suggestions you dismissed.

GET /users/@me/gift-intent-dismissals

func (*API) GetGiftableEntitlements

func (a *API) GetGiftableEntitlements(ctx context.Context, countryCode string) ([]Entitlement, error)

GetGiftableEntitlements lists the entitlements you can gift. countryCode may be "".

GET /users/@me/entitlements/gifts discord.py-self: get_giftable_entitlements

func (*API) GetGlobalActivityStatistics

func (a *API) GetGlobalActivityStatistics(ctx context.Context, params *GetGlobalActivityStatisticsParams) ([]GlobalActivityStatistics, error)

GetGlobalActivityStatistics lists recent activity statistics across users and applications.

GET /activities discord.py-self: get_global_activity_statistics

func (*API) GetGravityAttachments

func (a *API) GetGravityAttachments(ctx context.Context) (json.RawMessage, error)

GetGravityAttachments lists the attachments of the discover feed.

GET /users/@me/gravity-attachments

func (*API) GetGravityContent

func (a *API) GetGravityContent(ctx context.Context, messageItems []GravityMessageItem, activityItems []json.RawMessage) (json.RawMessage, error)

GetGravityContent hydrates gravity ("catch me up") items: the answer holds "message_items" and "activity_items". activityItems is sent as given (the web client sends an empty list).

POST /gravity-content

func (*API) GetGravityCustomChannelScores

func (a *API) GetGravityCustomChannelScores(ctx context.Context) (json.RawMessage, error)

GetGravityCustomChannelScores fetches your custom channel scores for gravity.

GET /gravity-custom-channel-scores

func (*API) GetGravityICYMI

func (a *API) GetGravityICYMI(ctx context.Context, query url.Values) (json.RawMessage, error)

GetGravityICYMI returns the "In case you missed it" discover feed. query is the raw query the web client sends.

GET /users/@me/gravity-icymi

func (*API) GetGravityRecommendedGuilds

func (a *API) GetGravityRecommendedGuilds(ctx context.Context) (json.RawMessage, error)

GetGravityRecommendedGuilds fetches the guilds gravity recommends ({"guilds"}).

GET /gravity-recommended-guilds

func (*API) GetGravityTopicGuilds

func (a *API) GetGravityTopicGuilds(ctx context.Context, categoryIDs []int, offset int) (json.RawMessage, error)

GetGravityTopicGuilds fetches popular guilds for discovery categories ({"guilds"}).

POST /gravity-topic-guilds

func (*API) GetGuild

func (a *API) GetGuild(ctx context.Context, guildID string, params *GetGuildParams) (*GuildWithCounts, error)

GetGuild fetches a guild.

GET /guilds/{guild_id} discord.py-self: get_guild

func (*API) GetGuildAffinities

func (a *API) GetGuildAffinities(ctx context.Context) (*GuildAffinities, error)

GetGuildAffinities returns how active you are in each guild.

GET /users/@me/affinities/guilds discord.py-self: get_guild_affinities

func (*API) GetGuildApplicationCommandPermissions

func (a *API) GetGuildApplicationCommandPermissions(ctx context.Context, applicationID, guildID string) ([]GuildApplicationCommandPermissions, error)

GetGuildApplicationCommandPermissions returns the permissions of all commands of an application in a guild.

GET /applications/{application_id}/guilds/{guild_id}/commands/permissions discord.py-self: get_guild_application_command_permissions

func (*API) GetGuildApplications

func (a *API) GetGuildApplications(ctx context.Context, guildID string, params *GetGuildApplicationsParams) ([]PartialApplication, error)

GetGuildApplications lists the applications installed in a guild.

GET /guilds/{guild_id}/applications discord.py-self: get_guild_applications

func (*API) GetGuildBasic

func (a *API) GetGuildBasic(ctx context.Context, guildID string) (json.RawMessage, error)

GetGuildBasic fetches the basic public info of a guild. The shape is not modelled, so it is returned raw.

GET /guilds/{guild_id}/basic

func (*API) GetGuildEmbeddedApplications

func (a *API) GetGuildEmbeddedApplications(ctx context.Context, guildID, channelID, surface string) (json.RawMessage, error)

GetGuildEmbeddedApplications lists the activities that can be launched in a guild for a surface ({"items"}). The answer is returned raw.

GET /guilds/{guild_id}/embedded-applications

func (*API) GetGuildEntitlements

func (a *API) GetGuildEntitlements(ctx context.Context, guildID string, params *GetGuildEntitlementsParams) ([]Entitlement, error)

GetGuildEntitlements lists the entitlements of a guild.

GET /guilds/{guild_id}/entitlements discord.py-self: get_guild_entitlements

func (*API) GetGuildGameServerRegions

func (a *API) GetGuildGameServerRegions(ctx context.Context, guildID string) (json.RawMessage, error)

GetGuildGameServerRegions lists the regions a guild game server can run in.

GET /guilds/{guild_id}/game-server-regions

func (*API) GetGuildGameServers

func (a *API) GetGuildGameServers(ctx context.Context, guildID string) (json.RawMessage, error)

GetGuildGameServers lists the game servers of a guild.

GET /guilds/{guild_id}/game-servers

func (*API) GetGuildOnboarding

func (a *API) GetGuildOnboarding(ctx context.Context, guildID string) (*Onboarding, error)

GetGuildOnboarding fetches the onboarding configuration of a guild.

GET /guilds/{guild_id}/onboarding discord.py-self: get_guild_onboarding

func (*API) GetGuildPowerups

func (a *API) GetGuildPowerups(ctx context.Context, guildID string, includeEndsAt bool) (json.RawMessage, error)

GetGuildPowerups lists the powerups (guild upgrades) of a guild.

GET /guilds/{guild_id}/powerups

func (*API) GetGuildPreview

func (a *API) GetGuildPreview(ctx context.Context, guildID string) (*GuildPreview, error)

GetGuildPreview fetches the public preview of a guild.

GET /guilds/{guild_id}/preview discord.py-self: get_guild_preview

func (*API) GetGuildProfile

func (a *API) GetGuildProfile(ctx context.Context, guildID string) (*GuildProfile, error)

GetGuildProfile fetches the public guild profile (tag, badge, traits).

GET /guilds/{guild_id}/profile discord.py-self: get_guild_profile

func (*API) GetGuildRoleConnectionEligibility

func (a *API) GetGuildRoleConnectionEligibility(ctx context.Context, guildID, roleID string) (json.RawMessage, error)

GetGuildRoleConnectionEligibility reports whether you meet a linked role's requirements.

GET /guilds/{guild_id}/roles/{role_id}/connections/eligibility

func (*API) GetGuildRoleConnectionsConfigurations

func (a *API) GetGuildRoleConnectionsConfigurations(ctx context.Context, guildID string) (json.RawMessage, error)

GetGuildRoleConnectionsConfigurations lists the linked-role configurations of a guild.

GET /guilds/{guild_id}/roles/connections-configurations

func (*API) GetGuildRoom

func (a *API) GetGuildRoom(ctx context.Context, guildID, roomID string) (json.RawMessage, error)

GetGuildRoom fetches a room.

GET /guilds/{guild_id}/rooms/{room_id}

func (*API) GetGuildSticker

func (a *API) GetGuildSticker(ctx context.Context, guildID, stickerID string) (*GuildSticker, error)

GetGuildSticker fetches one sticker of a guild.

GET /guilds/{guild_id}/stickers/{sticker_id} discord.py-self: get_guild_sticker

func (*API) GetGuildSubscriptionSlots

func (a *API) GetGuildSubscriptionSlots(ctx context.Context) ([]PremiumGuildSubscriptionSlot, error)

GetGuildSubscriptionSlots lists your boost slots.

GET /users/@me/guilds/premium/subscription-slots discord.py-self: get_guild_subscription_slots

func (*API) GetGuildSubscriptions

func (a *API) GetGuildSubscriptions(ctx context.Context, guildID string) ([]PremiumGuildSubscription, error)

GetGuildSubscriptions lists the server boosts of a guild.

GET /guilds/{guild_id}/premium/subscriptions discord.py-self: get_guild_subscriptions

func (*API) GetGuildSubscriptionsCooldown

func (a *API) GetGuildSubscriptionsCooldown(ctx context.Context) (*PremiumGuildSubscriptionCooldown, error)

GetGuildSubscriptionsCooldown returns the boost transfer cooldown.

GET /users/@me/guilds/premium/subscriptions/cooldown discord.py-self: get_guild_subscriptions_cooldown

func (*API) GetGuildWebhookChannels

func (a *API) GetGuildWebhookChannels(ctx context.Context, guildID string) ([]WebhookChannel, error)

GetGuildWebhookChannels lists the channels of a guild a webhook scope can target.

GET /oauth2/authorize/webhook-channels discord.py-self: get_guild_webhook_channels

func (*API) GetGuilds

func (a *API) GetGuilds(ctx context.Context, params *GetUserGuildsParams) ([]UserGuild, error)

GetGuilds lists the guilds the account is in.

GET /users/@me/guilds discord.py-self: get_guilds

func (*API) GetInboundPromotions

func (a *API) GetInboundPromotions(ctx context.Context, locale, platform string) (json.RawMessage, error)

GetInboundPromotions lists inbound promotions (the web client's promotions banner). locale and platform may be empty.

GET /promotions

func (*API) GetIntegrationApplicationIDs

func (a *API) GetIntegrationApplicationIDs(ctx context.Context) (map[string][]string, error)

GetIntegrationApplicationIDs maps your guild IDs to the IDs of the integration applications installed in them.

GET /users/@me/guilds/integration-application-ids

func (*API) GetInvitableGameOrganizations

func (a *API) GetInvitableGameOrganizations(ctx context.Context, guildIDs []string) (json.RawMessage, error)

GetInvitableGameOrganizations lists game organizations you can invite to the given guilds.

GET /game-organizations/invitable/@me

func (*API) GetInvite

func (a *API) GetInvite(ctx context.Context, code string, params *GetInviteParams) (*Invite, error)

GetInvite resolves an invite code.

GET /invites/{invite_id} discord.py-self: get_invite

func (*API) GetInviteFriendMembers

func (a *API) GetInviteFriendMembers(ctx context.Context, code string) (*InviteFriendMembers, error)

GetInviteFriendMembers lists which of your friends are already in the guild an invite leads to.

GET /invites/{invite_id}/friend-members

func (*API) GetJoinRequest

func (a *API) GetJoinRequest(ctx context.Context, requestID string) (*JoinRequest, error)

GetJoinRequest fetches one join request.

GET /join-requests/{request_id} discord.py-self: get_join_request

func (*API) GetJoinRequestCooldown

func (a *API) GetJoinRequestCooldown(ctx context.Context, guildID string) (*JoinRequestCooldown, error)

GetJoinRequestCooldown fetches the cooldown before you can request to join again.

GET /guilds/{guild_id}/requests/@me/cooldown discord.py-self: get_join_request_cooldown

func (*API) GetJoinRequestGuilds

func (a *API) GetJoinRequestGuilds(ctx context.Context) ([]PartialGuild, error)

GetJoinRequestGuilds lists the guilds you have a pending join request for.

GET /users/@me/join-request-guilds discord.py-self: get_join_request_guilds

func (*API) GetJoinRequests

func (a *API) GetJoinRequests(ctx context.Context, guildID string, status JoinRequestStatus, params *GetJoinRequestsParams) (*JoinRequestList, error)

GetJoinRequests lists the join requests of a guild with the given status.

GET /guilds/{guild_id}/requests discord.py-self: get_join_requests

func (*API) GetJoinedPrivateArchivedThreads

func (a *API) GetJoinedPrivateArchivedThreads(ctx context.Context, channelID string, opts *ArchivedThreadsOptions) (*ThreadPaginationPayload, error)

GetJoinedPrivateArchivedThreads lists archived private threads you have joined.

GET /channels/{channel_id}/users/@me/threads/archived/private discord.py-self: get_joined_private_archived_threads

func (*API) GetLatestBranchBuild

func (a *API) GetLatestBranchBuild(ctx context.Context, applicationID, branchID string) (*ApplicationBuild, error)

GetLatestBranchBuild returns the latest build of a branch.

GET /applications/{application_id}/branches/{branch_id}/builds/latest discord.py-self: get_latest_branch_build

func (*API) GetLibraryEntries

func (a *API) GetLibraryEntries(ctx context.Context, countryCode string) ([]LibraryApplication, error)

GetLibraryEntries lists your game library. countryCode may be "".

GET /users/@me/library discord.py-self: get_library_entries

func (*API) GetLinkedUsers

func (a *API) GetLinkedUsers(ctx context.Context) (json.RawMessage, error)

GetLinkedUsers lists the accounts linked through Family Center.

GET /users/@me/linked-users

func (*API) GetLiveBranchBuild

func (a *API) GetLiveBranchBuild(ctx context.Context, applicationID, branchID, locale, platform string) (*ApplicationBuild, error)

GetLiveBranchBuild returns the live build of a branch for a locale and platform.

GET /applications/{application_id}/branches/{branch_id}/builds/live discord.py-self: get_live_branch_build

func (*API) GetLocationInfo

func (a *API) GetLocationInfo(ctx context.Context) (*LocationInfo, error)

GetLocationInfo returns the billing location information detected for you.

GET /users/@me/billing/location-info discord.py-self: get_location_info

func (*API) GetMe

func (a *API) GetMe(ctx context.Context, params *GetMeParams) (*User, error)

GetMe returns the current account.

GET /users/@me discord.py-self: get_me

func (*API) GetMember

func (a *API) GetMember(ctx context.Context, guildID, memberID string) (*Member, error)

GetMember fetches one member of a guild.

GET /guilds/{guild_id}/members/{member_id} discord.py-self: get_member

func (*API) GetMemberSafetySupplemental

func (a *API) GetMemberSafetySupplemental(ctx context.Context, guildID string, userIDs []string) (json.RawMessage, error)

GetMemberSafetySupplemental fetches the supplemental member safety data (join source, signals) for up to a page of users. The answer is a list that is not modelled, so it is returned raw.

POST /guilds/{guild_id}/members/supplemental

func (*API) GetMemberVerification

func (a *API) GetMemberVerification(ctx context.Context, guildID string, params *GetMemberVerificationParams) (*MemberVerification, error)

GetMemberVerification fetches the member verification form of a guild.

GET /guilds/{guild_id}/member-verification discord.py-self: get_member_verification

func (*API) GetMessage

func (a *API) GetMessage(ctx context.Context, channelID, messageID string) (*Message, error)

GetMessage fetches one message by asking for the single message around it, exactly as discord.py-self does (there is no single-message endpoint for user accounts). A 404 *APIError (code 10008, Unknown Message) is returned when the message does not exist.

GET /channels/{channel_id}/messages?limit=1&around={message_id} discord.py-self: get_message

func (*API) GetMessageInteractionData

func (a *API) GetMessageInteractionData(ctx context.Context, channelID, messageID string) (json.RawMessage, error)

GetMessageInteractionData fetches the interaction data of a message (the command invocation behind an application message). The shape is not modelled, so it is returned raw.

GET /channels/{channel_id}/messages/{message_id}/interaction-data

func (*API) GetMutualFriends

func (a *API) GetMutualFriends(ctx context.Context, userID string) ([]User, error)

GetMutualFriends lists the friends you share with a user.

GET /users/{user_id}/relationships discord.py-self: get_mutual_friends

func (*API) GetMyAchievements

func (a *API) GetMyAchievements(ctx context.Context, applicationID string) ([]ApplicationAchievement, error)

GetMyAchievements lists your progress on an application's achievements.

GET /users/@me/applications/{application_id}/achievements discord.py-self: get_my_achievements

func (*API) GetMyApplication

func (a *API) GetMyApplication(ctx context.Context, applicationID string) (*Application, error)

GetMyApplication returns one of your applications.

GET /applications/{application_id} discord.py-self: get_my_application

func (*API) GetMyApplications

func (a *API) GetMyApplications(ctx context.Context, params *GetMyApplicationsParams) ([]Application, error)

GetMyApplications lists the applications you own or can manage.

GET /applications discord.py-self: get_my_applications

func (*API) GetMyContentInventory

func (a *API) GetMyContentInventory(ctx context.Context, forGameProfile bool, feature string) (json.RawMessage, error)

GetMyContentInventory returns your content inventory feed. feature may be empty.

GET /content-inventory/users/@me

func (*API) GetMyGameServers

func (a *API) GetMyGameServers(ctx context.Context) (json.RawMessage, error)

GetMyGameServers lists your game servers.

GET /users/@me/game-servers

func (*API) GetNetworkingToken

func (a *API) GetNetworkingToken(ctx context.Context) (json.RawMessage, error)

GetNetworkingToken requests a token for the social SDK networking layer.

POST /networking/token

func (*API) GetNewMemberActions

func (a *API) GetNewMemberActions(ctx context.Context, guildID string) (json.RawMessage, error)

GetNewMemberActions fetches the new member checklist actions of a guild.

GET /guilds/{guild_id}/new-member-actions

func (*API) GetNewMemberWelcome

func (a *API) GetNewMemberWelcome(ctx context.Context, guildID string) (json.RawMessage, error)

GetNewMemberWelcome fetches the server guide (home) settings of a guild.

GET /guilds/{guild_id}/new-member-welcome

func (*API) GetNote

func (a *API) GetNote(ctx context.Context, userID string) (*UserNote, error)

GetNote returns the note on a user (404 when there is none).

GET /users/@me/notes/{user_id} discord.py-self: get_note

func (*API) GetNotes

func (a *API) GetNotes(ctx context.Context) (map[string]string, error)

GetNotes returns all notes, keyed by user ID.

GET /users/@me/notes discord.py-self: get_notes

func (*API) GetOAuth2Authorization

func (a *API) GetOAuth2Authorization(ctx context.Context, applicationID string, scopes []string, params *OAuth2AuthorizeQuery) (*OAuth2Authorization, error)

GetOAuth2Authorization previews an authorization request: the application, its bot and the guilds you can add it to.

GET /oauth2/authorize discord.py-self: get_oauth2_authorization

func (*API) GetOAuth2Me

func (a *API) GetOAuth2Me(ctx context.Context, bearerToken string) (json.RawMessage, error)

GetOAuth2Me returns the authorization of an OAuth2 bearer token (application, user, scopes, expiry). The bearer token replaces the account token on this call.

GET /oauth2/@me

func (*API) GetOAuth2Tokens

func (a *API) GetOAuth2Tokens(ctx context.Context) ([]OAuth2Token, error)

GetOAuth2Tokens lists the applications you have authorized.

GET /oauth2/tokens discord.py-self: get_oauth2_tokens

func (*API) GetOrbChallenges

func (a *API) GetOrbChallenges(ctx context.Context) (json.RawMessage, error)

GetOrbChallenges lists your Orb quests / achievements.

GET /users/@me/achievements/list?reward_type=orbs

func (*API) GetOrbChallengesUnreadState

func (a *API) GetOrbChallengesUnreadState(ctx context.Context) (json.RawMessage, error)

GetOrbChallengesUnreadState returns the unread state of the Orb challenges.

GET /users/@me/achievements/unread-state

func (*API) GetOrder

func (a *API) GetOrder(ctx context.Context, orderID string) (json.RawMessage, error)

GetOrder returns an order.

GET /billing/orders/{order_id}

func (*API) GetOrderEntitlements

func (a *API) GetOrderEntitlements(ctx context.Context, orderID string) (json.RawMessage, error)

GetOrderEntitlements lists the entitlements granted by an order.

GET /billing/orders/{order_id}/entitlements

func (*API) GetOwnJoinRequest

func (a *API) GetOwnJoinRequest(ctx context.Context, guildID string) (*JoinRequest, error)

GetOwnJoinRequest fetches your own join request in a guild.

GET /guilds/{guild_id}/requests/@me discord.py-self: get_own_join_request

func (*API) GetPartialApplication

func (a *API) GetPartialApplication(ctx context.Context, applicationID string) (*PartialApplication, error)

GetPartialApplication returns the RPC (partial) view of any application.

GET /oauth2/applications/{application_id}/rpc discord.py-self: get_partial_application

func (*API) GetPartnerStorefrontAnnouncement

func (a *API) GetPartnerStorefrontAnnouncement(ctx context.Context, guildID string) (json.RawMessage, error)

GetPartnerStorefrontAnnouncement returns the storefront announcement of a guild.

GET /partner-sdk/guilds/{guild_id}/application-storefront/announcement

func (*API) GetPartnerStorefrontConfig

func (a *API) GetPartnerStorefrontConfig(ctx context.Context) (json.RawMessage, error)

GetPartnerStorefrontConfig returns the storefront configuration of the partner SDK.

GET /partner-sdk/storefront-config

func (*API) GetPartnerStorefrontLaunchAnnouncement

func (a *API) GetPartnerStorefrontLaunchAnnouncement(ctx context.Context) (json.RawMessage, error)

GetPartnerStorefrontLaunchAnnouncement returns the storefront launch announcement.

GET /partner-sdk/storefront-launch-announcement

func (*API) GetPartnerStorefrontPreview

func (a *API) GetPartnerStorefrontPreview(ctx context.Context, applicationID, storefrontID string, query url.Values) (json.RawMessage, error)

GetPartnerStorefrontPreview returns one storefront preview.

GET /partner-sdk/applications/{application_id}/storefront/{storefront_id}/preview

func (*API) GetPartnerStorefrontsPreview

func (a *API) GetPartnerStorefrontsPreview(ctx context.Context, applicationID string) (json.RawMessage, error)

GetPartnerStorefrontsPreview lists the storefront previews of an application.

GET /partner-sdk/applications/{application_id}/storefronts/preview

func (*API) GetPayment

func (a *API) GetPayment(ctx context.Context, paymentID string) (*Payment, error)

GetPayment returns one payment.

GET /users/@me/billing/payments/{payment_id} discord.py-self: get_payment

func (*API) GetPaymentSource

func (a *API) GetPaymentSource(ctx context.Context, sourceID string) (*PaymentSource, error)

GetPaymentSource returns one payment source.

GET /users/@me/billing/payment-sources/{source_id} discord.py-self: get_payment_source

func (*API) GetPaymentSourceCreationContext

func (a *API) GetPaymentSourceCreationContext(ctx context.Context) (json.RawMessage, error)

GetPaymentSourceCreationContext returns the store country and allowed payment source types.

GET /users/@me/billing/payment-source-creation-context

func (*API) GetPaymentSources

func (a *API) GetPaymentSources(ctx context.Context) ([]PaymentSource, error)

GetPaymentSources lists your saved payment sources.

GET /users/@me/billing/payment-sources discord.py-self: get_payment_sources

func (*API) GetPayments

func (a *API) GetPayments(ctx context.Context, limit int, params *GetPaymentsParams) ([]Payment, error)

GetPayments lists your payments, newest first.

GET /users/@me/billing/payments discord.py-self: get_payments

func (*API) GetPollAnswerVoters

func (a *API) GetPollAnswerVoters(ctx context.Context, channelID, messageID, answerID string, params *PollVotersParams) (*PollAnswerVoters, error)

GetPollAnswerVoters lists the users who voted for a poll answer.

GET /channels/{channel_id}/polls/{message_id}/answers/{answer_id} discord.py-self: get_poll_answer_voters

func (*API) GetPremiumAffinity

func (a *API) GetPremiumAffinity(ctx context.Context) ([]User, error)

GetPremiumAffinity lists the users you are most likely to gift Nitro to.

GET /users/@me/billing/nitro-affinity discord.py-self: get_premium_affinity

func (*API) GetPremiumUsage

func (a *API) GetPremiumUsage(ctx context.Context) (*PremiumUsage, error)

GetPremiumUsage returns your Nitro feature usage.

GET /users/@me/premium-usage discord.py-self: get_premium_usage

func (*API) GetPriceTier

func (a *API) GetPriceTier(ctx context.Context, priceTier string) (map[string]int, error)

GetPriceTier returns the per-currency prices of a price tier.

GET /store/price-tiers/{price_tier} discord.py-self: get_price_tier

func (*API) GetPriceTiers

func (a *API) GetPriceTiers(ctx context.Context, params *GetPriceTiersParams) ([]int, error)

GetPriceTiers lists the available price tiers (in the smallest currency unit).

GET /store/price-tiers discord.py-self: get_price_tiers

func (*API) GetPricingPromotion

func (a *API) GetPricingPromotion(ctx context.Context) (*WrappedPricingPromotion, error)

GetPricingPromotion returns the localized pricing promotion.

GET /users/@me/billing/localized-pricing-promo discord.py-self: get_pricing_promotion

func (*API) GetPrivateArchivedThreads

func (a *API) GetPrivateArchivedThreads(ctx context.Context, channelID string, opts *ArchivedThreadsOptions) (*ThreadPaginationPayload, error)

GetPrivateArchivedThreads lists archived private threads of a channel.

GET /channels/{channel_id}/threads/archived/private discord.py-self: get_private_archived_threads

func (*API) GetPrivateChannels

func (a *API) GetPrivateChannels(ctx context.Context) ([]Channel, error)

GetPrivateChannels lists your DM and group DM channels.

GET /users/@me/channels discord.py-self: get_private_channels

func (*API) GetProgramRewards

func (a *API) GetProgramRewards(ctx context.Context) (json.RawMessage, error)

GetProgramRewards lists your program rewards.

GET /users/@me/program-rewards

func (*API) GetPromotions

func (a *API) GetPromotions(ctx context.Context, locale string) ([]Promotion, error)

GetPromotions lists the outbound promotions available to you. locale defaults to "en-US".

GET /outbound-promotions discord.py-self: get_promotions

func (*API) GetProtoSettings

func (a *API) GetProtoSettings(ctx context.Context, settingsType ProtoSettingsType) (*ProtoSettings, error)

GetProtoSettings returns a protobuf settings blob (base64 in ProtoSettings.Settings).

GET /users/@me/settings-proto/{type} discord.py-self: get_proto_settings

func (*API) GetPublicApplication

func (a *API) GetPublicApplication(ctx context.Context, applicationID string, withGuild bool) (*PartialApplication, error)

GetPublicApplication returns the public view of an application.

GET /applications/{application_id}/public discord.py-self: get_public_application

func (*API) GetPublicApplications

func (a *API) GetPublicApplications(ctx context.Context, applicationIDs []string) ([]PartialApplication, error)

GetPublicApplications returns the public view of several applications.

GET /applications/public discord.py-self: get_public_applications

func (*API) GetPublicArchivedThreads

func (a *API) GetPublicArchivedThreads(ctx context.Context, channelID string, opts *ArchivedThreadsOptions) (*ThreadPaginationPayload, error)

GetPublicArchivedThreads lists archived public threads of a channel.

GET /channels/{channel_id}/threads/archived/public discord.py-self: get_public_archived_threads

func (*API) GetPublicSKU

func (a *API) GetPublicSKU(ctx context.Context, skuID string) (json.RawMessage, error)

GetPublicSKU returns the public view of a SKU.

GET /store/skus/{sku_id}/public

func (*API) GetQuest

func (a *API) GetQuest(ctx context.Context, questID string) (json.RawMessage, error)

GetQuest returns one quest.

GET /quests/{quest_id}

func (*API) GetQuestCreativePreview

func (a *API) GetQuestCreativePreview(ctx context.Context, adCreativeIDs []string, placement string) (json.RawMessage, error)

GetQuestCreativePreview previews quest ad creatives. adCreativeIDs are the creatives and placement the placement number.

GET /quests/preview

func (*API) GetQuestDecision

func (a *API) GetQuestDecision(ctx context.Context, query url.Values) (json.RawMessage, error)

GetQuestDecision asks which quest to show in a placement. query holds placement, client_heartbeat_session_id, client_ad_session_id and visible_guild_ids (repeated).

GET /quests/decision

func (*API) GetQuestDecisions

func (a *API) GetQuestDecisions(ctx context.Context, query url.Values) (json.RawMessage, error)

GetQuestDecisions returns quest ad decisions. query holds placement, num_decisions_requested, client_heartbeat_session_id and client_ad_session_id.

GET /quests/get-decisions

func (*API) GetQuestEarnedDecision

func (a *API) GetQuestEarnedDecision(ctx context.Context, questIDs []string, content, heartbeatSessionID string) (json.RawMessage, error)

GetQuestEarnedDecision returns the earned-quest decision for the given quests and content location. heartbeatSessionID may be empty.

GET /quests/earned-decision

func (*API) GetQuestPreview

func (a *API) GetQuestPreview(ctx context.Context, questID string) (json.RawMessage, error)

GetQuestPreview returns the preview of a quest.

GET /quests/{quest_id}/preview

func (*API) GetQuestRewardCode

func (a *API) GetQuestRewardCode(ctx context.Context, questID string) (json.RawMessage, error)

GetQuestRewardCode returns the reward code of a completed quest.

GET /quests/{quest_id}/reward-code

func (*API) GetReactionUsers

func (a *API) GetReactionUsers(ctx context.Context, channelID, messageID string, emoji interface{}, limit int, params *ReactionUsersParams) ([]*User, error)

GetReactionUsers lists the users who reacted with an emoji (limit 1-100).

GET /channels/{channel_id}/messages/{message_id}/reactions/{emoji} discord.py-self: get_reaction_users

func (*API) GetRecentAvatars

func (a *API) GetRecentAvatars(ctx context.Context) (*UserAvatars, error)

GetRecentAvatars lists the avatars previously used on the account.

GET /users/@me/avatars discord.py-self: get_recent_avatars

func (*API) GetRecentMentions

func (a *API) GetRecentMentions(ctx context.Context, params *RecentMentionsParams) ([]Message, error)

GetRecentMentions lists recent messages that mention you.

GET /users/@me/mentions discord.py-self: get_recent_mentions

func (*API) GetRedditConnectionSubreddits

func (a *API) GetRedditConnectionSubreddits(ctx context.Context, id string) ([]map[string]interface{}, error)

GetRedditConnectionSubreddits lists the subreddits of a Reddit connection.

GET /users/@me/connections/reddit/{id}/subreddits discord.py-self: get_reddit_connection_subreddits

func (*API) GetReferralEligibleUsers

func (a *API) GetReferralEligibleUsers(ctx context.Context, index, limit int, searchQuery string) (json.RawMessage, error)

GetReferralEligibleUsers searches the users you can send a referral to.

POST /users/@me/referrals/eligible-users

func (*API) GetReferralOffer

func (a *API) GetReferralOffer(ctx context.Context, referralID string) (*TrialOffer, error)

GetReferralOffer resolves a referral code into a trial offer.

GET /referrals/{referral_id}

func (*API) GetReferralsRemaining

func (a *API) GetReferralsRemaining(ctx context.Context) (json.RawMessage, error)

GetReferralsRemaining returns your Nitro referral eligibility.

GET /users/@me/referrals/eligibility

func (*API) GetRelationships

func (a *API) GetRelationships(ctx context.Context) ([]Relationship, error)

GetRelationships lists friends, blocked users and pending requests.

GET /users/@me/relationships discord.py-self: get_relationships

func (*API) GetRingability

func (a *API) GetRingability(ctx context.Context, channelID string) (*CallEligibility, error)

GetRingability reports whether you can ring the call of a DM / group DM.

GET /channels/{channel_id}/call discord.py-self: get_ringability

func (*API) GetRole

func (a *API) GetRole(ctx context.Context, guildID, roleID string) (*Role, error)

GetRole fetches one role.

GET /guilds/{guild_id}/roles/{role_id} discord.py-self: get_role

func (*API) GetRoleMemberCounts

func (a *API) GetRoleMemberCounts(ctx context.Context, guildID string) (map[string]int, error)

GetRoleMemberCounts returns the number of members per role ID.

GET /guilds/{guild_id}/roles/member-counts discord.py-self: get_role_member_counts

func (*API) GetRoleMembers

func (a *API) GetRoleMembers(ctx context.Context, guildID, roleID string) ([]string, error)

GetRoleMembers lists the IDs of the members that have a role.

GET /guilds/{guild_id}/roles/{role_id}/member-ids discord.py-self: get_role_members

func (*API) GetRoleSubscriptionGroupListing

func (a *API) GetRoleSubscriptionGroupListing(ctx context.Context, guildID, groupListingID string, includeDraftListings, includeArchivedListings bool) (json.RawMessage, error)

GetRoleSubscriptionGroupListing fetches one subscription group listing.

GET /guilds/{guild_id}/role-subscriptions/group-listings/{group_listing_id}

func (*API) GetRoleSubscriptionGroupListings

func (a *API) GetRoleSubscriptionGroupListings(ctx context.Context, guildID string, includeSoftDeleted bool, countryCode string) (json.RawMessage, error)

GetRoleSubscriptionGroupListings lists the subscription group listings of a guild. includeSoftDeleted and countryCode are sent as given (countryCode when non-empty).

GET /guilds/{guild_id}/role-subscriptions/group-listings

func (*API) GetRoleSubscriptionSettings

func (a *API) GetRoleSubscriptionSettings(ctx context.Context, guildID string) (json.RawMessage, error)

GetRoleSubscriptionSettings fetches the server subscription settings of a guild.

GET /guilds/{guild_id}/role-subscriptions/settings

func (*API) GetRoleSubscriptionTrialEligibility

func (a *API) GetRoleSubscriptionTrialEligibility(ctx context.Context, guildID, listingID, trialID string) (json.RawMessage, error)

GetRoleSubscriptionTrialEligibility reports whether you may use a tier's free trial.

GET /guilds/{guild_id}/role-subscriptions/subscription-listings/{subscription_listing_id}/trial/{trial_id}/eligibility

func (*API) GetRoleSubscriptionTrials

func (a *API) GetRoleSubscriptionTrials(ctx context.Context, guildID string) (json.RawMessage, error)

GetRoleSubscriptionTrials lists the free trials of a guild's subscription tiers.

GET /guilds/{guild_id}/role-subscriptions/trials

func (*API) GetRoles

func (a *API) GetRoles(ctx context.Context, guildID string) ([]Role, error)

GetRoles lists the roles of a guild.

GET /guilds/{guild_id}/roles discord.py-self: get_roles

func (*API) GetSKU

func (a *API) GetSKU(ctx context.Context, skuID string, params *StoreLookupParams) (*PrivateSKU, error)

GetSKU returns one SKU (private view).

GET /store/skus/{sku_id} discord.py-self: get_sku

func (*API) GetSKUGifts

func (a *API) GetSKUGifts(ctx context.Context, skuID, subscriptionPlanID string) ([]Gift, error)

GetSKUGifts lists your gift codes for a SKU. subscriptionPlanID may be "".

GET /users/@me/entitlements/gift-codes discord.py-self: get_sku_gifts

func (*API) GetSKUStoreListings

func (a *API) GetSKUStoreListings(ctx context.Context, skuID string, params *StoreLookupParams) ([]PrivateStoreListing, error)

GetSKUStoreListings lists every store listing of a SKU.

GET /store/skus/{sku_id}/listings discord.py-self: get_sku_store_listings

func (*API) GetSafetyFlowsTask

func (a *API) GetSafetyFlowsTask(ctx context.Context) (json.RawMessage, error)

GetSafetyFlowsTask fetches the pending account safety task (a verification step). It returns nil when there is none (HTTP 204).

GET /safety-flows/task

func (*API) GetSavedMessageBookmarks

func (a *API) GetSavedMessageBookmarks(ctx context.Context, before string, limit int) (json.RawMessage, error)

GetSavedMessageBookmarks pages through your bookmarks, 25 at a time. before is the cursor returned with the previous page ("" for the first).

GET /users/@me/saved-messages/bookmarks

func (*API) GetSavedMessages

func (a *API) GetSavedMessages(ctx context.Context, bookmarkIDs bool) (json.RawMessage, error)

GetSavedMessages lists your saved messages and reminders. With bookmarkIDs the response also carries the bookmark IDs.

GET /users/@me/saved-messages

func (*API) GetScheduledEvent

func (a *API) GetScheduledEvent(ctx context.Context, guildID, eventID string, withUserCount bool) (*GuildScheduledEventWithUserCount, error)

GetScheduledEvent fetches one scheduled event.

GET /guilds/{guild_id}/scheduled-events/{guild_scheduled_event_id} discord.py-self: get_scheduled_event

func (*API) GetScheduledEventUserCounts

func (a *API) GetScheduledEventUserCounts(ctx context.Context, guildID, eventID string, exceptionIDs []string) (*ScheduledEventUserCounts, error)

GetScheduledEventUserCounts returns how many users are interested in a recurring event and in each of the given exceptions.

GET /guilds/{guild_id}/scheduled-events/{guild_scheduled_event_id}/users/counts

func (*API) GetScheduledEventUsers

func (a *API) GetScheduledEventUsers(ctx context.Context, guildID, eventID string, params *GetScheduledEventUsersParams) (*ScheduledEventUsersWithMember, error)

GetScheduledEventUsers lists the users interested in a scheduled event. Users carry their guild member when WithMember is set.

GET /guilds/{guild_id}/scheduled-events/{guild_scheduled_event_id}/users discord.py-self: get_scheduled_event_users

func (*API) GetScheduledEvents

func (a *API) GetScheduledEvents(ctx context.Context, guildID string, withUserCount bool) ([]GuildScheduledEventWithUserCount, error)

GetScheduledEvents lists the scheduled events of a guild.

GET /guilds/{guild_id}/scheduled-events discord.py-self: get_scheduled_events

func (*API) GetScheduledMessages

func (a *API) GetScheduledMessages(ctx context.Context) (json.RawMessage, error)

GetScheduledMessages lists your scheduled messages.

GET /users/@me/scheduled-messages

func (*API) GetSettings

func (a *API) GetSettings(ctx context.Context) (*LegacyUserSettings, error)

GetSettings returns the legacy JSON user settings.

GET /users/@me/settings discord.py-self: get_settings

func (*API) GetSomeDirectoryEntries

func (a *API) GetSomeDirectoryEntries(ctx context.Context, channelID string, entityIDs []string) ([]*PartialDirectoryEntry, error)

GetSomeDirectoryEntries fetches specific entries by entity ID.

GET /channels/{channel_id}/directory-entries/list discord.py-self: get_some_directory_entries

func (*API) GetSoundboardDefaultSounds

func (a *API) GetSoundboardDefaultSounds(ctx context.Context) ([]SoundboardSound, error)

GetSoundboardDefaultSounds lists Discord's default soundboard sounds.

GET /soundboard-default-sounds

func (*API) GetSoundboardSoundGuild

func (a *API) GetSoundboardSoundGuild(ctx context.Context, soundID, guildID string) (json.RawMessage, error)

GetSoundboardSoundGuild fetches the guild data of a soundboard sound. The shape is not modelled, so it is returned raw.

GET /soundboard-sounds/{soundboard_sound_id}/guild/{guild_id}

func (*API) GetStageInstance

func (a *API) GetStageInstance(ctx context.Context, channelID string) (*StageInstance, error)

GetStageInstance fetches the live stage instance of a stage channel.

GET /stage-instances/{channel_id} discord.py-self: get_stage_instance

func (*API) GetSticker

func (a *API) GetSticker(ctx context.Context, stickerID string) (*Sticker, error)

GetSticker fetches a sticker.

GET /stickers/{sticker_id} discord.py-self: get_sticker

func (*API) GetStickerGuild

func (a *API) GetStickerGuild(ctx context.Context, stickerID string) (*GuildWithCounts, error)

GetStickerGuild fetches the guild a guild sticker belongs to.

GET /stickers/{sticker_id}/guild discord.py-self: get_sticker_guild

func (*API) GetStickerPack

func (a *API) GetStickerPack(ctx context.Context, packID string) (*StickerPack, error)

GetStickerPack fetches one sticker pack.

GET /sticker-packs/{pack_id} discord.py-self: get_sticker_pack

func (*API) GetStoreAssets

func (a *API) GetStoreAssets(ctx context.Context, applicationID string) ([]StoreAsset, error)

GetStoreAssets lists the store assets of an application.

GET /store/applications/{application_id}/assets discord.py-self: get_store_assets

func (*API) GetStoreListing

func (a *API) GetStoreListing(ctx context.Context, listingID string, params *StoreLookupParams) (*PrivateStoreListing, error)

GetStoreListing returns one store listing (private view).

GET /store/listings/{listing_id} discord.py-self: get_store_listing

func (*API) GetStoreListingBySKU

func (a *API) GetStoreListingBySKU(ctx context.Context, skuID string, params *StoreLookupParams) (*PublicStoreListing, error)

GetStoreListingBySKU returns the published store listing of a SKU.

GET /store/published-listings/skus/{sku_id} discord.py-self: get_store_listing_by_sku

func (*API) GetStoreListingSubscriptionPlans

func (a *API) GetStoreListingSubscriptionPlans(ctx context.Context, skuID string, params *SubscriptionPlanLookupParams) ([]SubscriptionPlan, error)

GetStoreListingSubscriptionPlans lists the subscription plans of a SKU's published listing.

GET /store/published-listings/skus/{sku_id}/subscription-plans discord.py-self: get_store_listing_subscription_plans

discord.py-self builds the query but never sends it (a bug); here the options are sent.

func (*API) GetStoreListingsSubscriptionPlans

func (a *API) GetStoreListingsSubscriptionPlans(ctx context.Context, skuIDs []string, params *SubscriptionPlanLookupParams) ([]SubscriptionPlan, error)

GetStoreListingsSubscriptionPlans lists the subscription plans of several SKUs.

GET /store/published-listings/skus/subscription-plans discord.py-self: get_store_listings_subscription_plans

discord.py-self only sends sku_ids (the options it builds are dropped); here they are sent too.

func (*API) GetStorefrontCollection

func (a *API) GetStorefrontCollection(ctx context.Context, collectionID string, query url.Values) (json.RawMessage, error)

GetStorefrontCollection returns a storefront collection with its products. query holds locale, guild_id, include_unpublished_products and include_unpublished_collection.

GET /storefront/collections/{collection_id}

func (*API) GetStorefrontPricing

func (a *API) GetStorefrontPricing(ctx context.Context, applicationID string, skuIDs []string, countryCode, promotionIDOverride string) (json.RawMessage, error)

GetStorefrontPricing returns storefront prices for an application (applicationID) or for SKUs (skuIDs, when applicationID is empty).

GET /storefront/pricing

func (*API) GetStorefrontProductBySKU

func (a *API) GetStorefrontProductBySKU(ctx context.Context, skuID, locale string) (json.RawMessage, error)

GetStorefrontProductBySKU returns the storefront product of a SKU.

GET /storefront/products/sku/{sku_id}

func (*API) GetStorefrontPromotions

func (a *API) GetStorefrontPromotions(ctx context.Context, applicationIDs []string, promotionIDOverride string) (json.RawMessage, error)

GetStorefrontPromotions lists the storefront promotions of applications. promotionIDOverride may be empty.

GET /storefront/promotions

func (*API) GetStreamPreview

func (a *API) GetStreamPreview(ctx context.Context, streamKey string) (*StreamPreview, error)

GetStreamPreview fetches the preview thumbnail URL of a go-live stream. The stream key looks like "guild:{guild_id}:{channel_id}:{owner_id}" or "call:{channel_id}:{owner_id}".

GET /streams/{stream_key}/preview discord.py-self: get_stream_preview

func (*API) GetStripePaymentIntent

func (a *API) GetStripePaymentIntent(ctx context.Context, paymentID string) (*StripePaymentIntent, error)

GetStripePaymentIntent returns the Stripe payment intent of a payment.

GET /users/@me/billing/stripe/payment-intents/payments/{payment_id}

func (*API) GetSubscribedScheduledEvents

func (a *API) GetSubscribedScheduledEvents(ctx context.Context, guildIDs []string) ([]SubscribedGuildScheduledEvent, error)

GetSubscribedScheduledEvents lists the scheduled events you are interested in within the given guilds.

GET /users/@me/scheduled-events discord.py-self: get_subscribed_scheduled_events

func (*API) GetSubscription

func (a *API) GetSubscription(ctx context.Context, subscriptionID string) (*Subscription, error)

GetSubscription returns one subscription.

GET /users/@me/billing/subscriptions/{subscription_id} discord.py-self: get_subscription

func (*API) GetSubscriptionInvoices

func (a *API) GetSubscriptionInvoices(ctx context.Context, subscriptionID string) ([]SubscriptionInvoice, error)

GetSubscriptionInvoices lists the invoices of a subscription.

GET /users/@me/billing/subscriptions/{subscription_id}/invoices discord.py-self: get_subscription_invoices

func (*API) GetSubscriptionPlanGroupListing

func (a *API) GetSubscriptionPlanGroupListing(ctx context.Context, planID string) (json.RawMessage, error)

GetSubscriptionPlanGroupListing returns the subscription group listing a plan belongs to.

GET /subscription-plans/{plan_id}/subscription-group-listing

func (*API) GetSubscriptionPlanGuildRoleGroupListing

func (a *API) GetSubscriptionPlanGuildRoleGroupListing(ctx context.Context, planID string) (json.RawMessage, error)

GetSubscriptionPlanGuildRoleGroupListing returns the guild role subscription group listing of a plan.

GET /subscription-plans/{plan_id}/guild-role-subscription-group-listing

func (*API) GetSubscriptionPreview

func (a *API) GetSubscriptionPreview(ctx context.Context, subscriptionID string) (*SubscriptionInvoice, error)

GetSubscriptionPreview previews the next invoice of a subscription.

GET /users/@me/billing/subscriptions/{subscription_id}/preview discord.py-self: get_subscription_preview

func (*API) GetSubscriptions

func (a *API) GetSubscriptions(ctx context.Context, params *GetSubscriptionsParams) ([]Subscription, error)

GetSubscriptions lists your subscriptions.

GET /users/@me/billing/subscriptions discord.py-self: get_subscriptions

func (*API) GetSuggestedWidgetGames

func (a *API) GetSuggestedWidgetGames(ctx context.Context) (json.RawMessage, error)

GetSuggestedWidgetGames lists the games suggested for profile widgets.

GET /users/@me/widgets/suggested-games

func (*API) GetSuspendedAgeVerificationMethods

func (a *API) GetSuspendedAgeVerificationMethods(ctx context.Context, token string) (json.RawMessage, error)

GetSuspendedAgeVerificationMethods lists the methods available to a suspended user holding the given suspension token.

POST /age-verification/suspended/methods

func (*API) GetSuspendedAgeVerificationMethodsV2

func (a *API) GetSuspendedAgeVerificationMethodsV2(ctx context.Context, token string) (json.RawMessage, error)

GetSuspendedAgeVerificationMethodsV2 is the v2 variant of GetSuspendedAgeVerificationMethods.

POST /age-verification/suspended/methods/v2

func (*API) GetTeam

func (a *API) GetTeam(ctx context.Context, teamID string) (*Team, error)

GetTeam returns one team.

GET /teams/{team_id} discord.py-self: get_team

func (*API) GetTeamApplications

func (a *API) GetTeamApplications(ctx context.Context, teamID string) ([]Application, error)

GetTeamApplications lists the applications of a team.

GET /teams/{team_id}/applications discord.py-self: get_team_applications

func (*API) GetTeamMembers

func (a *API) GetTeamMembers(ctx context.Context, teamID string) ([]TeamMember, error)

GetTeamMembers lists the members of a team.

GET /teams/{team_id}/members discord.py-self: get_team_members

func (*API) GetTeamPayoutReport

func (a *API) GetTeamPayoutReport(ctx context.Context, teamID, payoutID, reportType string) ([]byte, error)

GetTeamPayoutReport downloads a payout report (reportType is "report" or "invoice" style as in discord.py-self) and returns the raw file bytes.

GET /teams/{team_id}/payouts/{payout_id}/report discord.py-self: get_team_payout_report

func (*API) GetTeamPayouts

func (a *API) GetTeamPayouts(ctx context.Context, teamID string, params *GetTeamPayoutsParams) ([]TeamPayout, error)

GetTeamPayouts lists the payouts of a team.

GET /teams/{team_id}/payouts discord.py-self: get_team_payouts

func (*API) GetTeams

func (a *API) GetTeams(ctx context.Context, params *GetTeamsParams) ([]Team, error)

GetTeams lists your teams.

GET /teams discord.py-self: get_teams

func (*API) GetTemplate

func (a *API) GetTemplate(ctx context.Context, code string) (*GuildTemplate, error)

GetTemplate resolves a guild template by code.

GET /guilds/templates/{code} discord.py-self: get_template

func (*API) GetThreadsBulk

func (a *API) GetThreadsBulk(ctx context.Context, threadIDs []string) ([]*Thread, error)

GetThreadsBulk fetches several threads by ID in one call.

POST /threads/bulk

func (*API) GetTopEmojis

func (a *API) GetTopEmojis(ctx context.Context, guildID string) (*TopEmojis, error)

GetTopEmojis lists the emojis used most in a guild (by rank).

GET /guilds/{guild_id}/top-emojis discord.py-self: get_top_emojis

func (*API) GetTopGuildChannels

func (a *API) GetTopGuildChannels(ctx context.Context, guildID string) (json.RawMessage, error)

GetTopGuildChannels lists the channels you read the most in a guild. The answer shape is not modelled, so it is returned raw.

GET /guilds/{guild_id}/top-read-channels discord.py-self: get_top_guild_channels

func (*API) GetTopSoundboardSounds

func (a *API) GetTopSoundboardSounds(ctx context.Context, guildID string) (*TopSoundboardSounds, error)

GetTopSoundboardSounds lists the most used soundboard sounds of a guild.

GET /guilds/{guild_id}/top-soundboard-sounds

func (*API) GetTracking

func (a *API) GetTracking(ctx context.Context) (*ConsentSettings, error)

GetTracking returns the tracking consent settings.

GET /users/@me/consent discord.py-self: get_tracking

func (*API) GetTrendingGifCategories

func (a *API) GetTrendingGifCategories(ctx context.Context, params *GifQueryParams) (json.RawMessage, error)

GetTrendingGifCategories returns the trending GIF categories and a preview GIF.

GET /gifs/trending

func (*API) GetTrendingGifs

func (a *API) GetTrendingGifs(ctx context.Context, params *GifQueryParams) (json.RawMessage, error)

GetTrendingGifs returns the trending GIFs.

GET /gifs/trending-gifs

func (*API) GetTrialOffer

func (a *API) GetTrialOffer(ctx context.Context) (*TrialOffer, error)

GetTrialOffer returns the Nitro trial offer available to you.

GET /users/@me/billing/user-trial-offer discord.py-self: get_trial_offer

func (*API) GetUser

func (a *API) GetUser(ctx context.Context, userID string) (*User, error)

GetUser returns a user by ID.

GET /users/{user_id} discord.py-self: get_user

func (*API) GetUserAffinities

func (a *API) GetUserAffinities(ctx context.Context) (*UserAffinities, error)

GetUserAffinities returns how close you are to other users.

GET /users/@me/affinities/users discord.py-self: get_user_affinities

func (*API) GetUserAffinitiesV2

func (a *API) GetUserAffinitiesV2(ctx context.Context) (json.RawMessage, error)

GetUserAffinitiesV2 returns the v2 user affinities (segments, DM probability).

GET /users/@me/affinities/v2/users

func (*API) GetUserAppEntitlements

func (a *API) GetUserAppEntitlements(ctx context.Context, applicationID string, params *GetUserAppEntitlementsParams) ([]Entitlement, error)

GetUserAppEntitlements lists your entitlements for one application.

GET /users/@me/applications/{application_id}/entitlements discord.py-self: get_user_app_entitlements

func (*API) GetUserApplicationIdentities

func (a *API) GetUserApplicationIdentities(ctx context.Context, userID string) (json.RawMessage, error)

GetUserApplicationIdentities lists the application identities (game accounts) shown on a user's profile.

GET /users/{user_id}/application-identities

func (*API) GetUserBadge

func (a *API) GetUserBadge(ctx context.Context, userID, badgeID string) (json.RawMessage, error)

GetUserBadge returns one badge of a user.

GET /users/{user_id}/badges/{badge_id}

func (*API) GetUserBadges

func (a *API) GetUserBadges(ctx context.Context, userID string) (json.RawMessage, error)

GetUserBadges lists the badges of a user.

GET /users/{user_id}/badges

func (*API) GetUserEntitlements

func (a *API) GetUserEntitlements(ctx context.Context, params *GetUserEntitlementsParams) ([]Entitlement, error)

GetUserEntitlements lists your entitlements.

GET /users/@me/entitlements discord.py-self: get_user_entitlements

func (*API) GetUserJoinRequests

func (a *API) GetUserJoinRequests(ctx context.Context, guildID, userID string) ([]JoinRequest, error)

GetUserJoinRequests lists the join requests one user made in a guild.

GET /guilds/{guild_id}/requests/users/{user_id} discord.py-self: get_user_join_requests

func (*API) GetUserOffer

func (a *API) GetUserOffer(ctx context.Context, params *GetUserOfferParams) (*UserOffer, error)

GetUserOffer returns the discount or trial offer targeted at you.

POST /users/@me/billing/user-offer discord.py-self: get_user_offer

func (*API) GetUserProfile

func (a *API) GetUserProfile(ctx context.Context, userID string, params *GetUserProfileParams) (*UserProfile, error)

GetUserProfile returns a user's profile.

GET /users/{user_id}/profile discord.py-self: get_user_profile

func (*API) GetUserSurvey

func (a *API) GetUserSurvey(ctx context.Context, params *GetUserSurveyParams) (json.RawMessage, error)

GetUserSurvey returns the survey currently targeted at you.

GET /users/@me/survey

func (*API) GetVanityCode

func (a *API) GetVanityCode(ctx context.Context, guildID string) (*VanityInvite, error)

GetVanityCode fetches the vanity invite of a guild.

GET /guilds/{guild_id}/vanity-url discord.py-self: get_vanity_code

func (*API) GetVideoFilterAssets

func (a *API) GetVideoFilterAssets(ctx context.Context) (json.RawMessage, error)

GetVideoFilterAssets lists your custom video backgrounds.

GET /users/@me/video-filters/assets

func (*API) GetVirtualCurrencyBalance

func (a *API) GetVirtualCurrencyBalance(ctx context.Context) (json.RawMessage, error)

GetVirtualCurrencyBalance returns your Orbs balance.

GET /users/@me/virtual-currency/balance

func (*API) GetVirtualCurrencyTotalRedeemed

func (a *API) GetVirtualCurrencyTotalRedeemed(ctx context.Context) (json.RawMessage, error)

GetVirtualCurrencyTotalRedeemed returns the total Orbs you redeemed.

GET /users/@me/virtual-currency/total-redeemed

func (*API) GetWalletInformation

func (a *API) GetWalletInformation(ctx context.Context, sourceID string, getHistory bool) (json.RawMessage, error)

GetWalletInformation returns the balance of a wallet payment source.

GET /users/@me/billing/wallet/{source_id}/information

func (*API) GetWebAuthnCredentials

func (a *API) GetWebAuthnCredentials(ctx context.Context) ([]WebAuthnCredential, error)

GetWebAuthnCredentials lists your security keys.

GET /users/@me/mfa/webauthn/credentials

func (*API) GetWebhook

func (a *API) GetWebhook(ctx context.Context, webhookID string) (*Webhook, error)

GetWebhook fetches a webhook with your account's credentials.

GET /webhooks/{webhook_id} discord.py-self: get_webhook, fetch_webhook

func (*API) GetWebhookMessage

func (a *API) GetWebhookMessage(ctx context.Context, webhookID, token, messageID, threadID string) (*Message, error)

GetWebhookMessage fetches a message previously sent by the webhook. threadID is needed when the message is in a thread ("" otherwise).

GET /webhooks/{webhook_id}/{webhook_token}/messages/{message_id} discord.py-self: get_webhook_message

func (*API) GetWebhookWithToken

func (a *API) GetWebhookWithToken(ctx context.Context, webhookID, token string) (*Webhook, error)

GetWebhookWithToken fetches a webhook using its token (no account credentials sent).

GET /webhooks/{webhook_id}/{webhook_token} discord.py-self: fetch_webhook_with_token

func (*API) GetWelcomeScreen

func (a *API) GetWelcomeScreen(ctx context.Context, guildID string) (*WelcomeScreen, error)

GetWelcomeScreen fetches the welcome screen of a guild.

GET /guilds/{guild_id}/welcome-screen discord.py-self: get_welcome_screen

func (*API) GetWidget

func (a *API) GetWidget(ctx context.Context, guildID string) (*GuildWidget, error)

GetWidget fetches the public widget of a guild.

GET /guilds/{guild_id}/widget.json discord.py-self: get_widget

func (*API) GetWishlist

func (a *API) GetWishlist(ctx context.Context, userID string) (json.RawMessage, error)

GetWishlist returns a user's wishlist.

GET /wishlists/{user_id}

func (*API) GetWishlistGiftRecommendations

func (a *API) GetWishlistGiftRecommendations(ctx context.Context, applicationIDs, userIDs []string, maxRecommendations int, localize bool) (json.RawMessage, error)

GetWishlistGiftRecommendations returns gift recommendations. maxRecommendations <= 0 omits it.

GET /wishlist/gift-recommendations

func (*API) GravityJoinGuild

func (a *API) GravityJoinGuild(ctx context.Context, guildIDs []string, location string) error

GravityJoinGuild joins several recommended guilds at once. location is the UI surface the join came from.

POST /guilds/gravity-join

func (*API) GuildApplicationCommandIndex

func (a *API) GuildApplicationCommandIndex(ctx context.Context, guildID string) (*GuildApplicationCommandIndex, error)

GuildApplicationCommandIndex fetches every application command usable in a guild.

GET /guilds/{guild_id}/application-command-index discord.py-self: guild_application_command_index

func (*API) GuildTemplates

func (a *API) GuildTemplates(ctx context.Context, guildID string) ([]GuildTemplate, error)

GuildTemplates lists the templates of a guild.

GET /guilds/{guild_id}/templates discord.py-self: guild_templates

func (*API) GuildWebhooks

func (a *API) GuildWebhooks(ctx context.Context, guildID string) ([]Webhook, error)

GuildWebhooks lists the webhooks of a guild.

GET /guilds/{guild_id}/webhooks discord.py-self: guild_webhooks

func (*API) HubLookup

func (a *API) HubLookup(ctx context.Context, email string, params *HubLookupParams) (*EmailDomainLookup, error)

HubLookup looks up the hubs that match an email domain and emails a verification code.

POST /guilds/automations/email-domain-lookup discord.py-self: hub_lookup

func (*API) HubWaitlistSignup

func (a *API) HubWaitlistSignup(ctx context.Context, email, school string) (*HubWaitlist, error)

HubWaitlistSignup signs up for the hub waitlist with a school email address.

POST /hub-waitlist/signup discord.py-self: hub_waitlist_signup

func (*API) IgnoreUser

func (a *API) IgnoreUser(ctx context.Context, userID, location string) error

IgnoreUser ignores a user (hides their messages without blocking them). location is the X-Context-Properties location ("" for none).

PUT /users/@me/relationships/{user_id}/ignore

func (*API) Interact

func (a *API) Interact(ctx context.Context, typ InteractionType, data interface{}, channelID string, params *InteractParams) error

Interact sends an interaction. data is the interaction data object (ChatInputCommandInteractionData, ButtonInteractionData, SelectInteractionData, ModalSubmitInteractionData, ... or a map).

POST /interactions discord.py-self: interact

func (*API) InteractAutocomplete

func (a *API) InteractAutocomplete(ctx context.Context, channelID string, cmd ApplicationCommand, options []ApplicationCommandInteractionDataOption, params *InteractParams) error

InteractAutocomplete requests autocomplete choices for the focused option of a command (the options must mark the focused one with Focused: true).

POST /interactions discord.py-self: interact

func (*API) InteractButton

func (a *API) InteractButton(ctx context.Context, channelID, messageID, customID string, params *InteractParams) error

InteractButton clicks a button of a message. params.ApplicationID must be the message's application ID (or author ID); MessageFlags the message's flags.

POST /interactions discord.py-self: interact

func (*API) InteractCommand

func (a *API) InteractCommand(ctx context.Context, channelID string, cmd ApplicationCommand, options []ApplicationCommandInteractionDataOption, attachments []PartialAttachment, params *InteractParams) error

InteractCommand runs a chat input (slash) command. options are the options exactly as the command expects them: for a sub-command, nest them with CommandSubOption (discord.py-self wraps sub-commands the same way). The command's own ApplicationCommand object is embedded as application_command; attachments lists PartialAttachment entries for attachment options (upload the bytes through params.Files).

POST /interactions discord.py-self: interact

func (*API) InteractMessageCommand

func (a *API) InteractMessageCommand(ctx context.Context, channelID string, cmd ApplicationCommand, targetMessageID string, params *InteractParams) error

InteractMessageCommand runs a message context-menu command on a message.

POST /interactions discord.py-self: interact

func (*API) InteractModalSubmit

func (a *API) InteractModalSubmit(ctx context.Context, channelID, modalID, customID string, components []ComponentInteractionData, params *InteractParams) error

InteractModalSubmit submits a modal. modalID is the ID of the interaction that opened the modal; components are the answered action rows.

POST /interactions discord.py-self: interact

func (*API) InteractSelect

func (a *API) InteractSelect(ctx context.Context, channelID, messageID, customID string, componentType ComponentType, values []string, params *InteractParams) error

InteractSelect picks values in a select menu of a message. componentType is ComponentTypeSelect (string select) or the user/role/mentionable/channel select types.

POST /interactions discord.py-self: interact

func (*API) InteractUserCommand

func (a *API) InteractUserCommand(ctx context.Context, channelID string, cmd ApplicationCommand, targetUserID string, params *InteractParams) error

InteractUserCommand runs a user context-menu command on a user.

POST /interactions discord.py-self: interact

func (*API) InviteTeamMember

func (a *API) InviteTeamMember(ctx context.Context, teamID, username, discriminator string) (*TeamMember, error)

InviteTeamMember invites a user to a team by username. discriminator may be empty (sent as null) for users on the new username system.

POST /teams/{team_id}/members discord.py-self: invite_team_member

func (*API) InvitesFrom

func (a *API) InvitesFrom(ctx context.Context, guildID string) ([]InviteWithMetadata, error)

InvitesFrom lists the invites of a guild.

GET /guilds/{guild_id}/invites discord.py-self: invites_from

func (*API) InvitesFromChannel

func (a *API) InvitesFromChannel(ctx context.Context, channelID string) ([]*InviteWithMetadata, error)

InvitesFromChannel lists the invites of a channel.

GET /channels/{channel_id}/invites discord.py-self: invites_from_channel

func (*API) IsValidCollectiblesGiftRecipient

func (a *API) IsValidCollectiblesGiftRecipient(ctx context.Context, recipientID, skuID string) (bool, error)

IsValidCollectiblesGiftRecipient tells whether a user can receive a collectible as a gift.

GET /users/@me/valid-collectibles-gift-recipient

func (*API) JoinAdminServer

func (a *API) JoinAdminServer(ctx context.Context, guildID string) (*GuildWithCounts, error)

JoinAdminServer joins the Discord admin server through a guild.

POST /guilds/{guild_id}/join-admin-server discord.py-self: join_admin_server

func (*API) JoinGameOrganizationInvite

func (a *API) JoinGameOrganizationInvite(ctx context.Context, code, characterID string) (json.RawMessage, error)

JoinGameOrganizationInvite joins a game organization with a character.

POST /game-organization-invites/{code}/join

func (*API) JoinGuild

func (a *API) JoinGuild(ctx context.Context, guildID string, params *JoinGuildParams) (*GuildWithCounts, error)

JoinGuild joins a guild you can already see (a lurked or discoverable guild). Non-lurker joins carry the lurker-mode context source, as the web client does.

PUT /guilds/{guild_id}/members/@me discord.py-self: join_guild

func (*API) JoinHub

func (a *API) JoinHub(ctx context.Context, email, guildID, code string) (*EmailDomainVerification, error)

JoinHub joins a hub with the verification code that was emailed.

POST /guilds/automations/email-domain-lookup/verify-code discord.py-self: join_hub

func (*API) JoinHubToken

func (a *API) JoinHubToken(ctx context.Context, token string) (*EmailDomainVerification, error)

JoinHubToken joins a hub with the token from the verification email link.

POST /guilds/automations/email-domain-lookup/verify discord.py-self: join_hub_token

func (*API) JoinIntegration

func (a *API) JoinIntegration(ctx context.Context, integrationID string) error

JoinIntegration joins the guild a subscription integration belongs to.

POST /integrations/{integration_id}/join discord.py-self: join_integration

func (*API) JoinThread

func (a *API) JoinThread(ctx context.Context, channelID string, params *ThreadLocationParams) error

JoinThread joins a thread.

PUT /channels/{channel_id}/thread-members/@me discord.py-self: join_thread

func (*API) Kick

func (a *API) Kick(ctx context.Context, guildID, userID, reason string) error

Kick removes a member from a guild.

DELETE /guilds/{guild_id}/members/{user_id} discord.py-self: kick

func (*API) LaunchActivity

func (a *API) LaunchActivity(ctx context.Context, channelID, applicationID string, params *LaunchActivityParams) error

LaunchActivity launches (or joins) an embedded activity in a voice channel.

POST /activities/{channel_id}/{application_id}

func (*API) LeaveActivityInstance

func (a *API) LeaveActivityInstance(ctx context.Context, applicationID, activityID, instanceID, sessionID string) error

LeaveActivityInstance leaves an embedded activity instance.

POST /applications/{application_id}/activities/{activity_id}/instances/{instance_id}/leave

func (*API) LeaveGuild

func (a *API) LeaveGuild(ctx context.Context, guildID string, lurking bool) error

LeaveGuild leaves a guild (or stops lurking in it when lurking is true).

DELETE /users/@me/guilds/{guild_id} discord.py-self: leave_guild

func (*API) LeaveHypesquadHouse

func (a *API) LeaveHypesquadHouse(ctx context.Context) error

LeaveHypesquadHouse leaves the current HypeSquad house.

DELETE /hypesquad/online discord.py-self: leave_hypesquad_house

func (*API) LeaveThread

func (a *API) LeaveThread(ctx context.Context, channelID string, params *ThreadLocationParams) error

LeaveThread leaves a thread.

DELETE /channels/{channel_id}/thread-members/@me discord.py-self: leave_thread

func (*API) LinkDispatchAuthCallback

func (a *API) LinkDispatchAuthCallback(ctx context.Context, connType string, body map[string]interface{}) (json.RawMessage, error)

LinkDispatchAuthCallback completes a Link Dispatch (two-way link) OAuth callback; body is the callback payload.

POST /connections/{type}/link-dispatch-auth-callback

func (*API) ListGames

func (a *API) ListGames(ctx context.Context, query url.Values) (json.RawMessage, error)

ListGames lists games (the web client's game catalogue).

GET /games

func (*API) ListPremiumStickerPacks

func (a *API) ListPremiumStickerPacks(ctx context.Context, params *ListPremiumStickerPacksParams) (*ListPremiumStickerPacks, error)

ListPremiumStickerPacks lists the Nitro sticker packs.

GET /sticker-packs discord.py-self: list_premium_sticker_packs

func (*API) Login

func (a *API) Login(ctx context.Context, login, password string, params *LoginParams) (*LoginResponse, error)

Login logs in with an email or phone number and a password. The response either carries the token or an MFA ticket to finish with LoginMFA. Discord may require a captcha (the error body carries the captcha fields); this layer does not solve it.

POST /auth/login

func (*API) LoginMFA

func (a *API) LoginMFA(ctx context.Context, mfaType, code, ticket string, params *LoginMFAParams) (*LoginResponse, error)

LoginMFA finishes a login with a second factor. mfaType is "totp", "sms", "webauthn" or "backup"; ticket comes from Login.

POST /auth/mfa/{mfa_type}

func (*API) Logout

func (a *API) Logout(ctx context.Context, params *LogoutParams) error

Logout invalidates the account token. params may be nil.

POST /auth/logout

func (*API) LogsFrom

func (a *API) LogsFrom(ctx context.Context, channelID string, limit int, params *LogsFromParams) ([]*Message, error)

LogsFrom fetches up to limit (1-100) messages of a channel, newest first.

GET /channels/{channel_id}/messages discord.py-self: logs_from

func (*API) MarkLibraryEntryInstalled

func (a *API) MarkLibraryEntryInstalled(ctx context.Context, applicationID, branchID string) (*LibraryApplication, error)

MarkLibraryEntryInstalled marks a library entry as installed.

POST /users/@me/library/{application_id}/{branch_id}/installed discord.py-self: mark_library_entry_installed

func (*API) MarkMessageRequest

func (a *API) MarkMessageRequest(ctx context.Context, channelID string) (*DMChannel, error)

MarkMessageRequest marks a DM message request as spam-pending (consent_status 1).

PUT /channels/{channel_id}/recipients/@me discord.py-self: mark_message_request

func (*API) MarkUserSurveySeen

func (a *API) MarkUserSurveySeen(ctx context.Context, surveyKey string) error

MarkUserSurveySeen marks a survey as seen.

POST /users/@me/survey/{survey_key}/seen

func (*API) MarkVideoFilterAssetLastUsed

func (a *API) MarkVideoFilterAssetLastUsed(ctx context.Context, assetID string) (json.RawMessage, error)

MarkVideoFilterAssetLastUsed marks a video background as the last used one.

POST /users/@me/video-filters/assets/{asset_id}/last-used

func (*API) MatchVoicePublicKey

func (a *API) MatchVoicePublicKey(ctx context.Context, userID string, publicKey []byte, keyVersion int) (bool, error)

MatchVoicePublicKey asks whether the public key (DAVE / MLS end-to-end encryption signing key) the server holds for userID matches publicKey.

POST /voice/{user_id}/match-public-key

func (*API) MigrateBypassSlowmodePermission

func (a *API) MigrateBypassSlowmodePermission(ctx context.Context, guildID string) error

MigrateBypassSlowmodePermission migrates the guild's roles to the separate bypass slowmode permission.

POST /guilds/{guild_id}/migrate-bypass-slowmode-permission

func (*API) MigrateCommandScope

func (a *API) MigrateCommandScope(ctx context.Context, guildID string) (*CommandScopeMigration, error)

MigrateCommandScope migrates application commands to the new command scope.

POST /guilds/{guild_id}/migrate-command-scope discord.py-self: migrate_command_scope

func (*API) MigratePinPermission

func (a *API) MigratePinPermission(ctx context.Context, guildID string) error

MigratePinPermission migrates the guild's roles to the separate pin messages permission.

POST /guilds/{guild_id}/migrate-pin-permission

func (*API) MobileReport

func (a *API) MobileReport(ctx context.Context, guildID, channelID, messageID, reason string) (*UserReport, error)

MobileReport reports a message (the legacy, v1 mobile report).

POST /report discord.py-self: mobile_report

func (*API) ModifyGuildSticker

func (a *API) ModifyGuildSticker(ctx context.Context, guildID, stickerID string, params *ModifyGuildStickerParams, reason string) (*GuildSticker, error)

ModifyGuildSticker edits a guild sticker.

PATCH /guilds/{guild_id}/stickers/{sticker_id} discord.py-self: modify_guild_sticker

func (*API) MoveRolePosition

func (a *API) MoveRolePosition(ctx context.Context, guildID string, positions []RolePositionUpdate, reason string) ([]Role, error)

MoveRolePosition sets the positions of several roles and returns all roles.

PATCH /guilds/{guild_id}/roles discord.py-self: move_role_position

func (*API) NotifyStream

func (a *API) NotifyStream(ctx context.Context, streamKey string) error

NotifyStream tells the stream's audience (friends / the DM) that you went live.

POST /streams/{stream_key}/notify

func (*API) OneTimeLogin

func (a *API) OneTimeLogin(ctx context.Context, ticket string) (*LoginResponse, error)

OneTimeLogin exchanges a one-time login ticket for a token.

POST /auth/one-time-login

func (*API) PayInvoice

func (a *API) PayInvoice(ctx context.Context, subscriptionID, invoiceID, paymentSourceID string, params *PayInvoiceParams) (*Subscription, error)

PayInvoice pays an open invoice. paymentSourceID may be "" (sent as null).

POST /users/@me/billing/subscriptions/{subscription_id}/invoices/{invoice_id}/pay discord.py-self: pay_invoice

func (*API) PinMessage

func (a *API) PinMessage(ctx context.Context, channelID, messageID, reason string) error

PinMessage pins a message. reason is the audit-log reason ("" for none).

PUT /channels/{channel_id}/messages/pins/{message_id} discord.py-self: pin_message

func (*API) PinsFrom

func (a *API) PinsFrom(ctx context.Context, channelID string, params *PinsFromParams) (*ChannelPins, error)

PinsFrom lists the pinned messages of a channel, newest pin first, with their pin timestamps (the paginated pins endpoint).

GET /channels/{channel_id}/messages/pins discord.py-self: pins_from

func (*API) Pomelo

func (a *API) Pomelo(ctx context.Context, username string) (*User, error)

Pomelo migrates the account to a unique username (pomelo).

POST /users/@me/pomelo discord.py-self: pomelo

func (*API) PomeloAttempt

func (a *API) PomeloAttempt(ctx context.Context, username string) (*PomeloAttempt, error)

PomeloAttempt checks whether a unique username is taken.

POST /users/@me/pomelo-attempt discord.py-self: pomelo_attempt

func (*API) PomeloAttemptUnauthed

func (a *API) PomeloAttemptUnauthed(ctx context.Context, username string) (*PomeloAttempt, error)

PomeloAttemptUnauthed checks whether a unique username is taken without an account.

POST /unique-username/username-attempt-unauthed discord.py-self: pomelo_attempt_unauthed

func (*API) PomeloSuggestion

func (a *API) PomeloSuggestion(ctx context.Context) (*PomeloSuggestion, error)

PomeloSuggestion returns a suggested unique username.

GET /users/@me/pomelo-suggestions discord.py-self: pomelo_suggestion

func (*API) PomeloSuggestionUnauthed

func (a *API) PomeloSuggestionUnauthed(ctx context.Context, globalName string) (*PomeloSuggestion, error)

PomeloSuggestionUnauthed returns a suggested unique username without an account. globalName is optional ("" to omit).

GET /unique-username/username-suggestions-unauthed discord.py-self: pomelo_suggestion_unauthed

func (*API) PreviewSKUPurchase

func (a *API) PreviewSKUPurchase(ctx context.Context, skuID string, params *PreviewSKUPurchaseParams) (*SKUPrice, error)

PreviewSKUPurchase returns the price of purchasing a SKU without buying it.

GET /store/skus/{sku_id}/purchase discord.py-self: preview_sku_purchase

func (*API) PreviewSubscriptionUpdate

func (a *API) PreviewSubscriptionUpdate(ctx context.Context, subscriptionID string, params *PreviewSubscriptionUpdateParams) (*SubscriptionInvoice, error)

PreviewSubscriptionUpdate previews the invoice of a change to a subscription.

PATCH /users/@me/billing/subscriptions/{subscription_id}/preview discord.py-self: preview_subscription_update

func (*API) PreviewSubscriptionsUpdate

func (a *API) PreviewSubscriptionsUpdate(ctx context.Context, items []SubscriptionItemParams, currency string, params *PreviewSubscriptionsUpdateParams) (*SubscriptionInvoice, error)

PreviewSubscriptionsUpdate previews the invoice of a new subscription.

POST /users/@me/billing/subscriptions/preview discord.py-self: preview_subscriptions_update

func (*API) PromoteBuild

func (a *API) PromoteBuild(ctx context.Context, applicationID, branchID, targetBranchID string) error

PromoteBuild promotes the live build of a branch to another branch.

PUT /applications/{application_id}/branches/{branch_id}/promote/{target_branch_id} discord.py-self: promote_build

func (*API) Properties

func (a *API) Properties() *ClientProperties

Properties returns the client properties this API presents (build number, user agent, client type). They are final once the client's Initialize has returned.

func (*API) PruneMembers

func (a *API) PruneMembers(ctx context.Context, guildID string, days int, params *PruneMembersParams, reason string) (*GuildPrune, error)

PruneMembers removes members that were inactive for the given number of days.

POST /guilds/{guild_id}/prune discord.py-self: prune_members

func (*API) PublishBuild

func (a *API) PublishBuild(ctx context.Context, applicationID, branchID, buildID string) error

PublishBuild publishes a build to its branch.

POST /applications/{application_id}/branches/{branch_id}/builds/{build_id}/publish discord.py-self: publish_build

func (*API) PublishMessage

func (a *API) PublishMessage(ctx context.Context, channelID, messageID string) (*Message, error)

PublishMessage crossposts a message from an announcement channel to its followers.

POST /channels/{channel_id}/messages/{message_id}/crosspost discord.py-self: publish_message

func (*API) PurchaseSKU

func (a *API) PurchaseSKU(ctx context.Context, skuID string, params *PurchaseSKUParams) (*SKUPurchase, error)

PurchaseSKU buys a SKU. This spends real money when a payment source is given; use PreviewSKUPurchase first and set ExpectedAmount/ExpectedCurrency.

POST /store/skus/{sku_id}/purchase discord.py-self: purchase_sku

func (*API) PutSavedMessage

func (a *API) PutSavedMessage(ctx context.Context, channelID, messageID string, params *PutSavedMessageParams) (json.RawMessage, error)

PutSavedMessage bookmarks a message or sets a reminder on it.

PUT /users/@me/saved-messages/{channel_id}/{message_id}

func (*API) PutUserWidgets

func (a *API) PutUserWidgets(ctx context.Context, widgets []json.RawMessage) (json.RawMessage, error)

PutUserWidgets replaces your profile widgets.

PUT /users/@me/widgets

func (*API) QuestHeartbeat

func (a *API) QuestHeartbeat(ctx context.Context, questID, streamKey, applicationID string, params *QuestHeartbeatParams) (json.RawMessage, error)

QuestHeartbeat reports play progress for a game quest. streamKey identifies the running session (for example "call:<channel>:<user>"); applicationID is the quest's application.

POST /quests/{quest_id}/heartbeat

func (*API) QuestVideoProgress

func (a *API) QuestVideoProgress(ctx context.Context, questID string, timestampSeconds float64) (json.RawMessage, error)

QuestVideoProgress reports watch progress (seconds into the video) for a video quest.

POST /quests/{quest_id}/video-progress

func (*API) RedeemGift

func (a *API) RedeemGift(ctx context.Context, code string, params *RedeemGiftParams) (*Entitlement, error)

RedeemGift redeems a gift code.

POST /entitlements/gift-codes/{code}/redeem discord.py-self: redeem_gift

func (*API) RedeemReactivationOffer

func (a *API) RedeemReactivationOffer(ctx context.Context, subscriptionID, offerID string) (*Subscription, error)

RedeemReactivationOffer redeems a reactivation offer on a subscription.

POST /users/@me/billing/subscriptions/{subscription_id}/reactivation-offers/{offer_id}/redeem

func (*API) RedeemUserOffer

func (a *API) RedeemUserOffer(ctx context.Context, discountOfferID string) ([]DiscountOffer, error)

RedeemUserOffer redeems a discount offer.

POST /users/@me/billing/user-offer/redeem discord.py-self: redeem_user_offer

func (*API) RedeemVirtualCurrencySKU

func (a *API) RedeemVirtualCurrencySKU(ctx context.Context, skuID string, body map[string]interface{}) (json.RawMessage, error)

RedeemVirtualCurrencySKU redeems a virtual currency SKU; body is the redemption payload.

POST /virtual-currency/skus/{sku_id}/redeem

func (*API) RefreshAttachmentURLs

func (a *API) RefreshAttachmentURLs(ctx context.Context, attachmentURLs []string) (*RefreshedAttachmentURLs, error)

RefreshAttachmentURLs renews expired signed CDN attachment URLs.

POST /attachments/refresh-urls

func (*API) RefreshConnection

func (a *API) RefreshConnection(ctx context.Context, connType, id string) error

RefreshConnection refreshes the metadata of a connected account.

POST /users/@me/connections/{type}/{id}/refresh discord.py-self: refresh_connection

func (*API) RefundPayment

func (a *API) RefundPayment(ctx context.Context, paymentID string, reason *int) (*Payment, error)

RefundPayment refunds a payment. reason is optional (nil sends null).

POST /users/@me/billing/payments/{payment_id}/refund discord.py-self: refund_payment

func (*API) RegisterIncodeInterview

func (a *API) RegisterIncodeInterview(ctx context.Context, interviewID string) error

RegisterIncodeInterview registers a finished Incode interview.

POST /age-verification/incode/interview

func (*API) RemoteAuthCancel

func (a *API) RemoteAuthCancel(ctx context.Context, handshakeToken string) error

RemoteAuthCancel rejects a scanned QR code login.

POST /users/@me/remote-auth/cancel

func (*API) RemoteAuthFinish

func (a *API) RemoteAuthFinish(ctx context.Context, handshakeToken string, temporaryToken bool) error

RemoteAuthFinish approves a scanned QR code login for the handshake token.

POST /users/@me/remote-auth/finish

func (*API) RemoteAuthInitialize

func (a *API) RemoteAuthInitialize(ctx context.Context, fingerprint string) (string, error)

RemoteAuthInitialize registers the fingerprint of a remote auth gateway handshake (the base64 SHA-256 of the public key) and returns the handshake token.

POST /users/@me/remote-auth

func (*API) RemoteAuthLogin

func (a *API) RemoteAuthLogin(ctx context.Context, ticket string) (encryptedToken string, err error)

RemoteAuthLogin exchanges the ticket received on the remote auth gateway for the encrypted token (decrypt it with the handshake private key).

POST /users/@me/remote-auth/login

func (*API) RemoveGroupRecipient

func (a *API) RemoveGroupRecipient(ctx context.Context, channelID, userID string) error

RemoveGroupRecipient removes a user from a group DM (or leaves it, with your own ID).

DELETE /channels/{channel_id}/recipients/{user_id} discord.py-self: remove_group_recipient

func (*API) RemoveLinkedLobby

func (a *API) RemoveLinkedLobby(ctx context.Context, channelID string) error

RemoveLinkedLobby unlinks the lobby linked to a channel.

DELETE /channels/{channel_id}/linked-lobby

func (*API) RemoveOwnReaction

func (a *API) RemoveOwnReaction(ctx context.Context, channelID, messageID string, emoji interface{}, typ ReactionType) error

RemoveOwnReaction removes your own reaction from a message.

DELETE /channels/{channel_id}/messages/{message_id}/reactions/{emoji}/{reaction_type}/@me discord.py-self: remove_own_reaction

func (*API) RemovePhone

func (a *API) RemovePhone(ctx context.Context, password, changePhoneReason string) error

RemovePhone removes the phone number from the account.

DELETE /users/@me/phone

func (*API) RemoveReaction

func (a *API) RemoveReaction(ctx context.Context, channelID, messageID string, emoji interface{}, memberID string, typ ReactionType) error

RemoveReaction removes another member's reaction from a message (needs Manage Messages).

DELETE /channels/{channel_id}/messages/{message_id}/reactions/{emoji}/{reaction_type}/{member_id} discord.py-self: remove_reaction

func (*API) RemoveRelationship

func (a *API) RemoveRelationship(ctx context.Context, userID string, action RelationshipAction, params *RelationshipParams) error

RemoveRelationship unfriends, unblocks, denies or cancels a request. action only selects the context properties sent with the request.

DELETE /users/@me/relationships/{user_id} discord.py-self: remove_relationship

func (*API) RemoveRole

func (a *API) RemoveRole(ctx context.Context, guildID, userID, roleID, reason string) error

RemoveRole takes a role from a member.

DELETE /guilds/{guild_id}/members/{user_id}/roles/{role_id} discord.py-self: remove_role

func (*API) RemoveTeamMember

func (a *API) RemoveTeamMember(ctx context.Context, teamID, userID string) error

RemoveTeamMember removes a member from a team.

DELETE /teams/{team_id}/members/{user_id} discord.py-self: remove_team_member

func (*API) RemoveUserFromThread

func (a *API) RemoveUserFromThread(ctx context.Context, channelID, userID string) error

RemoveUserFromThread removes a user from a thread (?location=Context Menu).

DELETE /channels/{channel_id}/thread-members/{user_id} discord.py-self: remove_user_from_thread

func (*API) RemoveWishlistItem

func (a *API) RemoveWishlistItem(ctx context.Context, wishlistID, skuID string) (json.RawMessage, error)

RemoveWishlistItem removes a SKU from a wishlist.

DELETE /users/@me/wishlists/{wishlist_id}/items/{sku_id}

func (*API) RenameGameServer

func (a *API) RenameGameServer(ctx context.Context, gameServerID, name string) error

RenameGameServer renames one of your game servers.

PATCH /users/@me/game-servers/{game_server_id}

func (*API) RenameWebAuthnCredential

func (a *API) RenameWebAuthnCredential(ctx context.Context, credentialID, name string) (*WebAuthnCredential, error)

RenameWebAuthnCredential renames a security key.

PATCH /users/@me/mfa/webauthn/credentials/{credential_id}

func (*API) ReportActivity

func (a *API) ReportActivity(ctx context.Context, params *ReportActivityParams) (string, error)

ReportActivity reports play time for a game and returns the token to use for the next report.

POST /activities

func (*API) ReportExplicitMediaFalsePositive

func (a *API) ReportExplicitMediaFalsePositive(ctx context.Context, channelID, messageID string, attachmentIDs, embedIDs []string) error

ReportExplicitMediaFalsePositive reports that an attachment or embed of a message was wrongly flagged as explicit.

POST /attachments/report-false-positive

func (*API) ReportExplicitMediaSenderFalsePositive

func (a *API) ReportExplicitMediaSenderFalsePositive(ctx context.Context, channelID, messageID string, attachmentIDs, filenames []string) error

ReportExplicitMediaSenderFalsePositive is the sender-side false-positive report for files that were blocked before sending.

POST /attachments/sender-report-false-positive

func (*API) ReportMeaningfullyOnline

func (a *API) ReportMeaningfullyOnline(ctx context.Context) error

ReportMeaningfullyOnline reports that you were "meaningfully online" (friend online timer).

POST /users/@me/meaningfully-online

func (*API) ReportSafetyWarningFalsePositive

func (a *API) ReportSafetyWarningFalsePositive(ctx context.Context, channelID string) error

ReportSafetyWarningFalsePositive reports a channel safety warning as wrong.

POST /channels/{channel_id}/safety-warning/report-false-positive

func (*API) ReportUnverifiedApplication

func (a *API) ReportUnverifiedApplication(ctx context.Context, name, iconHash, osName string, params *ReportUnverifiedApplicationParams) (*UnverifiedApplication, error)

ReportUnverifiedApplication reports a running unverified application (report_version 3).

POST /unverified-applications discord.py-self: report_unverified_application

func (*API) Request

func (a *API) Request(ctx context.Context, method, path string, opts *RequestOptions) (*Response, error)

Request performs one call. path is relative to the API root and starts with "/" (e.g. "/users/@me"); it must not contain the "/api/v9" prefix. It returns *APIError (use errors.As) when the final status is >= 400.

func (*API) RequestAgeVerificationManualReview

func (a *API) RequestAgeVerificationManualReview(ctx context.Context) (json.RawMessage, error)

RequestAgeVerificationManualReview asks for a manual review of your age group.

POST /age-verification/manual-review

func (*API) RequestAppIntents

func (a *API) RequestAppIntents(ctx context.Context, applicationID string, payload map[string]interface{}) error

RequestAppIntents requests additional gateway intents for an application.

POST /applications/{application_id}/request-additional-intents discord.py-self: request_app_intents

func (*API) RequestDataHarvest

func (a *API) RequestDataHarvest(ctx context.Context, backends []string) (json.RawMessage, error)

RequestDataHarvest requests a copy of your data ("Request all of my data"). backends selects the data categories (for example "messages", "activities", "account", "programs", "servers").

POST /users/@me/harvest

func (*API) RequestSuspendedAgeVerification

func (a *API) RequestSuspendedAgeVerification(ctx context.Context, token, classificationID, method string) (json.RawMessage, error)

RequestSuspendedAgeVerification starts the age verification a suspended account must pass. token is the verification token, classificationID the safety hub classification and method the verification method.

POST /safety-hub/suspended/request-verification

func (*API) RequestSuspendedAgeVerificationManualReview

func (a *API) RequestSuspendedAgeVerificationManualReview(ctx context.Context, token string) (json.RawMessage, error)

RequestSuspendedAgeVerificationManualReview is RequestAgeVerificationManualReview for suspended users.

POST /age-verification/suspended/manual-review

func (*API) RequestSuspendedAgeVerificationV2

func (a *API) RequestSuspendedAgeVerificationV2(ctx context.Context, token, method, vendor string) (json.RawMessage, error)

RequestSuspendedAgeVerificationV2 is the v2 of RequestSuspendedAgeVerification.

POST /safety-hub/suspended/request-verification/v2

func (*API) ResendPhoneVerification

func (a *API) ResendPhoneVerification(ctx context.Context, phone, fingerprint string) error

ResendPhoneVerification re-sends the verification SMS. fingerprint, when not empty, is sent as X-Fingerprint like the web client's logged-out flow.

POST /phone-verifications/resend

func (*API) ResendStorePaymentVerification

func (a *API) ResendStorePaymentVerification(ctx context.Context, body map[string]interface{}) (json.RawMessage, error)

ResendStorePaymentVerification re-sends the payment verification email; body is the web client's payload.

POST /store/email/resend-payment-verification

func (*API) ResendVerificationEmail

func (a *API) ResendVerificationEmail(ctx context.Context) error

ResendVerificationEmail asks Discord to send the verification email again.

POST /auth/verify/resend

func (*API) ResetAgeVerification

func (a *API) ResetAgeVerification(ctx context.Context) error

ResetAgeVerification resets the age verification state of the account.

POST /users/@me/age-verification/reset

func (*API) ResetBotToken

func (a *API) ResetBotToken(ctx context.Context, applicationID string) (*ApplicationToken, error)

ResetBotToken resets the bot token of an application. The new token is only returned once.

POST /applications/{application_id}/bot/reset discord.py-self: reset_bot_token

func (*API) ResetCheckpoint

func (a *API) ResetCheckpoint(ctx context.Context) error

ResetCheckpoint resets the checkpoint state.

DELETE /checkpoint/reset

func (*API) ResetJoinRequest

func (a *API) ResetJoinRequest(ctx context.Context, guildID string) (*JoinRequest, error)

ResetJoinRequest resets your join request so you can edit and resubmit it.

POST /guilds/{guild_id}/requests/@me discord.py-self: reset_join_request

func (*API) ResetMessageRequest

func (a *API) ResetMessageRequest(ctx context.Context, channelID string) (*DMChannel, error)

ResetMessageRequest resets a DM message request to pending (consent_status 0).

PUT /channels/{channel_id}/recipients/@me discord.py-self: reset_message_request

func (*API) ResetPassword

func (a *API) ResetPassword(ctx context.Context, token, password, source string) (*LoginResponse, error)

ResetPassword sets a new password with the emailed reset token. source may be empty. When the account has MFA the response carries a ticket for LoginMFA.

POST /auth/reset

func (*API) ResetRecentQuestCompletions

func (a *API) ResetRecentQuestCompletions(ctx context.Context) error

ResetRecentQuestCompletions clears your recent quest completions (test helper of the client).

DELETE /quests/reset-recent-quest-completions

func (*API) ResetSecret

func (a *API) ResetSecret(ctx context.Context, applicationID string) (*ApplicationSecret, error)

ResetSecret resets the client secret of an application.

POST /applications/{application_id}/reset discord.py-self: reset_secret

func (*API) ReverifyPhone

func (a *API) ReverifyPhone(ctx context.Context, phoneToken, password, changePhoneReason string) (json.RawMessage, error)

ReverifyPhone completes the re-verification of a phone number.

POST /users/@me/phone/reverify

func (*API) RevokeOAuth2Token

func (a *API) RevokeOAuth2Token(ctx context.Context, tokenID string) error

RevokeOAuth2Token revokes an authorization (an OAuth2Token ID).

DELETE /oauth2/tokens/{token_id} discord.py-self: revoke_oauth2_token

func (*API) Ring

func (a *API) Ring(ctx context.Context, channelID string, recipients ...string) error

Ring rings the given recipients of a call; with no recipients everyone is rung (the body is {"recipients": null}, as discord.py-self sends).

POST /channels/{channel_id}/call/ring discord.py-self: ring

func (*API) ScanExplicitMedia

func (a *API) ScanExplicitMedia(ctx context.Context, channelID string, messageIDs []string) (json.RawMessage, error)

ScanExplicitMedia asks Discord's explicit-media scanner about messages of one channel (the client uses it to decide what to blur). The result is returned raw because its shape is not modelled.

PATCH /channels/{channel_id}/explicit-media

func (*API) ScanExplicitMediaMultiChannel

func (a *API) ScanExplicitMediaMultiChannel(ctx context.Context, messages []ExplicitMediaMessage) (json.RawMessage, error)

ScanExplicitMediaMultiChannel is ScanExplicitMedia across several channels.

PATCH /messages/explicit-media

func (*API) SearchAppDirectory

func (a *API) SearchAppDirectory(ctx context.Context, query url.Values) (json.RawMessage, error)

SearchAppDirectory searches the application directory. query holds the web client's parameters (query, guild_id, page, page_size, category_id, locale, integration_type, ...).

GET /application-directory-static/search

func (*API) SearchApplicationCommands

func (a *API) SearchApplicationCommands(ctx context.Context, channelID string, commandType ApplicationCommandType, params *SearchApplicationCommandsParams) (*ApplicationCommandSearch, error)

SearchApplicationCommands searches the commands usable in a channel, as the client does while typing "/". commandType is 1 (chat input), 2 (user) or 3 (message).

GET /channels/{channel_id}/application-commands/search

The route is not in discord.py-self and its call site is not in the bundled web client; the parameter set is the one the official client documents for the command picker.

func (*API) SearchChannel

func (a *API) SearchChannel(ctx context.Context, channelID string, params *ChannelSearchParams) (*MessageSearchResult, error)

SearchChannel searches the messages of a DM or group DM channel. While Discord is still indexing, the REST layer retries the 202 answer.

GET /channels/{channel_id}/messages/search discord.py-self: search_channel

func (*API) SearchCompanies

func (a *API) SearchCompanies(ctx context.Context, name string) ([]ApplicationCompany, error)

SearchCompanies searches companies by name. Discord answers 204 without a query, which yields an empty slice.

GET /companies discord.py-self: search_companies

func (*API) SearchDirectoryEntries

func (a *API) SearchDirectoryEntries(ctx context.Context, channelID, query string, params *DirectoryEntriesParams) ([]*DirectoryEntry, error)

SearchDirectoryEntries searches the entries of a directory channel.

GET /channels/{channel_id}/directory-entries/search discord.py-self: search_directory_entries

func (*API) SearchGifs

func (a *API) SearchGifs(ctx context.Context, query string, params *GifQueryParams) (json.RawMessage, error)

SearchGifs searches the GIF picker.

GET /gifs/search

func (*API) SearchGuild

func (a *API) SearchGuild(ctx context.Context, guildID string, params *ChannelSearchParams) (*MessageSearchResult, error)

SearchGuild searches the messages of a guild. While Discord is still indexing, the REST layer retries the 202 answer.

GET /guilds/{guild_id}/messages/search discord.py-self: search_guild

func (*API) SearchGuildBans

func (a *API) SearchGuildBans(ctx context.Context, guildID string, params *SearchGuildBansParams) ([]GuildBan, error)

SearchGuildBans searches the bans of a guild by username or user ID.

GET /guilds/{guild_id}/bans/search

func (*API) SearchGuildMembers

func (a *API) SearchGuildMembers(ctx context.Context, guildID string, query *GuildMemberSearchQuery) (*GuildMemberSearchResult, error)

SearchGuildMembers searches the members of a guild (member safety page). While Discord is still indexing, the REST layer retries the 202 answer.

POST /guilds/{guild_id}/members-search

func (*API) SearchThreads

func (a *API) SearchThreads(ctx context.Context, channelID string, params *ThreadSearchParams) (*ThreadSearchResult, error)

SearchThreads searches or lists the threads (forum posts) of a channel, as the web client's forum browser does.

GET /channels/{channel_id}/threads/search

func (*API) SearchUser

func (a *API) SearchUser(ctx context.Context, query url.Values) (*MessageSearchResult, error)

SearchUser searches your messages across DMs. query holds the search parameters (content, author_id, channel_id, has, limit, offset, ...), sent as the query string.

GET /users/@me/messages/search discord.py-self: search_user

func (*API) SelectGif

func (a *API) SelectGif(ctx context.Context, gifID, query string) error

SelectGif reports the GIF you picked for a search query (improves ranking).

POST /gifs/select

func (*API) SendAnnouncement

func (a *API) SendAnnouncement(ctx context.Context, channelID string, params *SendMessageParams) (*Message, error)

SendAnnouncement sends a message to an announcement (news) channel, the way the web client does. The body is the same as SendMessage's.

POST /channels/{channel_id}/messages/announcement

func (*API) SendClipsRemoteTrigger

func (a *API) SendClipsRemoteTrigger(ctx context.Context, channelID, applicationID string) (*ClipsRemoteTriggerResponse, error)

SendClipsRemoteTrigger asks the other call participants' clients to save a clip of the current activity.

POST /channels/{channel_id}/clips-remote-trigger

func (*API) SendFriendRequest

func (a *API) SendFriendRequest(ctx context.Context, username string, discriminator int) error

SendFriendRequest sends a friend request by username. discriminator is the legacy 4-digit tag, or 0 for pomelo usernames (sent as null).

POST /users/@me/relationships discord.py-self: send_friend_request

func (*API) SendGreet

func (a *API) SendGreet(ctx context.Context, channelID, stickerID string, params *SendGreetParams) (*Message, error)

SendGreet sends a "wave" greeting with a sticker to an empty DM (X-Context-Properties {"location":"greet"}).

POST /channels/{channel_id}/greet discord.py-self: send_greet

func (*API) SendGuildPincode

func (a *API) SendGuildPincode(ctx context.Context, guildID string) error

SendGuildPincode emails the code needed to transfer ownership of a guild.

PUT /guilds/{guild_id}/pincode

func (*API) SendMessage

func (a *API) SendMessage(ctx context.Context, channelID string, params *SendMessageParams) (*Message, error)

SendMessage sends a message to a channel or DM. With Files it is sent as multipart/form-data; the request carries X-Context-Properties {"location":"chat_input"}.

POST /channels/{channel_id}/messages discord.py-self: send_message

func (*API) SendMessageCloudUpload

func (a *API) SendMessageCloudUpload(ctx context.Context, channelID string, files []File, params *SendMessageParams) (*Message, error)

SendMessageCloudUpload sends a message with files uploaded through the upload-URL flow: it requests upload URLs for the files (POST /channels/{id}/attachments), PUTs each file to its URL, then sends the message referencing the uploaded files. params.Files is ignored; the files argument is used instead. params may be nil.

POST /channels/{channel_id}/attachments, PUT <upload_url>, POST /channels/{channel_id}/messages discord.py-self: get_attachment_urls, upload_to_cloud, send_message

func (*API) SendMetricsV2

func (a *API) SendMetricsV2(ctx context.Context, metrics []map[string]interface{}, clientInfo map[string]interface{}) error

SendMetricsV2 posts client metrics.

POST /metrics/v2

func (*API) SendScheduledMessageNow

func (a *API) SendScheduledMessageNow(ctx context.Context, scheduledMessageID string) error

SendScheduledMessageNow sends a scheduled message immediately.

POST /users/@me/scheduled-messages/{scheduled_message_id}/send

func (*API) SendScience

func (a *API) SendScience(ctx context.Context, body map[string]interface{}) error

SendScience posts an analytics batch ({"events": [...], "token": ...}) as the web client does. The caller builds the body; the API does not sign events.

POST /science

func (*API) SendSoundboardEcho

func (a *API) SendSoundboardEcho(ctx context.Context, channelID, soundID, sourceGuildID string) error

SendSoundboardEcho previews a soundboard sound locally for the call ("echo"); the body carries sound_id and source_guild_id.

POST /channels/{channel_id}/send-soundboard-echo

func (*API) SendSoundboardSound

func (a *API) SendSoundboardSound(ctx context.Context, channelID, soundID, sourceGuildID, emojiID, emojiName string) error

SendSoundboardSound plays a soundboard sound in a voice channel. sourceGuildID is the guild the sound belongs to ("" or "0" for default sounds, which are sent without source_guild_id); emojiID and emojiName are optional.

POST /channels/{channel_id}/send-soundboard-sound

func (*API) SendTyping

func (a *API) SendTyping(ctx context.Context, channelID string) (*TypingResponse, error)

SendTyping triggers the typing indicator in a channel. The result carries the cooldowns the server returns; it is the zero value when the response is empty.

POST /channels/{channel_id}/typing discord.py-self: send_typing

func (*API) SetAppDisclosures

func (a *API) SetAppDisclosures(ctx context.Context, applicationID string, disclosures []string) error

SetAppDisclosures sets the disclosures of an application.

POST /applications/{application_id}/disclosures

func (*API) SetGuildIdentity

func (a *API) SetGuildIdentity(ctx context.Context, params *SetGuildIdentityParams) (*User, error)

SetGuildIdentity sets the guild tag ("clan") shown on the profile.

PUT /users/@me/clan discord.py-self: set_guild_identity

func (*API) SetNote

func (a *API) SetNote(ctx context.Context, userID, note string) error

SetNote sets the note on a user; "" clears it.

PUT /users/@me/notes/{user_id} discord.py-self: set_note

func (*API) SetWishlistVisibility

func (a *API) SetWishlistVisibility(ctx context.Context, wishlistID string, visibility int) (json.RawMessage, error)

SetWishlistVisibility changes who can see a wishlist.

PATCH /users/@me/wishlists/{wishlist_id}

func (*API) ShareFamilyCenterIARWithParents

func (a *API) ShareFamilyCenterIARWithParents(ctx context.Context) error

ShareFamilyCenterIARWithParents shares the in-app-reporting summary with linked parents.

POST /family-center/share-iar-with-parents

func (*API) ShareSpotifyTracks

func (a *API) ShareSpotifyTracks(ctx context.Context, connectionID string, tracks []map[string]interface{}) error

ShareSpotifyTracks adds Spotify tracks of a connection to your content inventory.

POST /content-inventory/users/@me/spotify

func (*API) SignAdsIOSAttributionPayload

func (a *API) SignAdsIOSAttributionPayload(ctx context.Context, metadataSealed, impressionID string, specs []map[string]interface{}) (json.RawMessage, error)

SignAdsIOSAttributionPayload signs an iOS ad attribution payload.

POST /ads/ios-attributions/sign-payload

func (*API) SignOrder

func (a *API) SignOrder(ctx context.Context, orderID string, params *SignOrderParams) (json.RawMessage, error)

SignOrder confirms an order. This charges the payment source.

POST /billing/orders/{order_id}/sign

func (*API) StartGroup

func (a *API) StartGroup(ctx context.Context, recipientIDs []string) (*Channel, error)

StartGroup creates a group DM with the given users.

POST /users/@me/channels discord.py-self: start_group

func (*API) StartPrivateMessage

func (a *API) StartPrivateMessage(ctx context.Context, userID string) (*Channel, error)

StartPrivateMessage opens (or returns) the DM channel with a user.

POST /users/@me/channels discord.py-self: start_private_message

func (*API) StartQuestOnConsole

func (a *API) StartQuestOnConsole(ctx context.Context, questID string, preview bool) (json.RawMessage, error)

StartQuestOnConsole starts console progress tracking; preview adds ?preview=true.

POST /quests/{quest_id}/console/start

func (*API) StartThreadInForum

func (a *API) StartThreadInForum(ctx context.Context, channelID, name string, message *SendMessageParams, params *StartForumThreadParams, reason string) (*ForumThread, error)

StartThreadInForum creates a post in a forum or media channel together with its first message. The first message is described by message (same options as SendMessage; files are uploaded as multipart), and is nested under "message" in the body; the request carries ?use_nested_fields=true. The returned ForumThread has the created first message in .Message.

POST /channels/{channel_id}/threads?use_nested_fields=true discord.py-self: start_thread_in_forum

func (*API) StartThreadWithMessage

func (a *API) StartThreadWithMessage(ctx context.Context, channelID, messageID, name string, autoArchiveDuration ThreadArchiveDuration, params *StartThreadParams, reason string) (*Thread, error)

StartThreadWithMessage creates a public thread from a message.

POST /channels/{channel_id}/messages/{message_id}/threads discord.py-self: start_thread_with_message

func (*API) StartThreadWithoutMessage

func (a *API) StartThreadWithoutMessage(ctx context.Context, channelID, name string, autoArchiveDuration ThreadArchiveDuration, typ ThreadType, params *StartThreadWithoutMessageParams, reason string) (*Thread, error)

StartThreadWithoutMessage creates a thread that is not attached to a message. typ is ThreadTypePublicThread or ThreadTypePrivateThread.

POST /channels/{channel_id}/threads discord.py-self: start_thread_without_message

func (*API) StartWebAuthnConditionalLogin

func (a *API) StartWebAuthnConditionalLogin(ctx context.Context) (*WebAuthnChallenge, error)

StartWebAuthnConditionalLogin starts a conditional UI (autofill) passkey login.

POST /auth/conditional/start

func (*API) StartWebAuthnPasswordlessLogin

func (a *API) StartWebAuthnPasswordlessLogin(ctx context.Context) (*WebAuthnChallenge, error)

StartWebAuthnPasswordlessLogin starts a passwordless passkey login.

POST /auth/passwordless/start

func (*API) StartWebAuthnRegistration

func (a *API) StartWebAuthnRegistration(ctx context.Context) (*WebAuthnRegistrationChallenge, error)

StartWebAuthnRegistration begins registering a security key and returns the ticket and challenge.

POST /users/@me/mfa/webauthn/credentials

func (*API) StopQuestOnConsole

func (a *API) StopQuestOnConsole(ctx context.Context, questID string) error

StopQuestOnConsole stops console progress tracking.

POST /quests/{quest_id}/console/stop

func (*API) StopRinging

func (a *API) StopRinging(ctx context.Context, channelID string, recipients ...string) error

StopRinging stops ringing the given recipients; with none the body is {}.

POST /channels/{channel_id}/call/stop-ringing discord.py-self: stop_ringing

func (*API) SubmitEmbeddedSurveyResponse

func (a *API) SubmitEmbeddedSurveyResponse(ctx context.Context, surveyID string, values interface{}) (json.RawMessage, error)

SubmitEmbeddedSurveyResponse submits the answers of an embedded survey; values is JSON-encoded into the "values_json" string the API expects.

POST /users/@me/embedded-surveys/{survey_id}/responses

func (*API) SubmitSafetyFlowsTask

func (a *API) SubmitSafetyFlowsTask(ctx context.Context, body interface{}) (json.RawMessage, error)

SubmitSafetyFlowsTask answers the pending account safety task. body is the task answer as the web client builds it (task_id and the step's data).

POST /safety-flows/task

func (*API) SubscribeUserActivities

func (a *API) SubscribeUserActivities(ctx context.Context, subscriptions []ActivitySubscription) (json.RawMessage, error)

SubscribeUserActivities subscribes to activity updates of other users.

POST /users/@me/activities/subscribe

func (*API) SuggestGifs

func (a *API) SuggestGifs(ctx context.Context, query string, params *GifQueryParams) (json.RawMessage, error)

SuggestGifs returns search suggestions for a partial GIF query.

GET /gifs/suggest

func (*API) SummarizeThread

func (a *API) SummarizeThread(ctx context.Context, channelID string, ephemeral bool) error

SummarizeThread asks Discord's AI to summarise a thread. ephemeral controls whether the summary is only shown to you.

POST /ai/summarize-thread/{channel_id}

func (*API) SuppressTutorial

func (a *API) SuppressTutorial(ctx context.Context) error

SuppressTutorial hides all tutorial indicators.

POST /tutorial/indicators/suppress discord.py-self: suppress_tutorial

func (*API) SyncIntegration

func (a *API) SyncIntegration(ctx context.Context, guildID, integrationID string) error

SyncIntegration syncs a stream integration.

POST /guilds/{guild_id}/integrations/{integration_id}/sync discord.py-self: sync_integration

func (*API) SyncTemplate

func (a *API) SyncTemplate(ctx context.Context, guildID, code string) (*GuildTemplate, error)

SyncTemplate syncs a template with the current state of its guild.

PUT /guilds/{guild_id}/templates/{code} discord.py-self: sync_template

func (*API) TakeAutoModerationAlertAction

func (a *API) TakeAutoModerationAlertAction(ctx context.Context, guildID, messageID, channelID string, actionType int) error

TakeAutoModerationAlertAction acts on an auto moderation alert message. actionType is the web client's alert action type.

POST /guilds/{guild_id}/auto-moderation/alert-action

func (*API) TransferApplication

func (a *API) TransferApplication(ctx context.Context, applicationID, teamID string) (*Application, error)

TransferApplication transfers an application to a team.

POST /applications/{application_id}/transfer discord.py-self: transfer_application

func (*API) TriggerEmbeddedSurveyAction

func (a *API) TriggerEmbeddedSurveyAction(ctx context.Context, actionType, forceSurveyID string, metadata interface{}) (json.RawMessage, error)

TriggerEmbeddedSurveyAction reports a user action that may trigger an embedded survey. forceSurveyID and metadata are optional.

POST /users/@me/embedded-survey/action

func (*API) TriggerUserOffer

func (a *API) TriggerUserOffer(ctx context.Context, body map[string]interface{}) (json.RawMessage, error)

TriggerUserOffer asks the server whether a trigger (screen, action) should show an offer; body is the trigger description the web client sends.

POST /users/@me/billing/user-offer/trigger

func (*API) UnassignGuildRoleConnection

func (a *API) UnassignGuildRoleConnection(ctx context.Context, guildID, roleID string) error

UnassignGuildRoleConnection gives up a linked role.

POST /guilds/{guild_id}/roles/{role_id}/connections/unassign

func (*API) Unban

func (a *API) Unban(ctx context.Context, guildID, userID, reason string) error

Unban lifts a ban.

DELETE /guilds/{guild_id}/bans/{user_id} discord.py-self: unban

func (*API) UncancelGuildSubscriptionSlot

func (a *API) UncancelGuildSubscriptionSlot(ctx context.Context, slotID string) (*PremiumGuildSubscriptionSlot, error)

UncancelGuildSubscriptionSlot reverts the cancellation of a boost slot.

POST /users/@me/guilds/premium/subscription-slots/{slot_id}/uncancel discord.py-self: uncancel_guild_subscription_slot

func (*API) UnenrollActiveDeveloper

func (a *API) UnenrollActiveDeveloper(ctx context.Context) error

UnenrollActiveDeveloper leaves the Active Developer program.

DELETE /developers/active-program discord.py-self: unenroll_active_developer

func (*API) UnignoreUser

func (a *API) UnignoreUser(ctx context.Context, userID, location string) error

UnignoreUser stops ignoring a user.

DELETE /users/@me/relationships/{user_id}/ignore

func (*API) UnpinMessage

func (a *API) UnpinMessage(ctx context.Context, channelID, messageID, reason string) error

UnpinMessage unpins a message. reason is the audit-log reason ("" for none).

DELETE /channels/{channel_id}/messages/pins/{message_id} discord.py-self: unpin_message

func (*API) UpdateGuildPowerup

func (a *API) UpdateGuildPowerup(ctx context.Context, guildID, entitlementID, skuID, gameServerName string) (json.RawMessage, error)

UpdateGuildPowerup changes the game server of a powerup entitlement.

PATCH /guilds/{guild_id}/entitlements/{entitlement_id}

func (*API) UpdateGuildRoom

func (a *API) UpdateGuildRoom(ctx context.Context, guildID, roomID string, body interface{}) (json.RawMessage, error)

UpdateGuildRoom updates your state in a room. body holds keys such as "user_position" and "user_status_id".

POST /guilds/{guild_id}/rooms/{room_id}/update

func (*API) UpdateGuildRoomObject

func (a *API) UpdateGuildRoomObject(ctx context.Context, guildID, roomID, objectID string, body interface{}) (json.RawMessage, error)

UpdateGuildRoomObject updates an object of a room.

POST /guilds/{guild_id}/rooms/{room_id}/objects/{object_id}/update

func (*API) UpdateUserAchievement

func (a *API) UpdateUserAchievement(ctx context.Context, userID, applicationID, achievementID string, percentComplete int) error

UpdateUserAchievement sets a user's progress on an achievement (application owner only).

PUT /users/{user_id}/applications/{application_id}/achievements/{achievement_id} discord.py-self: update_user_achievement

func (*API) UploadDebugLog

func (a *API) UploadDebugLog(ctx context.Context, category, filename, content string) error

UploadDebugLog uploads a plain text client log under a category and file name.

POST /debug-logs/{category}/{filename}

func (*API) UploadStreamPreview

func (a *API) UploadStreamPreview(ctx context.Context, streamKey, thumbnail string) error

UploadStreamPreview uploads the preview thumbnail of your own stream; thumbnail is a data URI ("data:image/jpeg;base64,...").

POST /streams/{stream_key}/preview discord.py-self: upload_stream_preview

func (*API) UploadUnverifiedApplicationIcon

func (a *API) UploadUnverifiedApplicationIcon(ctx context.Context, name, hash, icon string) error

UploadUnverifiedApplicationIcon uploads the icon of a reported application. icon is base64 image data.

POST /unverified-applications/icons discord.py-self: upload_unverified_application_icon

func (*API) UploadVoicePublicKey

func (a *API) UploadVoicePublicKey(ctx context.Context, publicKey, signature []byte, keyVersion int) error

UploadVoicePublicKey registers your voice end-to-end-encryption public key and its signature.

PUT /voice/public-keys

func (*API) UserApplicationCommandIndex

func (a *API) UserApplicationCommandIndex(ctx context.Context) (*ApplicationCommandIndex, error)

UserApplicationCommandIndex returns the slash-command index for your account.

GET /users/@me/application-command-index discord.py-self: user_application_command_index

func (*API) ValidateAutoModerationRule

func (a *API) ValidateAutoModerationRule(ctx context.Context, guildID string, params *AutoModerationRuleParams) (json.RawMessage, error)

ValidateAutoModerationRule validates an auto moderation rule without saving it. The answer is not modelled, so it is returned raw.

POST /guilds/{guild_id}/auto-moderation/rules/validate

func (*API) ValidateBillingAddress

func (a *API) ValidateBillingAddress(ctx context.Context, address BillingAddress) (*BillingAddressToken, error)

ValidateBillingAddress validates a billing address and returns a token for it.

POST /users/@me/billing/payment-sources/validate-billing-address discord.py-self: validate_billing_address

func (*API) ValidatePhoneSupportTicket

func (a *API) ValidatePhoneSupportTicket(ctx context.Context, token string) (json.RawMessage, error)

ValidatePhoneSupportTicket validates a phone-verification support ticket token.

POST /phone-verifications/validate-support-ticket

func (*API) VerifyAge

func (a *API) VerifyAge(ctx context.Context, method, vendor string) (json.RawMessage, error)

VerifyAge starts age verification with a method and vendor.

POST /age-verification/verify

func (*API) VerifyAgeV2

func (a *API) VerifyAgeV2(ctx context.Context, method, vendor string) (json.RawMessage, error)

VerifyAgeV2 is the v2 variant of VerifyAge.

POST /age-verification/verify/v2

func (*API) VerifyCaptcha

func (a *API) VerifyCaptcha(ctx context.Context, captchaKey string) error

VerifyCaptcha submits a captcha solution for the account.

POST /users/@me/captcha/verify

func (*API) VerifyEmail

func (a *API) VerifyEmail(ctx context.Context, token string) (*LoginResponse, error)

VerifyEmail confirms an email address from the verification link token and returns the (possibly new) token and user ID.

POST /auth/verify

func (*API) VerifyOAuth2DeviceCode

func (a *API) VerifyOAuth2DeviceCode(ctx context.Context, userCode string) (json.RawMessage, error)

VerifyOAuth2DeviceCode looks up the device flow user code shown on a TV or console.

POST /oauth2/device/verify

func (*API) VerifyPhone

func (a *API) VerifyPhone(ctx context.Context, phone, code string) (json.RawMessage, error)

VerifyPhone submits the SMS code for a phone number being verified.

POST /phone-verifications/verify

func (*API) VoidPayment

func (a *API) VoidPayment(ctx context.Context, paymentID string) error

VoidPayment voids a pending payment.

POST /users/@me/billing/payments/{payment_id}/void discord.py-self: void_payment

func (*API) WakeGameServer

func (a *API) WakeGameServer(ctx context.Context, gameServerID string) (json.RawMessage, error)

WakeGameServer wakes a sleeping game server.

POST /users/@me/game-servers/{game_server_id}/wake

func (*API) WakeGuildGameServer

func (a *API) WakeGuildGameServer(ctx context.Context, guildID, gameServerID string) (json.RawMessage, error)

WakeGuildGameServer wakes a sleeping game server.

POST /guilds/{guild_id}/game-servers/{game_server_id}/wake

type APIError

type APIError struct {
	Method, Path string
	StatusCode   int
	Code         int // Discord JSON error code, 0 if absent
	Message      string
	Errors       json.RawMessage // Discord "errors" object, if any
	RetryAfter   time.Duration   // for 429
	Global       bool            // for 429
	Body         []byte
}

APIError is returned for every HTTP status >= 400.

func (*APIError) Error

func (e *APIError) Error() string

Error implements error. It includes the flattened "errors" object, e.g. "discord: POST /channels/1/messages: 400 Bad Request (code 50035): Invalid Form Body; content: Must be 2000 or fewer in length. (BASE_TYPE_MAX_LENGTH)".

type AcceptInviteParams

type AcceptInviteParams struct {
	// SessionID is the gateway session ID.
	SessionID string
	// GuildID, ChannelID and ChannelType describe the invite's destination
	// (from the invite object) for the context properties.
	GuildID     string
	ChannelID   string
	ChannelType *ChannelType
	// MessageID is set when the invite is accepted from an invite button
	// embed in a message; then GuildID, ChannelID and ChannelType describe
	// that message's channel.
	MessageID string
	// Location overrides the context location ("Accept Invite Page", "Join
	// Guild", "Invite Button Embed"); empty picks one as discord.py-self does.
	Location string
}

AcceptInviteParams are the optional parts of AcceptInvite. The location fields feed the X-Context-Properties header the web client sends.

type AcceptedInvite

type AcceptedInvite struct {
	TargetType           InviteTargetType     `json:"target_type,omitempty"`
	TargetUser           *User                `json:"target_user,omitempty"`
	TargetApplication    *PartialApplication  `json:"target_application,omitempty"`
	Code                 string               `json:"code"`
	Type                 InviteType           `json:"type"`
	Channel              *PartialChannel      `json:"channel"`
	GuildID              string               `json:"guild_id,omitempty"`
	Guild                *InviteGuild         `json:"guild,omitempty"`
	Profile              *GuildProfile        `json:"profile,omitempty"`
	Inviter              *User                `json:"inviter,omitempty"`
	Flags                int                  `json:"flags,omitempty"`
	ExpiresAt            *time.Time           `json:"expires_at"`
	GuildScheduledEvent  *GuildScheduledEvent `json:"guild_scheduled_event,omitempty"`
	StageInstance        *InviteStageInstance `json:"stage_instance,omitempty"`
	IsNicknameChangeable bool                 `json:"is_nickname_changeable,omitempty"`
	NewMember            bool                 `json:"new_member"`
	ShowVerificationForm bool                 `json:"show_verification_form"`
}

AcceptedInvite mirrors the Discord accepted invite object.

type AckMessageParams

type AckMessageParams struct {
	// Manual marks the message as read explicitly ("Mark as unread" style
	// acks); the ack token is then not sent. When false, Token is sent as
	// "token" (JSON null when empty), as discord.py-self does with the token
	// returned by the previous ack.
	Manual bool
	Token  string

	MentionCount *int
	Flags        *int
	LastViewed   *int
}

AckMessageParams are the optional parameters of AckMessage.

type AckUserOfferParams

type AckUserOfferParams struct {
	TrialOfferID    string `json:"user_trial_offer_id,omitempty"`
	DiscountOfferID string `json:"user_discount_offer_id,omitempty"`
}

AckUserOfferParams are the options of AckUserOffer.

type AcknowledgementToken

type AcknowledgementToken struct {
	Token *string `json:"token"`
}

AcknowledgementToken mirrors the Discord acknowledgement token object.

type ActionRow

type ActionRow struct {
	Type       ComponentType `json:"type"`
	ID         int           `json:"id,omitempty"`
	Components []Component   `json:"components"`
}

ActionRow mirrors the Discord action row object.

type ActiveDeveloperResponse

type ActiveDeveloperResponse struct {
	Follower ActiveDeveloperWebhook `json:"follower"`
}

ActiveDeveloperResponse mirrors the Discord active developer response object.

type ActiveDeveloperWebhook

type ActiveDeveloperWebhook struct {
	ChannelID string `json:"channel_id"`
	WebhookID string `json:"webhook_id"`
}

ActiveDeveloperWebhook mirrors the Discord active developer webhook object.

type Activity

type Activity struct {
	Name      string `json:"name"`
	Type      int    `json:"type"`
	State     string `json:"state,omitempty"`
	ID        string `json:"id,omitempty"`
	CreatedAt int64  `json:"created_at,omitempty"`

	URL                 string              `json:"url,omitempty"`
	Details             string              `json:"details,omitempty"`
	Timestamps          *ActivityTimestamps `json:"timestamps,omitempty"`
	Platform            string              `json:"platform,omitempty"`
	SupportedPlatforms  []string            `json:"supported_platforms,omitempty"`
	Assets              *ActivityAssets     `json:"assets,omitempty"`
	Party               *ActivityParty      `json:"party,omitempty"`
	ApplicationID       string              `json:"application_id,omitempty"`
	ParentApplicationID string              `json:"parent_application_id,omitempty"`
	Flags               int                 `json:"flags,omitempty"`
	Emoji               *ActivityEmoji      `json:"emoji,omitempty"`
	Secrets             *ActivitySecrets    `json:"secrets,omitempty"`
	Metadata            map[string]any      `json:"metadata,omitempty"`
	SessionID           string              `json:"session_id,omitempty"`
	Instance            bool                `json:"instance,omitempty"`
	Buttons             []string            `json:"buttons,omitempty"`
	SyncID              string              `json:"sync_id,omitempty"`
	StateURL            string              `json:"state_url,omitempty"`
	DetailsURL          string              `json:"details_url,omitempty"`
	StatusDisplayType   *StatusDisplayType  `json:"status_display_type,omitempty"`
}

Activity is a presence activity (discord.py-self types/activity.py Activity).

type ActivityAssets

type ActivityAssets struct {
	LargeImage       string `json:"large_image,omitempty"`
	LargeText        string `json:"large_text,omitempty"`
	SmallImage       string `json:"small_image,omitempty"`
	SmallText        string `json:"small_text,omitempty"`
	LargeURL         string `json:"large_url,omitempty"`
	SmallURL         string `json:"small_url,omitempty"`
	InviteCoverImage string `json:"invite_cover_image,omitempty"`
}

ActivityAssets mirrors the Discord activity assets object.

type ActivityEmoji

type ActivityEmoji struct {
	Name     *string `json:"name"`
	ID       *string `json:"id"`
	Animated bool    `json:"animated,omitempty"`
}

ActivityEmoji mirrors the Discord activity emoji object.

type ActivityJoinSecret

type ActivityJoinSecret struct {
	Secret  string `json:"secret"`
	JoinURL string `json:"join_url"`
}

ActivityJoinSecret is the join secret of a user's activity.

type ActivityParty

type ActivityParty struct {
	ID   string `json:"id,omitempty"`
	Size []int  `json:"size,omitempty"`
}

ActivityParty mirrors the Discord activity party object.

type ActivitySecret

type ActivitySecret struct {
	Secret string `json:"secret"`
}

ActivitySecret mirrors the Discord activity secret object.

type ActivitySecrets

type ActivitySecrets struct {
	Join     string `json:"join,omitempty"`
	Spectate string `json:"spectate,omitempty"`
}

ActivitySecrets mirrors the Discord activity secrets object.

type ActivityStartEvent

type ActivityStartEvent struct {
	UserID   string   `json:"user_id"`
	Activity Activity `json:"activity"`
}

ActivityStartEvent is ACTIVITY_START (web).

type ActivitySubscription

type ActivitySubscription struct {
	UserID        string `json:"user_id"`
	ApplicationID string `json:"application_id"`
	PartyID       string `json:"party_id,omitempty"`
	MessageID     string `json:"message_id,omitempty"`
	ChannelID     string `json:"channel_id,omitempty"`
}

ActivitySubscription identifies one user activity to subscribe to.

type ActivityTimestamps

type ActivityTimestamps struct {
	Start int `json:"start,omitempty"`
	End   int `json:"end,omitempty"`
}

ActivityTimestamps mirrors the Discord activity timestamps object.

type ActivityType

type ActivityType int

ActivityType is the Discord activity type enumeration.

const (
	ActivityTypePlaying   ActivityType = 0
	ActivityTypeStreaming ActivityType = 1
	ActivityTypeListening ActivityType = 2
	ActivityTypeWatching  ActivityType = 3
	ActivityTypeCustom    ActivityType = 4
	ActivityTypeCompeting ActivityType = 5
	ActivityTypeHang      ActivityType = 6
)

ActivityType values.

type ActivityUserActionEvent

type ActivityUserActionEvent struct {
	ActionType    json.RawMessage `json:"action_type,omitempty"`
	ApplicationID string          `json:"application_id"`
	ChannelID     string          `json:"channel_id"`
	MessageID     string          `json:"message_id"`
	User          *User           `json:"user,omitempty"`
}

ActivityUserActionEvent is ACTIVITY_USER_ACTION (web).

type ActivityUserID

type ActivityUserID struct {
	ID string `json:"id"`
}

ActivityUserID mirrors the Discord activity user id object.

type AddConnectionParams

type AddConnectionParams struct {
	TwoWayLinkCode string
}

AddConnectionParams are the options of AddConnection.

type AddGroupRecipientParams

type AddGroupRecipientParams struct {
	Nick string // nickname for the new recipient (body {"nick": ...}); no body when empty
}

AddGroupRecipientParams are the optional parameters of AddGroupRecipient.

type AdminServerEligibility

type AdminServerEligibility struct {
	EligibleForAdminServer bool `json:"eligible_for_admin_server"`
}

AdminServerEligibility mirrors the Discord admin server eligibility object.

type AllowedMentionType

type AllowedMentionType string

AllowedMentionType is the Discord allowed mention type enumeration.

const (
	AllowedMentionTypeRoles    AllowedMentionType = "roles"
	AllowedMentionTypeUsers    AllowedMentionType = "users"
	AllowedMentionTypeEveryone AllowedMentionType = "everyone"
)

AllowedMentionType values.

type AllowedMentions

type AllowedMentions struct {
	Parse       []AllowedMentionType `json:"parse"`
	Roles       []string             `json:"roles"`
	Users       []string             `json:"users"`
	RepliedUser bool                 `json:"replied_user"`
}

AllowedMentions is a request body sent to the API (allowed mentions).

type ApexExperimentAssignments

type ApexExperimentAssignments struct {
	EvaluationID string            `json:"evaluation_id"`
	Assignments  []json.RawMessage `json:"assignments"` // untyped JSON value
}

ApexExperimentAssignments mirrors the Discord apex experiment assignments object.

type ApexExperimentResponse

type ApexExperimentResponse struct {
	Installation string                                                          `json:"installation,omitempty"`
	Assignments  map[ApexExperimentUnitType]map[string]ApexExperimentAssignments `json:"assignments"`
}

ApexExperimentResponse mirrors the Discord apex experiment response object.

type ApexExperimentUnitType

type ApexExperimentUnitType string

ApexExperimentUnitType is the Discord apex experiment unit type enumeration. Values: '1', '2', '3', '4'.

type Application

type Application struct {
	ID                             string                    `json:"id"`
	Name                           string                    `json:"name"`
	Description                    string                    `json:"description"`
	Icon                           *string                   `json:"icon"`
	CoverImage                     string                    `json:"cover_image,omitempty"`
	Splash                         string                    `json:"splash,omitempty"`
	Type                           *int                      `json:"type"`
	PrimarySKUID                   string                    `json:"primary_sku_id,omitempty"`
	Summary                        string                    `json:"summary,omitempty"`
	DeeplinkURI                    string                    `json:"deeplink_uri,omitempty"`
	ThirdPartySKUs                 []ThirdPartySKU           `json:"third_party_skus,omitempty"`
	Bot                            *User                     `json:"bot,omitempty"`
	IsVerified                     bool                      `json:"is_verified"`
	IsDiscoverable                 bool                      `json:"is_discoverable"`
	IsMonetized                    bool                      `json:"is_monetized"`
	StorefrontAvailable            bool                      `json:"storefront_available"`
	Hook                           bool                      `json:"hook"`
	Overlay                        bool                      `json:"overlay,omitempty"`
	OverlayMethods                 int                       `json:"overlay_methods,omitempty"`
	OverlayWarn                    bool                      `json:"overlay_warn,omitempty"`
	OverlayCompatibilityHook       bool                      `json:"overlay_compatibility_hook,omitempty"`
	Aliases                        []string                  `json:"aliases,omitempty"`
	Executables                    []ApplicationExecutable   `json:"executables,omitempty"`
	Owner                          *User                     `json:"owner,omitempty"` // Not actually ever present in partial app
	Team                           *Team                     `json:"team,omitempty"`
	VerifyKey                      string                    `json:"verify_key"`
	Flags                          int                       `json:"flags"`
	NewFlags                       string                    `json:"new_flags,omitempty"`
	RpcOrigins                     []string                  `json:"rpc_origins,omitempty"`
	TermsOfServiceURL              string                    `json:"terms_of_service_url,omitempty"`
	PrivacyPolicyURL               string                    `json:"privacy_policy_url,omitempty"`
	MaxParticipants                *int                      `json:"max_participants,omitempty"`
	BotPublic                      bool                      `json:"bot_public,omitempty"`
	BotRequireCodeGrant            bool                      `json:"bot_require_code_grant,omitempty"`
	IntegrationPublic              bool                      `json:"integration_public,omitempty"`
	IntegrationRequireCodeGrant    bool                      `json:"integration_require_code_grant,omitempty"`
	GuildID                        string                    `json:"guild_id,omitempty"`
	Slug                           string                    `json:"slug,omitempty"`
	Developers                     []ApplicationCompany      `json:"developers,omitempty"`
	Publishers                     []ApplicationCompany      `json:"publishers,omitempty"`
	EULAID                         string                    `json:"eula_id,omitempty"`
	EmbeddedActivityConfig         *EmbeddedActivityConfig   `json:"embedded_activity_config,omitempty"`
	Guild                          *PartialGuild             `json:"guild,omitempty"`
	InstallParams                  *ApplicationInstallParams `json:"install_params,omitempty"`
	StoreListingSKUID              string                    `json:"store_listing_sku_id,omitempty"`
	RoleConnectionsVerificationURL *string                   `json:"role_connections_verification_url,omitempty"`
	BotDisabled                    bool                      `json:"bot_disabled,omitempty"`
	BotQuarantined                 bool                      `json:"bot_quarantined,omitempty"`
	RedirectURIs                   []string                  `json:"redirect_uris"`
	InteractionsEndpointURL        *string                   `json:"interactions_endpoint_url"`
	InteractionsVersion            InteractionsVersion       `json:"interactions_version"`
	InteractionsEventTypes         []string                  `json:"interactions_event_types"`
	VerificationState              int                       `json:"verification_state"`
	StoreApplicationState          int                       `json:"store_application_state"`
	RpcApplicationState            int                       `json:"rpc_application_state"`
	CreatorMonetizationState       int                       `json:"creator_monetization_state"`
	DiscoverabilityState           int                       `json:"discoverability_state"`
	DiscoveryEligibilityFlags      int                       `json:"discovery_eligibility_flags"`
	MonetizationState              int                       `json:"monetization_state"`
	MonetizationEligibilityFlags   int                       `json:"monetization_eligibility_flags"`
	ApproximateGuildCount          int                       `json:"approximate_guild_count,omitempty"`
}

Application mirrors the Discord application object.

type ApplicationAchievement

type ApplicationAchievement struct {
	ID                       string            `json:"id"`
	Name                     json.RawMessage   `json:"name"` // union of primitive types on the wire
	NameLocalizations        map[string]string `json:"name_localizations,omitempty"`
	Description              json.RawMessage   `json:"description"` // union of primitive types on the wire
	DescriptionLocalizations map[string]string `json:"description_localizations,omitempty"`
	IconHash                 string            `json:"icon_hash"`
	Secure                   bool              `json:"secure"`
	Secret                   bool              `json:"secret"`
	ApplicationID            string            `json:"application_id"`
}

ApplicationAchievement mirrors the Discord application achievement object.

type ApplicationActivityStatistics

type ApplicationActivityStatistics struct {
	TotalDuration int       `json:"total_duration"`
	LastPlayedAt  time.Time `json:"last_played_at"`
	UserID        string    `json:"user_id"`
}

ApplicationActivityStatistics mirrors the Discord application activity statistics object.

type ApplicationAsset

type ApplicationAsset struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	Type int    `json:"type"`
}

ApplicationAsset mirrors the Discord application asset object.

type ApplicationBaseAchievement

type ApplicationBaseAchievement struct {
	ID                       string            `json:"id"`
	Name                     json.RawMessage   `json:"name"` // union of primitive types on the wire
	NameLocalizations        map[string]string `json:"name_localizations,omitempty"`
	Description              json.RawMessage   `json:"description"` // union of primitive types on the wire
	DescriptionLocalizations map[string]string `json:"description_localizations,omitempty"`
	IconHash                 string            `json:"icon_hash"`
	Secure                   bool              `json:"secure"`
	Secret                   bool              `json:"secret"`
}

ApplicationBaseAchievement mirrors the Discord application base achievement object.

type ApplicationBranch

type ApplicationBranch struct {
	ID          string     `json:"id"`
	LiveBuildID *string    `json:"live_build_id,omitempty"`
	CreatedAt   *time.Time `json:"created_at,omitempty"`
	Name        string     `json:"name,omitempty"`
}

ApplicationBranch mirrors the Discord application branch object.

type ApplicationBranchSize

type ApplicationBranchSize struct {
	SizeKb string `json:"size_kb"` // Stringified float
}

ApplicationBranchSize mirrors the Discord application branch size object.

type ApplicationBuild

type ApplicationBuild struct {
	ApplicationID string                `json:"application_id,omitempty"`
	CreatedAt     *time.Time            `json:"created_at,omitempty"`
	ID            string                `json:"id"`
	Manifests     []ApplicationManifest `json:"manifests"`
	Status        string                `json:"status"` // one of 'CORRUPTED', 'INVALID', 'READY', 'VALIDATING', 'UPLOADED', 'UPLOADING', 'CREATED'
	SourceBuildID *string               `json:"source_build_id,omitempty"`
	Version       *string               `json:"version,omitempty"`
}

ApplicationBuild mirrors the Discord application build object.

type ApplicationBuildFile

type ApplicationBuildFile struct {
	ID      string `json:"id"`
	MD5Hash string `json:"md5_hash,omitempty"`
}

ApplicationBuildFile mirrors the Discord application build file object.

type ApplicationCommand

type ApplicationCommand struct {
	ID                       string                              `json:"id"`
	ApplicationID            string                              `json:"application_id"`
	Name                     string                              `json:"name"`
	Version                  string                              `json:"version"`
	Contexts                 []InteractionContextType            `json:"contexts,omitempty"`
	IntegrationTypes         []InteractionInstallationType       `json:"integration_types,omitempty"`
	DefaultMemberPermissions *string                             `json:"default_member_permissions,omitempty"`
	DMPermission             *bool                               `json:"dm_permission,omitempty"`
	NSFW                     bool                                `json:"nsfw,omitempty"`
	NameLocalizations        map[string]string                   `json:"name_localizations,omitempty"`
	NameLocalized            *string                             `json:"name_localized,omitempty"`
	DescriptionLocalizations map[string]string                   `json:"description_localizations,omitempty"`
	DescriptionLocalized     *string                             `json:"description_localized,omitempty"`
	Permissions              *ApplicationCommandIndexPermissions `json:"permissions,omitempty"`
	GlobalPopularityRank     int                                 `json:"global_popularity_rank,omitempty"`
	Description              string                              `json:"description"`
	Type                     ApplicationCommandType              `json:"type"`
	Options                  []ApplicationCommandOption          `json:"options,omitempty"`
	Handler                  ApplicationCommandHandlerType       `json:"handler,omitempty"`
	GuildID                  string                              `json:"guild_id,omitempty"`
}

ApplicationCommand is the flattened superset of the 7 application command variants; fields absent from a variant are omitted.

type ApplicationCommandAutocompleteEvent

type ApplicationCommandAutocompleteEvent struct {
	Nonce   string                           `json:"nonce"`
	Choices []ApplicationCommandOptionChoice `json:"choices"`
}

ApplicationCommandAutocompleteEvent is APPLICATION_COMMAND_AUTOCOMPLETE_RESPONSE.

type ApplicationCommandCursor

type ApplicationCommandCursor struct {
	Next     *string `json:"next"`
	Previous *string `json:"previous"`
	Repaired *string `json:"repaired"`
}

ApplicationCommandCursor mirrors the Discord application command cursor object.

type ApplicationCommandHandlerType

type ApplicationCommandHandlerType int

ApplicationCommandHandlerType is the Discord application command handler type enumeration.

const (
	ApplicationCommandHandlerTypeAppHandler            ApplicationCommandHandlerType = 1
	ApplicationCommandHandlerTypeDiscordLaunchActivity ApplicationCommandHandlerType = 2
)

ApplicationCommandHandlerType values.

type ApplicationCommandIndex

type ApplicationCommandIndex struct {
	ApplicationCommands []ApplicationCommand `json:"application_commands"`
	Applications        []CommandApplication `json:"applications"`
}

ApplicationCommandIndex mirrors the Discord application command index object.

type ApplicationCommandIndexPermissions

type ApplicationCommandIndexPermissions struct {
	User     bool            `json:"user,omitempty"`
	Roles    map[string]bool `json:"roles,omitempty"`
	Channels map[string]bool `json:"channels,omitempty"`
}

ApplicationCommandIndexPermissions mirrors the Discord application command index permissions object.

type ApplicationCommandInteractionData

type ApplicationCommandInteractionData struct {
	ID                 string                                    `json:"id"`
	Name               string                                    `json:"name"`
	Version            string                                    `json:"version"`
	GuildID            string                                    `json:"guild_id,omitempty"`
	ApplicationCommand ApplicationCommand                        `json:"application_command"`
	Attachments        []PartialAttachment                       `json:"attachments"`
	Options            []ApplicationCommandInteractionDataOption `json:"options"`
	Type               ApplicationCommandType                    `json:"type,omitempty"`
	TargetID           string                                    `json:"target_id,omitempty"`
}

ApplicationCommandInteractionData is the flattened superset of the 4 application command interaction data variants; fields absent from a variant are omitted.

type ApplicationCommandInteractionDataOption

type ApplicationCommandInteractionDataOption struct {
	Name    string                                    `json:"name"`
	Type    int                                       `json:"type"` // one of 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 10
	Options []ApplicationCommandInteractionDataOption `json:"options,omitempty"`
	Focused bool                                      `json:"focused,omitempty"`
	Value   json.RawMessage                           `json:"value,omitempty"` // string, integer, number, boolean or snowflake depending on Type
}

ApplicationCommandInteractionDataOption is the flattened superset of the 6 application command interaction data option variants; fields absent from a variant are omitted.

func CommandOption

func CommandOption(name string, optionType int, value interface{}) ApplicationCommandInteractionDataOption

CommandOption builds one value option for InteractCommand: optionType is the ApplicationCommandOptionType (3 string, 4 integer, 5 boolean, 6 user, 7 channel, 8 role, 9 mentionable, 10 number, 11 attachment) and value the Go value (string, int, bool, float64, or a snowflake string).

func CommandSubOption

CommandSubOption builds a sub-command or sub-command-group option (type 1 or 2) wrapping child options.

type ApplicationCommandOption

type ApplicationCommandOption struct {
	Name                     string                           `json:"name"`
	Description              string                           `json:"description"`
	NameLocalizations        map[string]string                `json:"name_localizations,omitempty"`
	NameLocalized            *string                          `json:"name_localized,omitempty"`
	DescriptionLocalizations map[string]string                `json:"description_localizations,omitempty"`
	DescriptionLocalized     *string                          `json:"description_localized,omitempty"`
	Type                     ApplicationCommandOptionType     `json:"type"`
	Options                  []ApplicationCommandOption       `json:"options,omitempty"`
	Choices                  []ApplicationCommandOptionChoice `json:"choices,omitempty"`
	MinLength                int                              `json:"min_length,omitempty"`
	MaxLength                int                              `json:"max_length,omitempty"`
	Autocomplete             bool                             `json:"autocomplete,omitempty"`
	MinValue                 float64                          `json:"min_value,omitempty"`
	MaxValue                 float64                          `json:"max_value,omitempty"`
	Required                 bool                             `json:"required,omitempty"`
	ChannelTypes             []ChannelType                    `json:"channel_types,omitempty"`
}

ApplicationCommandOption is the flattened superset of the 8 application command option variants; fields absent from a variant are omitted.

type ApplicationCommandOptionChoice

type ApplicationCommandOptionChoice struct {
	Name              string            `json:"name"`
	NameLocalizations map[string]string `json:"name_localizations,omitempty"`
	NameLocalized     *string           `json:"name_localized,omitempty"`
	Value             json.RawMessage   `json:"value"` // string, integer or number depending on the option type
}

ApplicationCommandOptionChoice is the flattened superset of StringApplicationCommandOptionChoice, IntegerApplicationCommandOptionChoice, NumberApplicationCommandOptionChoice; fields absent from a variant are omitted.

type ApplicationCommandOptionType

type ApplicationCommandOptionType int

ApplicationCommandOptionType is the Discord application command option type enumeration.

const (
	ApplicationCommandOptionTypeSubcommand      ApplicationCommandOptionType = 1
	ApplicationCommandOptionTypeSubcommandGroup ApplicationCommandOptionType = 2
	ApplicationCommandOptionTypeString          ApplicationCommandOptionType = 3
	ApplicationCommandOptionTypeInteger         ApplicationCommandOptionType = 4
	ApplicationCommandOptionTypeBoolean         ApplicationCommandOptionType = 5
	ApplicationCommandOptionTypeUser            ApplicationCommandOptionType = 6
	ApplicationCommandOptionTypeChannel         ApplicationCommandOptionType = 7
	ApplicationCommandOptionTypeRole            ApplicationCommandOptionType = 8
	ApplicationCommandOptionTypeMentionable     ApplicationCommandOptionType = 9
	ApplicationCommandOptionTypeNumber          ApplicationCommandOptionType = 10
	ApplicationCommandOptionTypeAttachment      ApplicationCommandOptionType = 11
)

ApplicationCommandOptionType values.

type ApplicationCommandPermissionType

type ApplicationCommandPermissionType int

ApplicationCommandPermissionType is the Discord application command permission type enumeration.

const (
	ApplicationCommandPermissionTypeRole    ApplicationCommandPermissionType = 1
	ApplicationCommandPermissionTypeUser    ApplicationCommandPermissionType = 2
	ApplicationCommandPermissionTypeChannel ApplicationCommandPermissionType = 3
)

ApplicationCommandPermissionType values.

type ApplicationCommandPermissions

type ApplicationCommandPermissions struct {
	ID         string                           `json:"id"`
	Type       ApplicationCommandPermissionType `json:"type"`
	Permission bool                             `json:"permission"`
}

ApplicationCommandPermissions mirrors the Discord application command permissions object.

type ApplicationCommandSearch

type ApplicationCommandSearch struct {
	ApplicationCommands []ApplicationCommand     `json:"application_commands"`
	Applications        []CommandApplication     `json:"applications"`
	Cursor              ApplicationCommandCursor `json:"cursor"`
}

ApplicationCommandSearch mirrors the Discord application command search object.

type ApplicationCommandType

type ApplicationCommandType int

ApplicationCommandType is the Discord application command type enumeration.

const (
	ApplicationCommandTypeChatInput         ApplicationCommandType = 1
	ApplicationCommandTypeUser              ApplicationCommandType = 2
	ApplicationCommandTypeMessage           ApplicationCommandType = 3
	ApplicationCommandTypePrimaryEntryPoint ApplicationCommandType = 4
)

ApplicationCommandType values.

type ApplicationCompany

type ApplicationCompany struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

ApplicationCompany mirrors the Discord application company object.

type ApplicationCreatedBuild

type ApplicationCreatedBuild struct {
	Build           ApplicationBuild      `json:"build"`
	ManifestUploads []ApplicationManifest `json:"manifest_uploads"`
}

ApplicationCreatedBuild is the request body for creating a application created build.

type ApplicationCreatedBuildFile

type ApplicationCreatedBuildFile struct {
	ID  string `json:"id"`
	URL string `json:"url"`
}

ApplicationCreatedBuildFile is the request body for creating a application created build file.

type ApplicationDiscoverability

type ApplicationDiscoverability struct {
	DiscoverabilityState      int                  `json:"discoverability_state"`
	DiscoveryEligibilityFlags int                  `json:"discovery_eligibility_flags"`
	BadCommands               []ApplicationCommand `json:"bad_commands"`
}

ApplicationDiscoverability mirrors the Discord application discoverability object.

type ApplicationDownloadSignature

type ApplicationDownloadSignature struct {
	Endpoint  string `json:"endpoint"`
	Expires   int    `json:"expires"`
	Signature string `json:"signature"`
}

ApplicationDownloadSignature mirrors the Discord application download signature object.

type ApplicationEULA

type ApplicationEULA struct {
	ID      string `json:"id"`
	Name    string `json:"name"`
	Content string `json:"content"`
}

ApplicationEULA mirrors the Discord application eula object.

type ApplicationExecutable

type ApplicationExecutable struct {
	Name       string `json:"name"`
	OS         string `json:"os"` // one of 'win32', 'linux', 'darwin'
	IsLauncher bool   `json:"is_launcher"`
}

ApplicationExecutable mirrors the Discord application executable object.

type ApplicationFrameUpdateEvent

type ApplicationFrameUpdateEvent struct {
	ProjectID     string          `json:"project_id"`
	ApplicationID string          `json:"application_id"`
	UpdatedAt     json.RawMessage `json:"updated_at,omitempty"`
}

ApplicationFrameUpdateEvent is APPLICATION_FRAME_UPDATE (web).

type ApplicationInstallParams

type ApplicationInstallParams struct {
	Scopes      []string `json:"scopes"`
	Permissions int      `json:"permissions"`
}

ApplicationInstallParams mirrors the Discord application install params object.

type ApplicationManifest

type ApplicationManifest struct {
	ID                      string                   `json:"id"`
	Label                   ApplicationManifestLabel `json:"label"`
	RedistributableLabelIDs []string                 `json:"redistributable_label_ids,omitempty"`
	URL                     *string                  `json:"url"`
}

ApplicationManifest mirrors the Discord application manifest object.

type ApplicationManifestLabel

type ApplicationManifestLabel struct {
	ApplicationID string `json:"application_id"`
	ID            string `json:"id"`
	Name          string `json:"name,omitempty"`
}

ApplicationManifestLabel mirrors the Discord application manifest label object.

type ApplicationOptionalToken

type ApplicationOptionalToken struct {
	Token *string `json:"token"`
}

ApplicationOptionalToken mirrors the Discord application optional token object.

type ApplicationSecret

type ApplicationSecret struct {
	Secret string `json:"secret"`
}

ApplicationSecret mirrors the Discord application secret object.

type ApplicationTicket

type ApplicationTicket struct {
	Ticket string `json:"ticket"`
}

ApplicationTicket mirrors the Discord application ticket object.

type ApplicationToken

type ApplicationToken struct {
	Token string `json:"token"`
}

ApplicationToken mirrors the Discord application token object.

type ArchivedThreadsOptions

type ArchivedThreadsOptions struct {
	Before string // Get threads before this timestamp (ISO8601)
	Limit  int    // Number of threads to fetch (default 50)
}

ArchivedThreadsOptions contains options for fetching archived threads

type AuditEntryInfo

type AuditEntryInfo struct {
	DeleteMemberDays              string `json:"delete_member_days"`
	MembersRemoved                string `json:"members_removed"`
	ChannelID                     string `json:"channel_id"`
	MessageID                     string `json:"message_id"`
	Count                         string `json:"count"`
	ID                            string `json:"id"`
	Type                          string `json:"type"` // one of '0', '1'
	RoleName                      string `json:"role_name"`
	ApplicationID                 string `json:"application_id"`
	GuildID                       string `json:"guild_id"`
	AutoModerationRuleName        string `json:"auto_moderation_rule_name"`
	AutoModerationRuleTriggerType string `json:"auto_moderation_rule_trigger_type"`
}

AuditEntryInfo mirrors the Discord audit entry info object.

type AuditLog

type AuditLog struct {
	Webhooks             []Webhook              `json:"webhooks"`
	Users                []*User                `json:"users"`
	AuditLogEntries      []AuditLogEntry        `json:"audit_log_entries"`
	Integrations         []PartialIntegration   `json:"integrations"`
	Threads              []*Thread              `json:"threads"`
	GuildScheduledEvents []*GuildScheduledEvent `json:"guild_scheduled_events"`
	ApplicationCommands  []ApplicationCommand   `json:"application_commands,omitempty"`
}

AuditLog mirrors the Discord audit log object.

type AuditLogChange

type AuditLogChange struct {
	Key      string          `json:"key"`
	NewValue json.RawMessage `json:"new_value"` // type depends on Key
	OldValue json.RawMessage `json:"old_value"` // type depends on Key
}

AuditLogChange is the flattened superset of the 25 audit log change variants; fields absent from a variant are omitted.

type AuditLogEntry

type AuditLogEntry struct {
	TargetID   *string          `json:"target_id"`
	UserID     *string          `json:"user_id"`
	ID         string           `json:"id"`
	ActionType AuditLogEvent    `json:"action_type"`
	Changes    []AuditLogChange `json:"changes,omitempty"`
	Options    *AuditEntryInfo  `json:"options,omitempty"`
	Reason     string           `json:"reason,omitempty"`
}

AuditLogEntry mirrors the Discord audit log entry object.

type AuditLogEvent

type AuditLogEvent int

AuditLogEvent is the Discord audit log event enumeration.

const (
	AuditLogEventGuildUpdate                        AuditLogEvent = 1
	AuditLogEventChannelCreate                      AuditLogEvent = 10
	AuditLogEventChannelUpdate                      AuditLogEvent = 11
	AuditLogEventChannelDelete                      AuditLogEvent = 12
	AuditLogEventOverwriteCreate                    AuditLogEvent = 13
	AuditLogEventOverwriteUpdate                    AuditLogEvent = 14
	AuditLogEventOverwriteDelete                    AuditLogEvent = 15
	AuditLogEventKick                               AuditLogEvent = 20
	AuditLogEventMemberPrune                        AuditLogEvent = 21
	AuditLogEventBan                                AuditLogEvent = 22
	AuditLogEventUnban                              AuditLogEvent = 23
	AuditLogEventMemberUpdate                       AuditLogEvent = 24
	AuditLogEventMemberRoleUpdate                   AuditLogEvent = 25
	AuditLogEventMemberMove                         AuditLogEvent = 26
	AuditLogEventMemberDisconnect                   AuditLogEvent = 27
	AuditLogEventBotAdd                             AuditLogEvent = 28
	AuditLogEventRoleCreate                         AuditLogEvent = 30
	AuditLogEventRoleUpdate                         AuditLogEvent = 31
	AuditLogEventRoleDelete                         AuditLogEvent = 32
	AuditLogEventInviteCreate                       AuditLogEvent = 40
	AuditLogEventInviteUpdate                       AuditLogEvent = 41
	AuditLogEventInviteDelete                       AuditLogEvent = 42
	AuditLogEventWebhookCreate                      AuditLogEvent = 50
	AuditLogEventWebhookUpdate                      AuditLogEvent = 51
	AuditLogEventWebhookDelete                      AuditLogEvent = 52
	AuditLogEventEmojiCreate                        AuditLogEvent = 60
	AuditLogEventEmojiUpdate                        AuditLogEvent = 61
	AuditLogEventEmojiDelete                        AuditLogEvent = 62
	AuditLogEventMessageDelete                      AuditLogEvent = 72
	AuditLogEventMessageBulkDelete                  AuditLogEvent = 73
	AuditLogEventMessagePin                         AuditLogEvent = 74
	AuditLogEventMessageUnpin                       AuditLogEvent = 75
	AuditLogEventIntegrationCreate                  AuditLogEvent = 80
	AuditLogEventIntegrationUpdate                  AuditLogEvent = 81
	AuditLogEventIntegrationDelete                  AuditLogEvent = 82
	AuditLogEventStageInstanceCreate                AuditLogEvent = 83
	AuditLogEventStageInstanceUpdate                AuditLogEvent = 84
	AuditLogEventStageInstanceDelete                AuditLogEvent = 85
	AuditLogEventStickerCreate                      AuditLogEvent = 90
	AuditLogEventStickerUpdate                      AuditLogEvent = 91
	AuditLogEventStickerDelete                      AuditLogEvent = 92
	AuditLogEventScheduledEventCreate               AuditLogEvent = 100
	AuditLogEventScheduledEventUpdate               AuditLogEvent = 101
	AuditLogEventScheduledEventDelete               AuditLogEvent = 102
	AuditLogEventThreadCreate                       AuditLogEvent = 110
	AuditLogEventThreadUpdate                       AuditLogEvent = 111
	AuditLogEventThreadDelete                       AuditLogEvent = 112
	AuditLogEventApplicationCommandPermissionUpdate AuditLogEvent = 121
	AuditLogEventAutomodRuleCreate                  AuditLogEvent = 140
	AuditLogEventAutomodRuleUpdate                  AuditLogEvent = 141
	AuditLogEventAutomodRuleDelete                  AuditLogEvent = 142
	AuditLogEventAutomodBlockMessage                AuditLogEvent = 143
	AuditLogEventAutomodFlagMessage                 AuditLogEvent = 144
	AuditLogEventAutomodTimeoutMember               AuditLogEvent = 145
	AuditLogEventAutomodQuarantineUser              AuditLogEvent = 146
	AuditLogEventCreatorMonetizationRequestCreated  AuditLogEvent = 150
	AuditLogEventCreatorMonetizationTermsAccepted   AuditLogEvent = 151
	AuditLogEventOnboardingPromptCreate             AuditLogEvent = 163
	AuditLogEventOnboardingPromptUpdate             AuditLogEvent = 164
	AuditLogEventOnboardingPromptDelete             AuditLogEvent = 165
	AuditLogEventOnboardingCreate                   AuditLogEvent = 166
	AuditLogEventOnboardingUpdate                   AuditLogEvent = 167
	AuditLogEventHomeSettingsCreate                 AuditLogEvent = 190
	AuditLogEventHomeSettingsUpdate                 AuditLogEvent = 191
)

AuditLogEvent values.

type AuthSessionChangeEvent

type AuthSessionChangeEvent struct {
	AuthSessionIDHash string `json:"auth_session_id_hash"`
}

AuthSessionChangeEvent represents auth session changes

type AuthorizeConnectionParams

type AuthorizeConnectionParams struct {
	TwoWayLinkType string // sets two_way_link=true and two_way_link_type
	TwoWayUserCode string // sets two_way_link=true and two_way_user_code
	Continuation   bool
}

AuthorizeConnectionParams are the options of AuthorizeConnection.

type AuthorizeOAuth2Params

type AuthorizeOAuth2Params struct {
	OAuth2AuthorizeQuery
	GuildID          string // guild to add the bot to (permissions default to "0")
	WebhookChannelID string // channel for the webhook.incoming scope
	Permissions      string // permission bit set as a decimal string
}

AuthorizeOAuth2Params are the optional fields of AuthorizeOAuth2.

type AutoModerationAction

type AutoModerationAction struct {
	Type     int                          `json:"type"`
	Metadata AutoModerationActionMetadata `json:"metadata,omitempty"`
}

AutoModerationAction represents an auto moderation action

type AutoModerationActionExecution

type AutoModerationActionExecution struct {
	GuildID              string                        `json:"guild_id"`
	Action               *AutoModerationAction         `json:"action"`
	RuleID               string                        `json:"rule_id"`
	RuleTriggerType      AutoModerationRuleTriggerType `json:"rule_trigger_type"`
	UserID               string                        `json:"user_id"`
	ChannelID            string                        `json:"channel_id,omitempty"`
	MessageID            string                        `json:"message_id,omitempty"`
	AlertSystemMessageID string                        `json:"alert_system_message_id,omitempty"`
	Content              string                        `json:"content"`
	MatchedKeyword       *string                       `json:"matched_keyword"`
	MatchedContent       *string                       `json:"matched_content"`
}

AutoModerationActionExecution mirrors the Discord auto moderation action execution object.

type AutoModerationActionMetadata

type AutoModerationActionMetadata struct {
	ChannelID       string `json:"channel_id,omitempty"`
	DurationSeconds int    `json:"duration_seconds,omitempty"`
	CustomMessage   string `json:"custom_message,omitempty"`
}

AutoModerationActionMetadata represents metadata for auto moderation actions

type AutoModerationActionTriggerType

type AutoModerationActionTriggerType int

AutoModerationActionTriggerType is the Discord auto moderation action trigger type enumeration.

const (
	AutoModerationActionTriggerTypeBlockMessage     AutoModerationActionTriggerType = 1
	AutoModerationActionTriggerTypeSendAlertMessage AutoModerationActionTriggerType = 2
	AutoModerationActionTriggerTypeTimeout          AutoModerationActionTriggerType = 3
)

AutoModerationActionTriggerType values.

type AutoModerationContentDeletedEvent

type AutoModerationContentDeletedEvent struct {
	GuildID   string          `json:"guild_id"`
	ChannelID string          `json:"channel_id"`
	Message   json.RawMessage `json:"message,omitempty"`
	Notice    json.RawMessage `json:"notice,omitempty"`
	Thread    json.RawMessage `json:"thread,omitempty"`
}

AutoModerationContentDeletedEvent is AUTO_MODERATION_CONTENT_DELETED (web).

type AutoModerationEvent

type AutoModerationEvent struct {
	GuildID              string               `json:"guild_id"`
	Action               AutoModerationAction `json:"action"`
	RuleID               string               `json:"rule_id"`
	RuleTriggerType      int                  `json:"rule_trigger_type"`
	UserID               string               `json:"user_id"`
	ChannelID            string               `json:"channel_id,omitempty"`
	MessageID            string               `json:"message_id,omitempty"`
	AlertSystemMessageID string               `json:"alert_system_message_id,omitempty"`
	Content              string               `json:"content"`
	MatchedKeyword       string               `json:"matched_keyword,omitempty"`
	MatchedContent       string               `json:"matched_content,omitempty"`
}

AutoModerationEvent represents auto moderation events

type AutoModerationMentionRaidDetectionEvent

type AutoModerationMentionRaidDetectionEvent struct {
	GuildID                        string  `json:"guild_id"`
	DecisionID                     string  `json:"decision_id"`
	SuspiciousMentionActivityUntil *string `json:"suspicious_mention_activity_until"`
}

AutoModerationMentionRaidDetectionEvent is AUTO_MODERATION_MENTION_RAID_DETECTION (web).

type AutoModerationRule

type AutoModerationRule struct {
	ID              string                         `json:"id"`
	GuildID         string                         `json:"guild_id"`
	Name            string                         `json:"name"`
	CreatorID       string                         `json:"creator_id"`
	EventType       AutoModerationRuleEventType    `json:"event_type"`
	Actions         []*AutoModerationAction        `json:"actions"`
	Enabled         bool                           `json:"enabled"`
	ExemptRoles     []string                       `json:"exempt_roles"`
	ExemptChannels  []string                       `json:"exempt_channels"`
	TriggerType     AutoModerationRuleTriggerType  `json:"trigger_type"`
	TriggerMetadata *AutoModerationTriggerMetadata `json:"trigger_metadata,omitempty"`
}

AutoModerationRule is the flattened superset of AutoModerationRuleKeyword, AutoModerationRuleKeywordPreset, AutoModerationRuleOther; fields absent from a variant are omitted.

type AutoModerationRuleEventType

type AutoModerationRuleEventType int

AutoModerationRuleEventType is the Discord auto moderation rule event type enumeration.

const (
	AutoModerationRuleEventTypeMessageSend AutoModerationRuleEventType = 1
)

AutoModerationRuleEventType values.

type AutoModerationRuleParams

type AutoModerationRuleParams struct {
	Name            *string                        `json:"name,omitempty"`
	EventType       *AutoModerationRuleEventType   `json:"event_type,omitempty"`
	TriggerType     *AutoModerationRuleTriggerType `json:"trigger_type,omitempty"`
	TriggerMetadata *AutoModerationTriggerMetadata `json:"trigger_metadata,omitempty"`
	Actions         *[]AutoModerationAction        `json:"actions,omitempty"`
	Enabled         *bool                          `json:"enabled,omitempty"`
	ExemptRoles     *[]string                      `json:"exempt_roles,omitempty"`
	ExemptChannels  *[]string                      `json:"exempt_channels,omitempty"`
	Extra           map[string]interface{}         `json:"-"`
}

AutoModerationRuleParams are the settable auto moderation rule fields, shared by CreateAutoModerationRule and EditAutoModerationRule. Nil pointers are left out of the request.

type AutoModerationRuleTriggerType

type AutoModerationRuleTriggerType int

AutoModerationRuleTriggerType is the Discord auto moderation rule trigger type enumeration.

const (
	AutoModerationRuleTriggerTypeKeyword       AutoModerationRuleTriggerType = 1
	AutoModerationRuleTriggerTypeHarmfulLink   AutoModerationRuleTriggerType = 2
	AutoModerationRuleTriggerTypeSpam          AutoModerationRuleTriggerType = 3
	AutoModerationRuleTriggerTypeKeywordPreset AutoModerationRuleTriggerType = 4
)

AutoModerationRuleTriggerType values.

type AutoModerationTriggerMetadata

type AutoModerationTriggerMetadata struct {
	KeywordFilter                []string                       `json:"keyword_filter,omitempty"`
	RegexPatterns                []string                       `json:"regex_patterns,omitempty"`
	Presets                      []AutoModerationTriggerPresets `json:"presets,omitempty"`
	AllowList                    []string                       `json:"allow_list,omitempty"`
	MentionTotalLimit            int                            `json:"mention_total_limit,omitempty"`
	MentionRaidProtectionEnabled bool                           `json:"mention_raid_protection_enabled,omitempty"`
}

AutoModerationTriggerMetadata is the flattened superset of AutoModerationTriggerMetadataKeyword, AutoModerationTriggerMetadataKeywordPreset, AutoModerationTriggerMetadataMentionLimit; fields absent from a variant are omitted.

type AutoModerationTriggerPresets

type AutoModerationTriggerPresets int

AutoModerationTriggerPresets is the Discord auto moderation trigger presets enumeration.

const (
	AutoModerationTriggerPresetsProfanity     AutoModerationTriggerPresets = 1
	AutoModerationTriggerPresetsSexualContent AutoModerationTriggerPresets = 2
	AutoModerationTriggerPresetsSlurs         AutoModerationTriggerPresets = 3
)

AutoModerationTriggerPresets values.

type AvatarDecorationData

type AvatarDecorationData struct {
	SkuID     string `json:"sku_id"`
	ExpiresAt *int64 `json:"expires_at"`
	Asset     string `json:"asset"`
}

AvatarDecorationData represents avatar decoration metadata

type BanParams

type BanParams struct {
	// DeleteMessageSeconds is how much of the user's message history to
	// delete. Nil sends 86400 (one day), as discord.py-self does; use a
	// pointer to 0 to keep the messages.
	DeleteMessageSeconds *int
}

BanParams are the optional parts of Ban and BulkBan.

type BaseApplication

type BaseApplication struct {
	ID                  string          `json:"id"`
	Name                string          `json:"name"`
	Description         string          `json:"description"`
	Icon                *string         `json:"icon"`
	CoverImage          string          `json:"cover_image,omitempty"`
	Splash              string          `json:"splash,omitempty"`
	Type                *int            `json:"type"`
	PrimarySKUID        string          `json:"primary_sku_id,omitempty"`
	Summary             string          `json:"summary,omitempty"`
	DeeplinkURI         string          `json:"deeplink_uri,omitempty"`
	ThirdPartySKUs      []ThirdPartySKU `json:"third_party_skus,omitempty"`
	Bot                 *User           `json:"bot,omitempty"`
	IsVerified          bool            `json:"is_verified"`
	IsDiscoverable      bool            `json:"is_discoverable"`
	IsMonetized         bool            `json:"is_monetized"`
	StorefrontAvailable bool            `json:"storefront_available"`
}

BaseApplication mirrors the Discord base application object.

type BaseGuild

type BaseGuild struct {
	ID       string   `json:"id"`
	Name     string   `json:"name"`
	Icon     *string  `json:"icon"`
	Features []string `json:"features"`
}

BaseGuild mirrors the Discord base guild object.

type BaseIntegration

type BaseIntegration struct {
	ID            string             `json:"id"`
	Type          IntegrationType    `json:"type"`
	Account       IntegrationAccount `json:"account"`
	Guild         IntegrationGuild   `json:"guild"`
	Name          string             `json:"name"`
	ApplicationID string             `json:"application_id,omitempty"`
	Enabled       bool               `json:"enabled"`
	User          *User              `json:"user,omitempty"`
	Scopes        []string           `json:"scopes,omitempty"`
}

BaseIntegration mirrors the Discord base integration object.

type BasePresenceUpdate

type BasePresenceUpdate struct {
	Status               StatusType      `json:"status"`
	Activities           []*Activity     `json:"activities"`
	HiddenActivities     []*Activity     `json:"hidden_activities,omitempty"`
	ClientStatus         *ClientStatus   `json:"client_status"`
	ProcessedAtTimestamp json.RawMessage `json:"processed_at_timestamp"` // union of primitive types on the wire
}

BasePresenceUpdate is the request body for updating a base presence.

type BaseSKU

type BaseSKU struct {
	ID                             string                     `json:"id"`
	Type                           SKUType                    `json:"type"`
	Premium                        bool                       `json:"premium"`
	PreorderReleaseDate            *string                    `json:"preorder_release_date"`
	PreorderReleasedAt             *time.Time                 `json:"preorder_released_at,omitempty"`
	ProductLine                    *SKUProductLine            `json:"product_line"`
	Name                           json.RawMessage            `json:"name"`                   // string or locale-keyed map of strings
	Summary                        json.RawMessage            `json:"summary,omitempty"`      // string or locale-keyed map of strings
	LegalNotice                    json.RawMessage            `json:"legal_notice,omitempty"` // string or locale-keyed map of strings
	Slug                           string                     `json:"slug"`
	DependentSKUID                 *string                    `json:"dependent_sku_id"`
	ApplicationID                  string                     `json:"application_id"`
	Application                    *PartialApplication        `json:"application,omitempty"`
	Flags                          int                        `json:"flags"`
	AccessType                     SKUAccessLevel             `json:"access_type"`
	Features                       []int                      `json:"features"`
	Locales                        []string                   `json:"locales,omitempty"`
	Genres                         []int                      `json:"genres,omitempty"`
	AvailableRegions               []string                   `json:"available_regions,omitempty"`
	SystemRequirements             map[int]SystemRequirements `json:"system_requirements,omitempty"`
	ReleaseDate                    *string                    `json:"release_date"`
	PreorderApproximateReleaseDate *string                    `json:"preorder_approximate_release_date,omitempty"`
	ExternalPurchaseURL            string                     `json:"external_purchase_url,omitempty"`
	Restricted                     bool                       `json:"restricted,omitempty"`
	Exclusive                      bool                       `json:"exclusive,omitempty"`
	Deleted                        bool                       `json:"deleted,omitempty"`
	ShowAgeGate                    bool                       `json:"show_age_gate"`
	ManifestLabels                 []string                   `json:"manifest_labels"`
}

BaseSKU mirrors the Discord base sku object.

type BaseSticker

type BaseSticker struct {
	ID          string            `json:"id"`
	Name        string            `json:"name"`
	Description string            `json:"description"`
	Tags        string            `json:"tags"`
	FormatType  StickerFormatType `json:"format_type"`
}

BaseSticker mirrors the Discord base sticker object.

type BaseStoreListing

type BaseStoreListing struct {
	ID                   string          `json:"id"`
	Summary              json.RawMessage `json:"summary,omitempty"`     // string or locale-keyed map of strings
	Description          json.RawMessage `json:"description,omitempty"` // string or locale-keyed map of strings
	Tagline              json.RawMessage `json:"tagline,omitempty"`     // string or locale-keyed map of strings
	FlavorText           string          `json:"flavor_text,omitempty"`
	EntitlementBranchID  string          `json:"entitlement_branch_id,omitempty"`
	StaffNotes           *StoreNote      `json:"staff_notes,omitempty"`
	Assets               []StoreAsset    `json:"assets,omitempty"`
	CarouselItems        []CarouselItem  `json:"carousel_items,omitempty"`
	PreviewVideo         *StoreAsset     `json:"preview_video,omitempty"`
	HeaderBackground     *StoreAsset     `json:"header_background,omitempty"`
	HeroBackground       *StoreAsset     `json:"hero_background,omitempty"`
	HeroVideo            *StoreAsset     `json:"hero_video,omitempty"`
	BoxArt               *StoreAsset     `json:"box_art,omitempty"`
	Thumbnail            *StoreAsset     `json:"thumbnail,omitempty"`
	HeaderLogoLightTheme *StoreAsset     `json:"header_logo_light_theme,omitempty"`
	HeaderLogoDarkTheme  *StoreAsset     `json:"header_logo_dark_theme,omitempty"`
	SKU                  PublicSKU       `json:"sku"`
	ChildSKUs            []PublicSKU     `json:"child_skus,omitempty"`
	AlternativeSKUs      []PublicSKU     `json:"alternative_skus,omitempty"`
	PublishedAt          *time.Time      `json:"published_at,omitempty"`
	UnpublishedAt        *time.Time      `json:"unpublished_at,omitempty"`
}

BaseStoreListing mirrors the Discord base store listing object.

type BaseThreadMember

type BaseThreadMember struct {
	UserID   string             `json:"user_id"`
	Member   *Member            `json:"member"`
	Presence BasePresenceUpdate `json:"presence"`
}

BaseThreadMember mirrors the Discord base thread member object.

type BaseVoiceState

type BaseVoiceState struct {
	UserID     string  `json:"user_id"`
	SessionID  string  `json:"session_id"`
	Deaf       bool    `json:"deaf"`
	Mute       bool    `json:"mute"`
	SelfDeaf   bool    `json:"self_deaf"`
	SelfMute   bool    `json:"self_mute"`
	SelfVideo  bool    `json:"self_video"`
	Suppress   bool    `json:"suppress"`
	Member     *Member `json:"member,omitempty"`
	SelfStream bool    `json:"self_stream,omitempty"`
}

BaseVoiceState mirrors the Discord base voice state object.

type BillingAddress

type BillingAddress struct {
	Line1      string `json:"line_1"`
	Line2      string `json:"line_2,omitempty"`
	Name       string `json:"name"`
	PostalCode string `json:"postal_code,omitempty"`
	City       string `json:"city"`
	State      string `json:"state,omitempty"`
	Country    string `json:"country"`
	Email      string `json:"email,omitempty"`
}

BillingAddress mirrors the Discord billing address object.

type BillingAddressToken

type BillingAddressToken struct {
	Token string `json:"token"`
}

BillingAddressToken mirrors the Discord billing address token object.

type BillingPopupBridgeCallbackEvent

type BillingPopupBridgeCallbackEvent struct {
	PaymentSourceType int               `json:"payment_source_type"`
	State             string            `json:"state"`
	Path              string            `json:"path"`
	Query             map[string]string `json:"query"`
}

BillingPopupBridgeCallbackEvent is BILLING_POPUP_BRIDGE_CALLBACK.

type BillingReferralTrialOfferUpdateEvent

type BillingReferralTrialOfferUpdateEvent struct {
	RecipientID      string `json:"recipient_id"`
	UserTrialOfferID string `json:"user_trial_offer_id"`
}

BillingReferralTrialOfferUpdateEvent is BILLING_REFERRAL_TRIAL_OFFER_UPDATE (web).

type BotIntegration

type BotIntegration struct {
	ID                      string                   `json:"id"`
	Type                    IntegrationType          `json:"type"`
	Account                 IntegrationAccount       `json:"account"`
	Guild                   IntegrationGuild         `json:"guild"`
	Name                    string                   `json:"name"`
	ApplicationID           string                   `json:"application_id,omitempty"`
	Enabled                 bool                     `json:"enabled"`
	User                    *User                    `json:"user,omitempty"`
	Scopes                  []string                 `json:"scopes,omitempty"`
	Application             IntegrationApplication   `json:"application"`
	RoleConnectionsMetadata []RoleConnectionMetadata `json:"role_connections_metadata,omitempty"`
}

BotIntegration mirrors the Discord bot integration object.

type BotUser

type BotUser struct {
	ID                    string                `json:"id"`
	Username              string                `json:"username"`
	Discriminator         string                `json:"discriminator"`
	Avatar                *string               `json:"avatar"`
	AvatarDecorationData  *AvatarDecorationData `json:"avatar_decoration_data,omitempty"`
	PublicFlags           int                   `json:"public_flags,omitempty"`
	Bot                   bool                  `json:"bot,omitempty"`
	System                bool                  `json:"system,omitempty"`
	GlobalName            *string               `json:"global_name"`
	PrimaryGuild          *UserPrimaryGuild     `json:"primary_guild,omitempty"`
	DisplayNameStyles     *DisplayNameStyles    `json:"display_name_styles,omitempty"`
	Collectibles          *UserCollectibles     `json:"collectibles,omitempty"`
	ApproximateGuildCount int                   `json:"approximate_guild_count"`
}

BotUser mirrors the Discord bot user object.

type BrowserClient

type BrowserClient struct {
	// contains filtered or unexported fields
}

BrowserClient implements DiscordClient using rod browser automation

func NewBrowserClient

func NewBrowserClient(config Config) *BrowserClient

NewBrowserClient creates a new browser-based Discord client. Unless Config.ClientType is set, it presents as the web client, since its requests come from a real Chrome page.

func (*BrowserClient) API

func (c *BrowserClient) API() *API

API returns the shared REST surface. It can send requests once Initialize has returned.

func (*BrowserClient) AddReaction

func (c *BrowserClient) AddReaction(ctx context.Context, channelID, messageID string, emoji interface{}) error

AddReaction adds a reaction to a message. The emoji parameter can be:

  • A string: Unicode emoji (e.g., "👍") or custom emoji in "name:id" format (e.g., "smile:123456789")
  • An *Emoji object: Custom emoji from GetGuildEmojis()
  • An EmojiReaction object: Emoji from reaction events

Examples:

  • client.AddReaction(ctx, channelID, messageID, "👍")
  • client.AddReaction(ctx, channelID, messageID, "smile:123456789")
  • emojis, _ := client.GetGuildEmojis(ctx, guildID) client.AddReaction(ctx, channelID, messageID, emojis[0])

func (*BrowserClient) BulkSubscribeToGuilds

func (c *BrowserClient) BulkSubscribeToGuilds(subscriptions map[string]GuildSubscribeOptions) error

BulkSubscribeToGuilds subscribes to multiple guilds at once

func (*BrowserClient) ClientProperties

func (c *BrowserClient) ClientProperties() *ClientProperties

ClientProperties returns the client properties this client presents.

func (*BrowserClient) Close

func (c *BrowserClient) Close() error

Close closes the browser client

func (*BrowserClient) ConnectWebSocket

func (c *BrowserClient) ConnectWebSocket(ctx context.Context) error

func (*BrowserClient) DownloadCDN

func (c *BrowserClient) DownloadCDN(ctx context.Context, assetURL string) ([]byte, string, error)

DownloadCDN downloads a resource from a Discord CDN URL and returns bytes and content type

func (*BrowserClient) GetActiveThreads

func (c *BrowserClient) GetActiveThreads(ctx context.Context, guildID string) (*ThreadListResponse, error)

GetActiveThreads returns all active threads in a guild

func (*BrowserClient) GetAllMessages

func (c *BrowserClient) GetAllMessages(ctx context.Context, channelID string, opts *GetAllMessagesOptions) ([]*Message, error)

GetAllMessages fetches all messages from a channel with pagination. It mirrors discord.py-self's history() behavior:

  • When After is set and OldestFirst is nil, messages are returned oldest->newest
  • When Before is set (or neither), messages are returned newest->oldest
  • OldestFirst can be explicitly set to override the default ordering

func (*BrowserClient) GetChannel

func (c *BrowserClient) GetChannel(ctx context.Context, channelID string) (*Channel, error)

GetChannel gets channel information

func (*BrowserClient) GetChannelMessageCount

func (c *BrowserClient) GetChannelMessageCount(ctx context.Context, guildID, channelID string, options *MessageSearchOptions) (int, error)

GetChannelMessageCount returns the total number of messages in a channel. If guildID is empty, it will be resolved from the channel. If options is nil, defaults are used (no query filter).

func (*BrowserClient) GetCurrentUser

func (c *BrowserClient) GetCurrentUser(ctx context.Context) (*User, error)

GetCurrentUser gets the current user info

func (*BrowserClient) GetGuild

func (c *BrowserClient) GetGuild(ctx context.Context, guildID string) (*Guild, error)

GetGuild gets guild information

func (*BrowserClient) GetGuildChannels

func (c *BrowserClient) GetGuildChannels(ctx context.Context, guildID string) ([]*Channel, error)

GetGuildChannels gets all channels in a guild

func (*BrowserClient) GetGuildEmojis

func (c *BrowserClient) GetGuildEmojis(ctx context.Context, guildID string) ([]*Emoji, error)

GetGuildEmojis gets all emojis in a guild

func (*BrowserClient) GetGuildMemberCount

func (c *BrowserClient) GetGuildMemberCount(ctx context.Context, guildID string) (int, error)

GetGuildMemberCount gets the number of members in a guild

func (*BrowserClient) GetGuildMembers

func (c *BrowserClient) GetGuildMembers(ctx context.Context, guildID string, limit int) ([]*GuildMember, error)

GetGuildMembers gets members in a guild

func (*BrowserClient) GetGuilds

func (c *BrowserClient) GetGuilds(ctx context.Context) ([]*Guild, error)

GetGuilds gets user's guilds with pagination support

func (*BrowserClient) GetJoinedPrivateArchivedThreads

func (c *BrowserClient) GetJoinedPrivateArchivedThreads(ctx context.Context, channelID string, opts *ArchivedThreadsOptions) (*ThreadListResponse, error)

GetJoinedPrivateArchivedThreads returns archived private threads the user has joined

func (*BrowserClient) GetLatestAttachmentData

func (c *BrowserClient) GetLatestAttachmentData(ctx context.Context, channelID string) ([]byte, string, string, error)

GetLatestAttachmentData downloads the latest attachment's raw data, returning bytes, filename, and content type

func (*BrowserClient) GetLatestAttachmentURL

func (c *BrowserClient) GetLatestAttachmentURL(ctx context.Context, channelID string) (string, error)

GetLatestAttachmentURL returns the CDN URL of the most recent attachment in a channel

func (*BrowserClient) GetMessage

func (c *BrowserClient) GetMessage(ctx context.Context, channelID, messageID string) (*Message, error)

GetMessage fetches a single message by ID from a channel

func (*BrowserClient) GetMessageThread

func (c *BrowserClient) GetMessageThread(ctx context.Context, channelID, messageID string) (*Thread, error)

GetMessageThread fetches the thread attached to a message (if any). Returns the thread if found, nil if no thread exists, or an error.

func (*BrowserClient) GetMessages

func (c *BrowserClient) GetMessages(ctx context.Context, channelID string, opts *GetMessagesOptions) ([]*Message, error)

GetMessages gets messages from a channel

func (*BrowserClient) GetPrivateArchivedThreads

func (c *BrowserClient) GetPrivateArchivedThreads(ctx context.Context, channelID string, opts *ArchivedThreadsOptions) (*ThreadListResponse, error)

GetPrivateArchivedThreads returns archived private threads in a channel

func (*BrowserClient) GetPublicArchivedThreads

func (c *BrowserClient) GetPublicArchivedThreads(ctx context.Context, channelID string, opts *ArchivedThreadsOptions) (*ThreadListResponse, error)

GetPublicArchivedThreads returns archived public threads in a channel

func (*BrowserClient) GetWebSocket

func (c *BrowserClient) GetWebSocket() *DiscordWebSocket

ConnectWebSocket establishes a WebSocket connection to Discord's Gateway GetWebSocket returns nil for BrowserClient as WebSocket is not supported in browser mode.

func (*BrowserClient) GuildName

func (c *BrowserClient) GuildName(guildID string) string

GuildName returns the guild ID as-is since browser mode does not cache guild names.

func (*BrowserClient) Initialize

func (c *BrowserClient) Initialize(ctx context.Context) error

Initialize initializes the browser client

func (*BrowserClient) JoinGuild

func (c *BrowserClient) JoinGuild(ctx context.Context, inviteCode string) error

JoinGuild joins a guild using an invite code

func (*BrowserClient) ListenForEvents

func (c *BrowserClient) ListenForEvents(ctx context.Context, eventHandler EventHandler) error

ListenForEvents starts listening for WebSocket events

func (*BrowserClient) SearchMessages

func (c *BrowserClient) SearchMessages(ctx context.Context, guildID, channelID string, options *MessageSearchOptions) (*MessageSearchResponse, error)

SearchMessages searches messages in a channel within a guild. If guildID is empty, it will be resolved from the channel.

func (*BrowserClient) SendMessage

func (c *BrowserClient) SendMessage(ctx context.Context, channelID string, content string) (*Message, error)

SendMessage sends a message to a channel

func (*BrowserClient) SetGuildName

func (c *BrowserClient) SetGuildName(guildID, name string)

SetGuildName is a no-op in browser mode.

func (*BrowserClient) SubscribeToAllGuildFeatures

func (c *BrowserClient) SubscribeToAllGuildFeatures(guildID string) error

SubscribeToAllGuildFeatures subscribes to all available features for a guild

func (*BrowserClient) SubscribeToGuild

func (c *BrowserClient) SubscribeToGuild(guildID string, options GuildSubscribeOptions) error

SubscribeToGuild subscribes to a single guild with specified features

func (*BrowserClient) SubscribeToGuildChannels

func (c *BrowserClient) SubscribeToGuildChannels(guildID string, channels map[string][][]int) error

SubscribeToGuildChannels subscribes to specific channels with message ranges

func (*BrowserClient) SubscribeToGuildMembers

func (c *BrowserClient) SubscribeToGuildMembers(guildID string, memberIDs []string) error

SubscribeToGuildMembers subscribes to specific members in a guild

func (*BrowserClient) SubscribeToGuildThreads

func (c *BrowserClient) SubscribeToGuildThreads(guildID string, threadIDs []string) error

SubscribeToGuildThreads subscribes to threads in a guild

func (*BrowserClient) UnsubscribeFromGuild

func (c *BrowserClient) UnsubscribeFromGuild(guildID string) error

UnsubscribeFromGuild unsubscribes from a guild by setting all features to false

func (*BrowserClient) UpdateStatus

func (c *BrowserClient) UpdateStatus(ctx context.Context, status string, game *Game, afk bool, since int64) error

UpdateStatus updates the user's status

type BuildUploadFile

type BuildUploadFile struct {
	ID      string
	MD5Hash string // base64(md5(content)); optional
}

BuildUploadFile describes one file of a build to upload: a caller-chosen ID (discord.py-self uses 32 random upper-case alphanumerics) and the optional base64 MD5 of its content.

type BulkBanUserResponse

type BulkBanUserResponse struct {
	BannedUsers []string `json:"banned_users"`
	FailedUsers []string `json:"failed_users"`
}

BulkBanUserResponse mirrors the Discord bulk ban user response object.

type BulkGuildSubscribePayload

type BulkGuildSubscribePayload map[string]GuildSubscribePayload

BulkGuildSubscribePayload represents a bulk guild subscription payload

type BulkReadState

type BulkReadState struct {
	ChannelID     string        `json:"channel_id"`
	MessageID     string        `json:"message_id"`
	ReadStateType ReadStateType `json:"read_state_type"`
}

BulkReadState mirrors the Discord bulk read state object.

type ButtonComponent

type ButtonComponent struct {
	Type     ComponentType `json:"type"`
	ID       int           `json:"id,omitempty"`
	Style    ButtonStyle   `json:"style"`
	CustomID string        `json:"custom_id,omitempty"`
	URL      string        `json:"url,omitempty"`
	Disabled bool          `json:"disabled,omitempty"`
	Emoji    *Emoji        `json:"emoji,omitempty"`
	Label    string        `json:"label,omitempty"`
	SKUID    string        `json:"sku_id,omitempty"`
}

ButtonComponent mirrors the Discord button component object.

type ButtonInteractionData

type ButtonInteractionData struct {
	CustomID      string        `json:"custom_id"`
	ComponentType ComponentType `json:"component_type"` // always 2
}

ButtonInteractionData mirrors the Discord button interaction data object.

type ButtonStyle

type ButtonStyle int

ButtonStyle is the Discord button style enumeration.

const (
	ButtonStylePrimary   ButtonStyle = 1
	ButtonStyleSecondary ButtonStyle = 2
	ButtonStyleSuccess   ButtonStyle = 3
	ButtonStyleDanger    ButtonStyle = 4
	ButtonStyleLink      ButtonStyle = 5
	ButtonStylePremium   ButtonStyle = 6
)

ButtonStyle values.

type CallCreateEvent

type CallCreateEvent struct {
	ChannelID          string            `json:"channel_id"`
	MessageID          string            `json:"message_id"`
	Region             string            `json:"region"`
	Ringing            []string          `json:"ringing,omitempty"`       // discord.py-self
	OngoingRings       []string          `json:"ongoing_rings,omitempty"` // web
	VoiceStates        []VoiceState      `json:"voice_states"`
	EmbeddedActivities []json.RawMessage `json:"embedded_activities,omitempty"`
	Unavailable        bool              `json:"unavailable,omitempty"`
}

CallCreateEvent is CALL_CREATE.

type CallDeleteEvent

type CallDeleteEvent struct {
	ChannelID   string `json:"channel_id"`
	Unavailable bool   `json:"unavailable,omitempty"`
}

CallDeleteEvent is CALL_DELETE.

type CallEligibility

type CallEligibility struct {
	Ringable bool `json:"ringable"`
}

CallEligibility mirrors the Discord call eligibility object.

type CallEvent

type CallEvent struct {
	ChannelID          string             `json:"channel_id"`
	MessageID          string             `json:"message_id,omitempty"`
	Region             string             `json:"region,omitempty"`
	Ringing            []string           `json:"ringing,omitempty"`
	EmbeddedActivities []EmbeddedActivity `json:"embedded_activities,omitempty"`
}

CallEvent represents call-related events

type CallUpdateEvent

type CallUpdateEvent struct {
	ChannelID    string   `json:"channel_id"`
	GuildID      *string  `json:"guild_id,omitempty"`
	MessageID    string   `json:"message_id"`
	Region       string   `json:"region"`
	Ringing      []string `json:"ringing,omitempty"`
	OngoingRings []string `json:"ongoing_rings,omitempty"`
}

CallUpdateEvent is CALL_UPDATE.

type Capabilities

type Capabilities int

Capabilities is the IDENTIFY capabilities bit field. It changes the shape of READY and of several dispatch events.

const (
	CapabilityLazyUserNotes                     Capabilities = 1 << 0  // no user notes in READY
	CapabilityNoAffineUserIDs                   Capabilities = 1 << 1  // no implicit relationship updates
	CapabilityVersionedReadStates               Capabilities = 1 << 2  // READY read_state is {entries, version, partial}
	CapabilityVersionedUserGuildSettings        Capabilities = 1 << 3  // READY user_guild_settings is {entries, version, partial}
	CapabilityDedupeUserObjects                 Capabilities = 1 << 4  // users moved to READY.users, members to merged_members
	CapabilityPrioritizedReadyPayload           Capabilities = 1 << 5  // READY_SUPPLEMENTAL; requires bit 4
	CapabilityMultipleGuildExperimentPopulation Capabilities = 1 << 6  // guild_experiments populations are arrays
	CapabilityNonChannelReadStates              Capabilities = 1 << 7  // read states for non-channel entities
	CapabilityAuthTokenRefresh                  Capabilities = 1 << 8  // READY may carry auth_token
	CapabilityUserSettingsProto                 Capabilities = 1 << 9  // no legacy user_settings / USER_SETTINGS_UPDATE
	CapabilityClientStateV2                     Capabilities = 1 << 10 // guild properties under "properties", data_mode, version
	CapabilityPassiveGuildUpdate                Capabilities = 1 << 11 // PASSIVE_UPDATE_V1 instead of CHANNEL_UNREADS_UPDATE
	CapabilityAutoCallConnect                   Capabilities = 1 << 12 // connect to existing calls on connect
	CapabilityDebounceMessageReactions          Capabilities = 1 << 13 // MESSAGE_REACTION_ADD_MANY
	CapabilityPassiveGuildUpdateV2              Capabilities = 1 << 14 // PASSIVE_UPDATE_V2 instead of V1

	// Bits the web client sets that no reference names. Their effect on the
	// READY payload is unknown and untested.
	CapabilityUnnamedBit15 Capabilities = 1 << 15 // only with private channel obfuscation
	CapabilityUnnamedBit17 Capabilities = 1 << 17
	CapabilityUnnamedBit19 Capabilities = 1 << 19
	CapabilityUnnamedBit20 Capabilities = 1 << 20
)

Named capability bits, with the names discord.py-self gives them (flags.py). The web client sends the value as a bare integer and names no bit.

func (Capabilities) Has

func (c Capabilities) Has(f Capabilities) bool

Has reports whether every bit of f is set in c.

type CaptchaRequired

type CaptchaRequired struct {
	CaptchaKey           []string       `json:"captcha_key"`
	CaptchaService       CaptchaService `json:"captcha_service,omitempty"`
	CaptchaSitekey       *string        `json:"captcha_sitekey"`
	CaptchaSessionID     string         `json:"captcha_session_id,omitempty"`
	CaptchaRqdata        string         `json:"captcha_rqdata,omitempty"`
	CaptchaRqtoken       string         `json:"captcha_rqtoken,omitempty"`
	ShouldServeInvisible bool           `json:"should_serve_invisible,omitempty"`
}

CaptchaRequired mirrors the Discord captcha required object.

type CaptchaService

type CaptchaService string

CaptchaService is the Discord captcha service enumeration.

const (
	CaptchaServiceHCaptcha            CaptchaService = "hcaptcha"
	CaptchaServiceReCaptcha           CaptchaService = "recaptcha"
	CaptchaServiceReCaptchaEnterprise CaptchaService = "recaptcha_enterprise"
)

CaptchaService values.

type CarouselItem

type CarouselItem struct {
	AssetID        string `json:"asset_id,omitempty"`
	YoutubeVideoID string `json:"youtube_video_id,omitempty"`
}

CarouselItem mirrors the Discord carousel item object.

type CategoryChannel

type CategoryChannel struct {
	ID                   string                 `json:"id"`
	GuildID              string                 `json:"guild_id"`
	Position             int                    `json:"position"`
	PermissionOverwrites []*PermissionOverwrite `json:"permission_overwrites"`
	ParentID             *string                `json:"parent_id"`
	Name                 string                 `json:"name"`
	Flags                int                    `json:"flags"`
	Type                 ChannelType            `json:"type"` // always 4
}

CategoryChannel mirrors the Discord category channel object.

type Channel

type Channel struct {
	ID                     string                `json:"id"`
	Type                   int                   `json:"type"`
	GuildID                string                `json:"guild_id"`
	Name                   string                `json:"name"`
	Topic                  string                `json:"topic"`
	Position               int                   `json:"position"`
	ParentID               string                `json:"parent_id"`
	Recipients             []User                `json:"recipients,omitempty"`
	NSFW                   bool                  `json:"nsfw,omitempty"`
	Bitrate                int                   `json:"bitrate,omitempty"`
	UserLimit              int                   `json:"user_limit,omitempty"`
	RateLimitPerUser       int                   `json:"rate_limit_per_user,omitempty"`
	LastMessageID          *string               `json:"last_message_id,omitempty"`
	Flags                  int                   `json:"flags,omitempty"`
	PermissionOverwrites   []PermissionOverwrite `json:"permission_overwrites,omitempty"`
	Version                int64                 `json:"version,omitempty"`
	IconEmoji              interface{}           `json:"icon_emoji,omitempty"`
	ThemeColor             interface{}           `json:"theme_color,omitempty"`
	Status                 interface{}           `json:"status,omitempty"`
	RTCRegion              *string               `json:"rtc_region,omitempty"`
	VoiceBackgroundDisplay interface{}           `json:"voice_background_display,omitempty"`

	// Further wire fields (all optional on the wire).
	ApplicationID                 string            `json:"application_id,omitempty"`
	AppliedTags                   []string          `json:"applied_tags,omitempty"`
	AvailableTags                 []ForumTag        `json:"available_tags,omitempty"`
	DefaultAutoArchiveDuration    int               `json:"default_auto_archive_duration,omitempty"`
	DefaultForumLayout            ForumLayoutType   `json:"default_forum_layout,omitempty"`
	DefaultReactionEmoji          *DefaultReaction  `json:"default_reaction_emoji,omitempty"`
	DefaultSortOrder              *ForumOrderType   `json:"default_sort_order,omitempty"`
	DefaultThreadRateLimitPerUser int               `json:"default_thread_rate_limit_per_user,omitempty"`
	Icon                          *string           `json:"icon,omitempty"` // group DM icon hash
	IsMessageRequest              bool              `json:"is_message_request,omitempty"`
	IsMessageRequestTimestamp     *time.Time        `json:"is_message_request_timestamp,omitempty"`
	IsSpam                        bool              `json:"is_spam,omitempty"`
	LastPinTimestamp              *time.Time        `json:"last_pin_timestamp,omitempty"`
	Managed                       bool              `json:"managed,omitempty"` // group DM created by an application
	Member                        *ThreadMember     `json:"member,omitempty"`  // threads: the current user's membership
	MemberCount                   int               `json:"member_count,omitempty"`
	MessageCount                  int               `json:"message_count,omitempty"`
	Nicks                         []GroupDMNickname `json:"nicks,omitempty"`
	OriginChannelID               string            `json:"origin_channel_id,omitempty"`
	OwnerID                       string            `json:"owner_id,omitempty"`
	ThreadMetadata                *ThreadMetadata   `json:"thread_metadata,omitempty"`
	TotalMessageSent              int               `json:"total_message_sent,omitempty"`
	VideoQualityMode              VideoQualityMode  `json:"video_quality_mode,omitempty"`
}

Channel represents a Discord channel

type ChannelAffinities

type ChannelAffinities struct {
	ChannelAffinities []ChannelAffinity `json:"channel_affinities"`
}

ChannelAffinities mirrors the Discord channel affinities object.

type ChannelAffinity

type ChannelAffinity struct {
	ChannelID string  `json:"channel_id"`
	Affinity  float64 `json:"affinity"`
}

ChannelAffinity mirrors the Discord channel affinity object.

type ChannelConversations

type ChannelConversations struct {
	Conversations []json.RawMessage `json:"conversations"`
}

ChannelConversations is the response of GetChannelConversations. Each conversation is returned raw: its shape is not modelled.

type ChannelConversationsParams

type ChannelConversationsParams struct {
	Limit                 int
	Before, After, Around string // conversation IDs (cursor)
	IncludeMessages       bool
	MessageLimit          *int
}

ChannelConversationsParams are the optional parameters of GetChannelConversations.

type ChannelInfoEntry

type ChannelInfoEntry struct {
	ID             string          `json:"id"`
	Status         *string         `json:"status,omitempty"`
	VoiceStartTime json.RawMessage `json:"voice_start_time,omitempty"`
}

ChannelInfoEntry is one channel of CHANNEL_INFO.

type ChannelInfoEvent

type ChannelInfoEvent struct {
	GuildID  string             `json:"guild_id"`
	Channels []ChannelInfoEntry `json:"channels"`
}

ChannelInfoEvent is CHANNEL_INFO, the answer to op 43 REQUEST_CHANNEL_INFO (web).

type ChannelMemberCountUpdateEvent

type ChannelMemberCountUpdateEvent struct {
	GuildID       string `json:"guild_id"`
	ChannelID     string `json:"channel_id"`
	MemberCount   *int   `json:"member_count"`
	PresenceCount *int   `json:"presence_count"`
}

ChannelMemberCountUpdateEvent is CHANNEL_MEMBER_COUNT_UPDATE, the answer to op 39 REQUEST_CHANNEL_MEMBER_COUNT (web).

type ChannelMention

type ChannelMention struct {
	ID      string      `json:"id"`
	GuildID string      `json:"guild_id"`
	Type    ChannelType `json:"type"`
	Name    string      `json:"name"`
}

ChannelMention mirrors the Discord channel mention object.

type ChannelOverride

type ChannelOverride struct {
	ChannelID            string                   `json:"channel_id"`
	Collapsed            bool                     `json:"collapsed"`
	MessageNotifications MessageNotificationLevel `json:"message_notifications"`
	Muted                bool                     `json:"muted"`
	MuteConfig           *MuteConfig              `json:"mute_config"`
}

ChannelOverride mirrors the Discord channel override object.

type ChannelOverrideParams

type ChannelOverrideParams struct {
	Collapsed            *bool                     `json:"collapsed,omitempty"`
	Muted                *bool                     `json:"muted,omitempty"`
	MuteConfig           NullableField[MuteConfig] `json:"mute_config,omitzero"`
	MessageNotifications *MessageNotificationLevel `json:"message_notifications,omitempty"`
}

ChannelOverrideParams is one channel entry of EditGuildSettingsParams.ChannelOverrides.

type ChannelPins

type ChannelPins struct {
	Items   []MessagePin `json:"items"`
	HasMore bool         `json:"has_more"`
}

ChannelPins mirrors the Discord channel pins object.

type ChannelPinsAckEvent

type ChannelPinsAckEvent struct {
	ChannelID string `json:"channel_id"`
	Timestamp string `json:"timestamp"`
	Version   int    `json:"version"`
}

ChannelPinsAckEvent represents channel pins acknowledgment

type ChannelPinsUpdateEvent

type ChannelPinsUpdateEvent struct {
	ChannelID        string  `json:"channel_id"`
	GuildID          string  `json:"guild_id,omitempty"`
	LastPinTimestamp *string `json:"last_pin_timestamp,omitempty"`
}

ChannelPinsUpdateEvent is CHANNEL_PINS_UPDATE.

type ChannelPositionUpdate

type ChannelPositionUpdate struct {
	ID              string  `json:"id"`
	Position        *int    `json:"position"`
	LockPermissions *bool   `json:"lock_permissions,omitempty"`
	ParentID        *string `json:"parent_id,omitempty"`
}

ChannelPositionUpdate is the request body for updating a channel position.

type ChannelRecipientEvent

type ChannelRecipientEvent struct {
	ChannelID string  `json:"channel_id"`
	User      User    `json:"user"`
	Nick      *string `json:"nick,omitempty"`
}

ChannelRecipientEvent is CHANNEL_RECIPIENT_ADD/REMOVE.

type ChannelSearchParams

type ChannelSearchParams struct {
	Limit  int // results per page (the client uses 25)
	Offset int

	MinID string // only messages after this snowflake
	MaxID string // only messages before this snowflake

	IncludeNSFW *bool
	Content     string
	Contents    []string
	Slop        int

	ChannelIDs  []string
	AuthorIDs   []string
	AuthorTypes []MessageSearchAuthorType
	Mentions    []string

	MentionEveryone *bool
	Pinned          *bool

	Has                  []MessageSearchHasType
	EmbedTypes           []EmbedType
	EmbedProviders       []string
	LinkHostnames        []string
	AttachmentFilenames  []string
	AttachmentExtensions []string

	CommandID   string
	CommandName string

	SortBy    MessageSearchSortType  // "timestamp" or "relevance"
	SortOrder MessageSearchSortOrder // "asc" or "desc"
}

ChannelSearchParams are the filters of SearchChannel (and the same keys the guild search takes). Zero values are left out. List fields are sent as repeated query keys.

func (*ChannelSearchParams) Values

func (p *ChannelSearchParams) Values() url.Values

Values converts the search parameters to a query string.

type ChannelSelectComponent

type ChannelSelectComponent struct {
	Type          ComponentType         `json:"type"`
	ID            int                   `json:"id,omitempty"`
	CustomID      string                `json:"custom_id"`
	Placeholder   string                `json:"placeholder,omitempty"`
	MinValues     int                   `json:"min_values,omitempty"`
	MaxValues     int                   `json:"max_values,omitempty"`
	Disabled      bool                  `json:"disabled,omitempty"`
	ChannelTypes  []ChannelType         `json:"channel_types,omitempty"`
	DefaultValues []SelectDefaultValues `json:"default_values,omitempty"`
}

ChannelSelectComponent mirrors the Discord channel select component object.

type ChannelSyncEvent

type ChannelSyncEvent struct {
	GuildID        string    `json:"guild_id"`
	Channels       []Channel `json:"channels"`
	IntegrityCheck bool      `json:"integrity_check,omitempty"`
}

ChannelSyncEvent is CHANNEL_SYNC, the answer to op 38 GUILD_CHANNELS_RESYNC (web).

type ChannelType

type ChannelType int

ChannelType is the Discord channel type enumeration.

const (
	ChannelTypeText          ChannelType = 0
	ChannelTypePrivate       ChannelType = 1
	ChannelTypeVoice         ChannelType = 2
	ChannelTypeGroup         ChannelType = 3
	ChannelTypeCategory      ChannelType = 4
	ChannelTypeNews          ChannelType = 5
	ChannelTypeStore         ChannelType = 6
	ChannelTypeStageVoice    ChannelType = 13
	ChannelTypeDirectory     ChannelType = 14
	ChannelTypeForum         ChannelType = 15
	ChannelTypeMedia         ChannelType = 16
	ChannelTypeNewsThread    ChannelType = 10
	ChannelTypePublicThread  ChannelType = 11
	ChannelTypePrivateThread ChannelType = 12
)

ChannelType values.

type ChannelTypeWithoutThread

type ChannelTypeWithoutThread int

ChannelTypeWithoutThread is the Discord channel type without thread enumeration. Values: 0, 1, 2, 3, 4, 5, 6, 13, 14, 15, 16.

type ChatInputCommandInteractionData

type ChatInputCommandInteractionData struct {
	ID                 string                                    `json:"id"`
	Name               string                                    `json:"name"`
	Version            string                                    `json:"version"`
	GuildID            string                                    `json:"guild_id,omitempty"`
	ApplicationCommand ApplicationCommand                        `json:"application_command"`
	Attachments        []PartialAttachment                       `json:"attachments"`
	Options            []ApplicationCommandInteractionDataOption `json:"options"`
	Type               ApplicationCommandType                    `json:"type,omitempty"` // always 1
}

ChatInputCommandInteractionData mirrors the Discord chat input command interaction data object.

type CheckboxComponent

type CheckboxComponent struct {
	Type     ComponentType `json:"type"`
	ID       int           `json:"id,omitempty"`
	CustomID string        `json:"custom_id"`
	Default  bool          `json:"default,omitempty"`
}

CheckboxComponent mirrors the Discord checkbox component object.

type CheckboxGroupComponent

type CheckboxGroupComponent struct {
	Type      ComponentType `json:"type"`
	ID        int           `json:"id,omitempty"`
	CustomID  string        `json:"custom_id"`
	Options   []OptionBase  `json:"options,omitempty"`
	MaxValues int           `json:"max_values,omitempty"`
	MinValues int           `json:"min_values,omitempty"`
	Required  bool          `json:"required,omitempty"`
}

CheckboxGroupComponent mirrors the Discord checkbox group component object.

type CheckoutRecovery

type CheckoutRecovery struct {
	IsEligible bool `json:"is_eligible"`
}

CheckoutRecovery mirrors the Discord checkout recovery object.

type ClaimedPromotion

type ClaimedPromotion struct {
	Promotion Promotion `json:"promotion"`
	Code      string    `json:"code"`
	ClaimedAt time.Time `json:"claimed_at"`
}

ClaimedPromotion mirrors the Discord claimed promotion object.

type ClientInfo

type ClientInfo struct {
	Version int    `json:"version"`
	OS      string `json:"os"`
	Client  string `json:"client"`
}

ClientInfo represents client information in sessions

type ClientProperties

type ClientProperties struct {
	Type            ClientType // web, windows, mac or linux
	Source          string     // where the values came from (PropertiesSource*)
	BuildNumber     int        // client_build_number
	BuildHash       string     // web build hash, if known
	ReleaseChannel  string     // "stable"
	ClientVersion   string     // desktop app version (client_version); empty for web
	ElectronVersion string     // desktop only
	ChromeVersion   string     // Chrome version in the user agent
	UserAgent       string     // browser_user_agent and the HTTP User-Agent

	OS        string // "Windows", "Mac OS X", "Linux"
	OSVersion string // "10" for web, os.release() for desktop
	OSArch    string // desktop only
	AppArch   string // desktop only

	// Per-launch identifiers, generated once per resolution (i.e. per client).
	LaunchID           string // client_launch_id
	HeartbeatSessionID string // client_heartbeat_session_id
	LaunchSignature    string // launch_signature
}

ClientProperties are the resolved client fingerprint values: the build number, versions and user agent used for X-Super-Properties, the REST headers and the gateway IDENTIFY. A value is immutable once resolved.

func (*ClientProperties) ChromeMajor

func (p *ClientProperties) ChromeMajor() int

ChromeMajor returns the major version of ChromeVersion, or 0.

func (*ClientProperties) IsDesktop

func (p *ClientProperties) IsDesktop() bool

IsDesktop reports whether the properties describe an Electron desktop client.

func (*ClientProperties) SuperProperties

func (p *ClientProperties) SuperProperties(locale string) *SuperProperties

SuperProperties builds the X-Super-Properties / IDENTIFY properties for these client properties with the given system locale.

type ClientStatePayload

type ClientStatePayload struct {
	GuildVersions            map[string]int `json:"guild_versions"`
	HighestLastMessageID     string         `json:"highest_last_message_id"`
	ReadStateVersion         int            `json:"read_state_version"`
	UserGuildSettingsVersion int            `json:"user_guild_settings_version"`
	UserSettingsVersion      int            `json:"user_settings_version"`
	PrivateChannelsVersion   string         `json:"private_channels_version"`
	APICodeVersion           int            `json:"api_code_version"`
	InitialGuildID           string         `json:"initial_guild_id,omitempty"`
}

ClientStatePayload is IDENTIFY client_state. With only GuildVersions set it marshals as {"guild_versions":{...}}, what both reference clients send without a local cache.

func (ClientStatePayload) MarshalJSON

func (c ClientStatePayload) MarshalJSON() ([]byte, error)

MarshalJSON emits {"guild_versions":{...}} alone when no other field is set, which is what both reference clients send without a local cache; otherwise it emits the full web-client client_state.

type ClientStatus

type ClientStatus struct {
	Desktop  string `json:"desktop,omitempty"`
	Mobile   string `json:"mobile,omitempty"`
	Web      string `json:"web,omitempty"`
	Embedded string `json:"embedded,omitempty"`
}

ClientStatus represents the client status across platforms

type ClientType

type ClientType string

ClientType selects which official Discord client the library presents as. The zero value presents as the Windows desktop client.

const (
	ClientTypeWindows ClientType = "windows" // Windows desktop (Electron) client; the default
	ClientTypeMac     ClientType = "mac"     // macOS desktop (Electron) client
	ClientTypeLinux   ClientType = "linux"   // Linux desktop (Electron) client
	ClientTypeWeb     ClientType = "web"     // web client in Chrome on Windows
)

type ClipsRemoteTriggerEvent

type ClipsRemoteTriggerEvent struct {
	ApplicationID string `json:"application_id"`
	PartyID       string `json:"party_id"`
	RemoteClipID  string `json:"remote_clip_id"`
	UserID        string `json:"user_id"`
}

ClipsRemoteTriggerEvent is CLIPS_REMOTE_TRIGGER (web).

type ClipsRemoteTriggerResponse

type ClipsRemoteTriggerResponse struct {
	RemoteClipID string `json:"remote_clip_id"`
}

ClipsRemoteTriggerResponse is the response of SendClipsRemoteTrigger.

type CloudAttachment

type CloudAttachment struct {
	ID             string `json:"id,omitempty"`
	UploadURL      string `json:"upload_url"`
	UploadFilename string `json:"upload_filename"`
}

CloudAttachment mirrors the Discord cloud attachment object.

type CloudAttachments

type CloudAttachments struct {
	Attachments []CloudAttachment `json:"attachments"`
}

CloudAttachments mirrors the Discord cloud attachments object.

type CommandApplication

type CommandApplication struct {
	ID                     string                              `json:"id"`
	Name                   string                              `json:"name"`
	Description            string                              `json:"description"`
	Icon                   *string                             `json:"icon"`
	Permissions            *ApplicationCommandIndexPermissions `json:"permissions,omitempty"`
	Bot                    *User                               `json:"bot,omitempty"`
	BotID                  string                              `json:"bot_id,omitempty"`
	Flags                  string                              `json:"flags"`
	EmbeddedActivityConfig *EmbeddedActivityConfig             `json:"embedded_activity_config,omitempty"`
}

CommandApplication mirrors the Discord command application object.

type CommandScopeMigration

type CommandScopeMigration struct {
	IntegrationIDsWithAppCommands []string `json:"integration_ids_with_app_commands"`
}

CommandScopeMigration mirrors the Discord command scope migration object.

type Component

type Component struct {
	Type          ComponentType         `json:"type"`
	ID            int                   `json:"id,omitempty"`
	Components    []Component           `json:"components,omitempty"`
	Style         int                   `json:"style,omitempty"` // ButtonStyle for buttons, TextStyle for text inputs
	CustomID      string                `json:"custom_id,omitempty"`
	URL           string                `json:"url,omitempty"`
	Disabled      bool                  `json:"disabled,omitempty"`
	Emoji         *Emoji                `json:"emoji,omitempty"`
	Label         *string               `json:"label,omitempty"`
	SKUID         string                `json:"sku_id,omitempty"`
	Placeholder   string                `json:"placeholder,omitempty"`
	MinValues     int                   `json:"min_values,omitempty"`
	MaxValues     int                   `json:"max_values,omitempty"`
	Required      bool                  `json:"required,omitempty"`
	Options       []SelectOption        `json:"options,omitempty"`
	ChannelTypes  []ChannelType         `json:"channel_types,omitempty"`
	DefaultValues []SelectDefaultValues `json:"default_values,omitempty"`
	Value         string                `json:"value,omitempty"`
	MinLength     int                   `json:"min_length,omitempty"`
	MaxLength     int                   `json:"max_length,omitempty"`
	Default       bool                  `json:"default,omitempty"`
	Description   *string               `json:"description,omitempty"`
	Component     *Component            `json:"component,omitempty"`
	Content       string                `json:"content,omitempty"`
	Items         []MediaGalleryItem    `json:"items,omitempty"`
	File          *UnfurledMediaItem    `json:"file,omitempty"`
	Spoiler       bool                  `json:"spoiler,omitempty"`
	Name          string                `json:"name,omitempty"`
	Size          int                   `json:"size,omitempty"`
	Accessory     *Component            `json:"accessory,omitempty"`
	Divider       bool                  `json:"divider,omitempty"`
	Spacing       SeparatorSpacing      `json:"spacing,omitempty"`
	Media         *UnfurledMediaItem    `json:"media,omitempty"`
	AccentColor   int                   `json:"accent_color,omitempty"`
}

Component is the flattened superset of the 16 component variants; fields absent from a variant are omitted.

type ComponentBase

type ComponentBase struct {
	Type ComponentType `json:"type"`
	ID   int           `json:"id,omitempty"`
}

ComponentBase mirrors the Discord component base object.

type ComponentInteractionData

type ComponentInteractionData struct {
	CustomID      string                     `json:"custom_id,omitempty"`
	ComponentType ComponentType              `json:"component_type,omitempty"`
	Values        []string                   `json:"values,omitempty"`
	Resolved      *ResolvedData              `json:"resolved,omitempty"`
	Type          ComponentType              `json:"type,omitempty"`
	ID            int                        `json:"id,omitempty"`
	Components    []ComponentInteractionData `json:"components,omitempty"`
	Content       string                     `json:"content,omitempty"`
	Component     *ComponentInteractionData  `json:"component,omitempty"`
}

ComponentInteractionData is the flattened superset of the 5 component interaction data variants; fields absent from a variant are omitted.

type ComponentType

type ComponentType int

ComponentType is the Discord component type enumeration.

const (
	ComponentTypeActionRow         ComponentType = 1
	ComponentTypeButton            ComponentType = 2
	ComponentTypeSelect            ComponentType = 3
	ComponentTypeTextInput         ComponentType = 4
	ComponentTypeUserSelect        ComponentType = 5
	ComponentTypeRoleSelect        ComponentType = 6
	ComponentTypeMentionableSelect ComponentType = 7
	ComponentTypeChannelSelect     ComponentType = 8
	ComponentTypeSection           ComponentType = 9
	ComponentTypeTextDisplay       ComponentType = 10
	ComponentTypeThumbnail         ComponentType = 11
	ComponentTypeMediaGallery      ComponentType = 12
	ComponentTypeFile              ComponentType = 13
	ComponentTypeSeparator         ComponentType = 14
	ComponentTypeContainer         ComponentType = 17
	ComponentTypeLabel             ComponentType = 18
	ComponentTypeFileUpload        ComponentType = 19
	ComponentTypeRadioGroup        ComponentType = 21
	ComponentTypeCheckboxGroup     ComponentType = 22
	ComponentTypeCheckbox          ComponentType = 23
)

ComponentType values.

type Config

type Config struct {
	Token       string        // Discord user token
	Username    string        // Discord username/email for login
	Password    string        // Discord password for login
	Mode        Mode          // Client mode (Browser or TLS)
	UserAgent   string        // Explicit user agent override; empty = decided by the resolved client properties
	Timeout     time.Duration // Request timeout
	ProxyURL    string        // Proxy URL (optional)
	Debug       bool          // Enable debug logging
	RateLimited bool          // Enable rate limiting
	Locale      string        // Discord locale (default "en-US")
	Timezone    string        // Discord timezone (default "Europe/Paris")

	// Browser-specific configuration
	RemoteURL      string        // Remote browser URL (WebSocket or direct)
	ChromePath     string        // Path to Chrome/Chromium binary
	UseHeadless    *bool         // Use headless mode (nil = auto-detect from env)
	BrowserTimeout time.Duration // Browser operation timeout
	DisableImages  bool          // Disable image loading for better performance

	// Client properties (fingerprint). All optional; the zero values present
	// as the Windows desktop client with properties fetched from cordapi.
	ClientType        ClientType // Client to present as: ClientTypeWindows (default), ClientTypeMac, ClientTypeLinux, ClientTypeWeb. Browser mode defaults to ClientTypeWeb.
	PropertiesURL     string     // Base URL of the properties service (default DefaultPropertiesURL)
	NoPropertiesFetch bool       // Skip the network fetch and use the built-in properties
	BuildNumber       int        // Explicit client_build_number override (0 = resolved)

	// Gateway (WebSocket) options; the zero value behaves like the presented client.
	Gateway GatewayOptions
	// contains filtered or unexported fields
}

Config holds the configuration for the Discord client

func DefaultConfig

func DefaultConfig(token string) Config

DefaultConfig returns a default configuration. UserAgent is left empty so the client properties resolved at Initialize decide it; set it to force a specific user agent.

func (Config) ResolvedProperties

func (c Config) ResolvedProperties() *ClientProperties

ResolvedProperties returns the client properties resolved for this configuration by the client's Initialize, or, before that, the built-in defaults for the configured client type (with Config overrides applied).

type ConjuringProjectCreateProgressEvent

type ConjuringProjectCreateProgressEvent struct {
	Nonce     string `json:"nonce"`
	ProjectID string `json:"project_id"`
	WSTicket  string `json:"ws_ticket"`
}

ConjuringProjectCreateProgressEvent is CONJURING_PROJECT_CREATE_PROGRESS (web).

type ConjuringProjectUpdateEvent

type ConjuringProjectUpdateEvent struct {
	ProjectID string `json:"project_id"`
	Running   bool   `json:"running"`
}

ConjuringProjectUpdateEvent is CONJURING_PROJECT_UPDATE (web).

type ConjuringTurnSettledEvent

type ConjuringTurnSettledEvent struct {
	ProjectID  string  `json:"project_id"`
	GuildID    string  `json:"guild_id"`
	EntityID   string  `json:"entity_id"`
	Title      string  `json:"title"`
	Body       string  `json:"body"`
	Nonce      *string `json:"nonce"`
	BadgeCount *int    `json:"badge_count"`
}

ConjuringTurnSettledEvent is CONJURING_TURN_SETTLED (web).

type Connection

type Connection struct {
	ID                 string                  `json:"id"`
	Type               ConnectionType          `json:"type"`
	Name               string                  `json:"name"`
	Verified           bool                    `json:"verified"`
	Metadata           map[string]any          `json:"metadata,omitempty"`
	Revoked            bool                    `json:"revoked"`
	Visibility         ConnectionVisibility    `json:"visibility"`
	MetadataVisibility ConnectionVisibility    `json:"metadata_visibility"`
	ShowActivity       bool                    `json:"show_activity"`
	FriendSync         bool                    `json:"friend_sync"`
	TwoWayLink         bool                    `json:"two_way_link"`
	Integrations       []ConnectionIntegration `json:"integrations,omitempty"`
	AccessToken        string                  `json:"access_token,omitempty"`
}

Connection mirrors the Discord connection object.

type ConnectionAccessToken

type ConnectionAccessToken struct {
	AccessToken string `json:"access_token"`
}

ConnectionAccessToken mirrors the Discord connection access token object.

type ConnectionAuthorization

type ConnectionAuthorization struct {
	URL string `json:"url"`
}

ConnectionAuthorization mirrors the Discord connection authorization object.

type ConnectionEvent

type ConnectionEvent struct {
	Type         string `json:"type"`
	ID           string `json:"id"`
	Name         string `json:"name"`
	Visibility   int    `json:"visibility"`
	FriendSync   bool   `json:"friend_sync"`
	ShowActivity bool   `json:"show_activity"`
	Verified     bool   `json:"verified"`
}

ConnectionEvent represents connection events

type ConnectionIntegration

type ConnectionIntegration struct {
	ID      string             `json:"id"`
	Type    IntegrationType    `json:"type"`
	Account IntegrationAccount `json:"account"`
	Guild   IntegrationGuild   `json:"guild"`
}

ConnectionIntegration mirrors the Discord connection integration object.

type ConnectionType

type ConnectionType string

ConnectionType is the Discord connection type enumeration.

const (
	ConnectionTypeBattleNet       ConnectionType = "battlenet"
	ConnectionTypeContacts        ConnectionType = "contacts"
	ConnectionTypeCrunchyroll     ConnectionType = "crunchyroll"
	ConnectionTypeEbay            ConnectionType = "ebay"
	ConnectionTypeEpicGames       ConnectionType = "epicgames"
	ConnectionTypeFacebook        ConnectionType = "facebook"
	ConnectionTypeGithub          ConnectionType = "github"
	ConnectionTypeInstagram       ConnectionType = "instagram"
	ConnectionTypeLeagueOfLegends ConnectionType = "leagueoflegends"
	ConnectionTypePaypal          ConnectionType = "paypal"
	ConnectionTypePlaystation     ConnectionType = "playstation"
	ConnectionTypeReddit          ConnectionType = "reddit"
	ConnectionTypeRiotGames       ConnectionType = "riotgames"
	ConnectionTypeSamsung         ConnectionType = "samsung"
	ConnectionTypeSpotify         ConnectionType = "spotify"
	ConnectionTypeSkype           ConnectionType = "skype"
	ConnectionTypeSteam           ConnectionType = "steam"
	ConnectionTypeTiktok          ConnectionType = "tiktok"
	ConnectionTypeTwitch          ConnectionType = "twitch"
	ConnectionTypeTwitter         ConnectionType = "twitter"
	ConnectionTypeYoutube         ConnectionType = "youtube"
	ConnectionTypeXbox            ConnectionType = "xbox"
)

ConnectionType values.

type ConnectionVisibility

type ConnectionVisibility int

ConnectionVisibility is the Discord connection visibility enumeration.

const (
	ConnectionVisibilityNone     ConnectionVisibility = 0
	ConnectionVisibilityEveryone ConnectionVisibility = 1
)

ConnectionVisibility values.

type ConnectionsCallbackEvent

type ConnectionsCallbackEvent struct {
	Provider     string          `json:"provider"`
	Code         string          `json:"code"`
	State        string          `json:"state"`
	OpenIDParams json.RawMessage `json:"openid_params,omitempty"`
}

ConnectionsCallbackEvent is USER_CONNECTIONS_CALLBACK (web).

type ConnectionsLinkCallbackEvent

type ConnectionsLinkCallbackEvent struct {
	Provider      string `json:"provider"`
	CallbackCode  string `json:"callback_code"`
	CallbackState string `json:"callback_state"`
}

ConnectionsLinkCallbackEvent is USER_CONNECTIONS_LINK_CALLBACK.

type ConsentSetting

type ConsentSetting struct {
	Consented bool `json:"consented"`
}

ConsentSetting mirrors the Discord consent setting object.

type ConsentSettings

type ConsentSettings struct {
	Personalization ConsentSetting `json:"personalization"`
	UsageStatistics ConsentSetting `json:"usage_statistics"`
}

ConsentSettings mirrors the Discord consent settings object.

type ConsoleCommandUpdateEvent

type ConsoleCommandUpdateEvent struct {
	ID     string          `json:"id"`
	Result json.RawMessage `json:"result,omitempty"`
	Error  json.RawMessage `json:"error,omitempty"`
}

ConsoleCommandUpdateEvent is CONSOLE_COMMAND_UPDATE (web).

type ContainerComponent

type ContainerComponent struct {
	Type        ComponentType `json:"type"`
	ID          int           `json:"id,omitempty"`
	AccentColor int           `json:"accent_color,omitempty"`
	Spoiler     bool          `json:"spoiler,omitempty"`
	Components  []Component   `json:"components"`
}

ContainerComponent mirrors the Discord container component object.

type ContentInventoryInboxStaleEvent

type ContentInventoryInboxStaleEvent struct {
	RefreshAfterMs json.RawMessage `json:"refresh_after_ms,omitempty"`
}

ContentInventoryInboxStaleEvent is CONTENT_INVENTORY_INBOX_STALE (web).

type ContentRating

type ContentRating struct {
	Rating      int   `json:"rating"`
	Descriptors []int `json:"descriptors"`
}

ContentRating mirrors the Discord content rating object.

type ContentRatingAgency

type ContentRatingAgency int

ContentRatingAgency is the Discord content rating agency enumeration.

const (
	ContentRatingAgencyESRB ContentRatingAgency = 1
	ContentRatingAgencyPEGI ContentRatingAgency = 2
)

ContentRatingAgency values.

type ConversationMessages

type ConversationMessages struct {
	Messages          []*Message `json:"messages"`
	ReferenceMessages []*Message `json:"reference_messages,omitempty"`
}

ConversationMessages is the response of GetConversationMessages.

type ConversationMessagesParams

type ConversationMessagesParams struct {
	Limit                    int
	IncludeMessageReferences bool
	IncludeReactions         bool
}

ConversationMessagesParams are the optional parameters of GetConversationMessages.

type ConversationSummary

type ConversationSummary struct {
	Count      int      `json:"count"`
	EndID      string   `json:"end_id"`
	ID         string   `json:"id"`
	MessageIDs []string `json:"message_ids"`
	People     []string `json:"people"`
	Source     int      `json:"source"`
	StartID    string   `json:"start_id"`
	SummShort  string   `json:"summ_short"`
	Topic      string   `json:"topic"`
	Type       int      `json:"type"`
	Unsafe     bool     `json:"unsafe"`
}

ConversationSummary represents a conversation summary

type ConversationSummaryUpdateEvent

type ConversationSummaryUpdateEvent struct {
	ChannelID string                `json:"channel_id"`
	GuildID   string                `json:"guild_id"`
	Summaries []ConversationSummary `json:"summaries"`
}

ConversationSummaryUpdateEvent represents conversation summary updates

type CountryCode

type CountryCode struct {
	CountryCode string `json:"country_code"`
}

CountryCode mirrors the Discord country code object.

type CreateAchievementParams

type CreateAchievementParams struct {
	NameLocalizations        map[string]string
	DescriptionLocalizations map[string]string
}

CreateAchievementParams are the optional fields of CreateAchievement.

type CreateAppParams

type CreateAppParams struct {
	TeamID string // create the application inside this team
}

CreateAppParams are the optional fields of CreateApp.

type CreateConnectionParams

type CreateConnectionParams struct {
	FriendSync *bool  // nil lets the web client default apply (false)
	Location   string // X-Context-Properties location
}

CreateConnectionParams are the options of CreateConnection.

type CreateCustomEmojiParams

type CreateCustomEmojiParams struct {
	// Roles restricts the emoji to members with these roles.
	Roles []string
}

CreateCustomEmojiParams are the optional parts of CreateCustomEmoji.

type CreateGiftBatchParams

type CreateGiftBatchParams struct {
	EntitlementBranches []string
	EntitlementStartsAt string
	EntitlementEndsAt   string
}

CreateGiftBatchParams are the optional fields of CreateGiftBatch.

type CreateGiftParams

type CreateGiftParams struct {
	SubscriptionPlanID string `json:"subscription_plan_id,omitempty"`
	GiftStyle          int    `json:"gift_style,omitempty"`
}

CreateGiftParams are the optional fields of CreateGift.

type CreateGroupInviteParams

type CreateGroupInviteParams struct {
	MaxAge *int // seconds; nil means 86400 (one day), 0 never expires
}

CreateGroupInviteParams are the optional parameters of CreateGroupInvite.

type CreateGuildChannelParams

type CreateGuildChannelParams struct {
	Name                          string                 `json:"name,omitempty"`
	Topic                         *string                `json:"topic,omitempty"`
	Position                      *int                   `json:"position,omitempty"`
	NSFW                          *bool                  `json:"nsfw,omitempty"`
	RateLimitPerUser              *int                   `json:"rate_limit_per_user,omitempty"`
	Bitrate                       *int                   `json:"bitrate,omitempty"`
	UserLimit                     *int                   `json:"user_limit,omitempty"`
	PermissionOverwrites          []PermissionOverwrite  `json:"permission_overwrites,omitempty"`
	ParentID                      *string                `json:"parent_id,omitempty"`
	RTCRegion                     *string                `json:"rtc_region,omitempty"`
	VideoQualityMode              *VideoQualityMode      `json:"video_quality_mode,omitempty"`
	DefaultAutoArchiveDuration    *int                   `json:"default_auto_archive_duration,omitempty"`
	DefaultThreadRateLimitPerUser *int                   `json:"default_thread_rate_limit_per_user,omitempty"`
	AvailableTags                 []ForumTag             `json:"available_tags,omitempty"`
	DefaultReactionEmoji          *DefaultReaction       `json:"default_reaction_emoji,omitempty"`
	DefaultSortOrder              *ForumOrderType        `json:"default_sort_order,omitempty"`
	DefaultForumLayout            *ForumLayoutType       `json:"default_forum_layout,omitempty"`
	Flags                         *int                   `json:"flags,omitempty"`
	Extra                         map[string]interface{} `json:"-"`
}

CreateGuildChannelParams are the fields of CreateGuildChannel. Nil pointers and nil slices are left out; anything not modelled goes in Extra.

type CreateGuildParams

type CreateGuildParams struct {
	// Icon is the guild icon as a data URI (see ImageDataURI); nil sends null.
	Icon *string
	// Template is the guild template code (default DefaultGuildTemplateCode).
	Template string
}

CreateGuildParams are the optional parts of CreateGuild.

type CreateGuildSticker

type CreateGuildSticker struct {
	Name        string `json:"name"`
	Tags        string `json:"tags"`
	Description string `json:"description,omitempty"`
}

CreateGuildSticker is the request body for creating a guild sticker.

type CreateGuildTemplate

type CreateGuildTemplate struct {
	Name string  `json:"name"`
	Icon *string `json:"icon"`
}

CreateGuildTemplate is the request body for creating a guild template.

type CreateInviteParams

type CreateInviteParams struct {
	MaxAge              int
	MaxUses             int
	Temporary           bool
	NotUnique           bool              // true to omit "unique" (the default sends unique: true)
	TargetType          *InviteTargetType // nil sends "target_type": null
	TargetUserID        string
	TargetApplicationID string
	Flags               int
	// Location overrides the X-Context-Properties location ("Guild Header" or
	// "Context Menu", chosen at random when empty, like discord.py-self).
	Location string
}

CreateInviteParams are the optional parameters of CreateInvite. Zero values match discord.py-self's defaults: max_age 0, max_uses 0, temporary false, unique true, flags 0, target_type null.

type CreateOnboardingPromptOption

type CreateOnboardingPromptOption struct {
	ChannelIDs    []string `json:"channel_ids"`
	RoleIDs       []string `json:"role_ids"`
	Title         string   `json:"title"`
	Description   *string  `json:"description"`
	EmojiID       string   `json:"emoji_id,omitempty"`
	EmojiName     string   `json:"emoji_name,omitempty"`
	EmojiAnimated *bool    `json:"emoji_animated,omitempty"`
}

CreateOnboardingPromptOption is the request body for creating a onboarding prompt option.

type CreateOrderParams

type CreateOrderParams struct {
	Gift *OrderGift // makes the order a gift
}

CreateOrderParams are the optional fields of CreateOrder.

type CreatePaymentSourceParams

type CreatePaymentSourceParams struct {
	BillingAddressToken string `json:"billing_address_token,omitempty"`
	ReturnURL           string `json:"return_url,omitempty"`
	Bank                string `json:"bank,omitempty"`
}

CreatePaymentSourceParams are the optional fields of CreatePaymentSource.

type CreateScheduledMessageParams

type CreateScheduledMessageParams struct {
	ChannelID          string          `json:"channel_id"`
	ScheduledTimestamp string          `json:"scheduled_timestamp"` // ISO 8601
	Content            string          `json:"content,omitempty"`
	Flags              int             `json:"flags,omitempty"`
	MessageReference   json.RawMessage `json:"message_reference,omitempty"`
	AllowedMentions    json.RawMessage `json:"allowed_mentions,omitempty"`
	StickerIDs         []string        `json:"sticker_ids,omitempty"`
	Poll               json.RawMessage `json:"poll,omitempty"`
	Attachments        []interface{}   `json:"attachments"`
}

CreateScheduledMessageParams is the body of CreateScheduledMessage.

type CreateStageInstanceParams

type CreateStageInstanceParams struct {
	PrivacyLevel          *PrivacyLevel
	SendStartNotification bool // always sent (false by default)
	GuildScheduledEventID string
}

CreateStageInstanceParams are the optional parameters of CreateStageInstance.

type CreateSubscriptionParams

type CreateSubscriptionParams struct {
	TrialID                string
	PaymentSourceToken     string
	ReturnURL              string
	PurchaseToken          string
	GatewayCheckoutContext interface{}
	Code                   string
	Metadata               map[string]interface{}
}

CreateSubscriptionParams are the optional fields of CreateSubscription.

type CreateWebhookParams

type CreateWebhookParams struct {
	Avatar []byte // image bytes, sent as a data URI
}

CreateWebhookParams are the optional parameters of CreateWebhook.

type CreatorMonetizationRestrictionsUpdateEvent

type CreatorMonetizationRestrictionsUpdateEvent struct {
	GuildID      string          `json:"guild_id"`
	Restrictions json.RawMessage `json:"restrictions,omitempty"`
}

CreatorMonetizationRestrictionsUpdateEvent is CREATOR_MONETIZATION_RESTRICTIONS_UPDATE (web).

type DMChannel

type DMChannel struct {
	ID                        string      `json:"id"`
	Type                      ChannelType `json:"type"` // always 1
	LastMessageID             *string     `json:"last_message_id"`
	Recipients                []*User     `json:"recipients"`
	IsMessageRequest          bool        `json:"is_message_request,omitempty"`
	IsMessageRequestTimestamp *time.Time  `json:"is_message_request_timestamp,omitempty"`
	IsSpam                    bool        `json:"is_spam,omitempty"`
}

DMChannel mirrors the Discord dm channel object.

type DMSettingsUpsellShowEvent

type DMSettingsUpsellShowEvent struct {
	GuildID string `json:"guild_id"`
}

DMSettingsUpsellShowEvent is DM_SETTINGS_UPSELL_SHOW (web).

type DefaultMessageNotificationLevel

type DefaultMessageNotificationLevel int

DefaultMessageNotificationLevel is the Discord default message notification level enumeration.

const (
	DefaultMessageNotificationLevelAllMessages  DefaultMessageNotificationLevel = 0
	DefaultMessageNotificationLevelOnlyMentions DefaultMessageNotificationLevel = 1
)

DefaultMessageNotificationLevel values.

type DefaultReaction

type DefaultReaction struct {
	EmojiID   *string `json:"emoji_id"`
	EmojiName *string `json:"emoji_name"`
}

DefaultReaction mirrors the Discord default reaction object.

type DefaultValueType

type DefaultValueType string

DefaultValueType is the Discord default value type enumeration.

const (
	DefaultValueTypeUser    DefaultValueType = "user"
	DefaultValueTypeRole    DefaultValueType = "role"
	DefaultValueTypeChannel DefaultValueType = "channel"
)

DefaultValueType values.

type DeleteChannelParams

type DeleteChannelParams struct {
	// Silent, when set, is sent as ?silent=true|false (do not post the
	// "channel deleted" notice, for group DMs).
	Silent *bool
}

DeleteChannelParams are the optional parameters of DeleteChannel.

type DeletedEntityIDsEvent

type DeletedEntityIDsEvent struct {
	GuildID  string   `json:"guild_id"`
	Channels []string `json:"channels,omitempty"`
	Roles    []string `json:"roles,omitempty"`
	Emojis   []string `json:"emojis,omitempty"`
	Stickers []string `json:"stickers,omitempty"`
}

DeletedEntityIDsEvent is DELETED_ENTITY_IDS, the answer to op 30 (web).

type DeletedEntityIDsHashes

type DeletedEntityIDsHashes struct {
	GuildID        string          `json:"guild_id"`
	ChannelIDsHash json.RawMessage `json:"channel_ids_hash"`
	RoleIDsHash    json.RawMessage `json:"role_ids_hash"`
	EmojiIDsHash   json.RawMessage `json:"emoji_ids_hash"`
	StickerIDsHash json.RawMessage `json:"sticker_ids_hash"`
}

DeletedEntityIDsHashes is the op 30 payload: hashes of the IDs the client has cached; the gateway answers DELETED_ENTITY_IDS with what was deleted. The hash algorithm is not established by the references.

type DetectableApplication

type DetectableApplication struct {
	ID                       string                  `json:"id"`
	Name                     string                  `json:"name"`
	Hook                     bool                    `json:"hook"`
	Overlay                  bool                    `json:"overlay,omitempty"`
	OverlayMethods           int                     `json:"overlay_methods,omitempty"`
	OverlayWarn              bool                    `json:"overlay_warn,omitempty"`
	OverlayCompatibilityHook bool                    `json:"overlay_compatibility_hook,omitempty"`
	Aliases                  []string                `json:"aliases,omitempty"`
	Executables              []ApplicationExecutable `json:"executables,omitempty"`
}

DetectableApplication mirrors the Discord detectable application object.

type DirectoryBroadcast

type DirectoryBroadcast struct {
	CanBroadcast bool `json:"can_broadcast"`
	HasBroadcast bool `json:"has_broadcast,omitempty"`
}

DirectoryBroadcast mirrors the Discord directory broadcast object.

type DirectoryCategory

type DirectoryCategory int

DirectoryCategory is the Discord directory category enumeration.

const (
	DirectoryCategoryUncategorized DirectoryCategory = 0
	DirectoryCategorySchoolClub    DirectoryCategory = 1
	DirectoryCategoryClassSubject  DirectoryCategory = 2
	DirectoryCategoryStudySocial   DirectoryCategory = 3
	DirectoryCategoryMiscellaneous DirectoryCategory = 5
)

DirectoryCategory values.

type DirectoryChannel

type DirectoryChannel struct {
	ID                   string                 `json:"id"`
	GuildID              string                 `json:"guild_id"`
	Position             int                    `json:"position"`
	PermissionOverwrites []*PermissionOverwrite `json:"permission_overwrites"`
	ParentID             *string                `json:"parent_id"`
	Name                 string                 `json:"name"`
	Flags                int                    `json:"flags"`
	Type                 ChannelType            `json:"type"` // always 14
	LastMessageID        *string                `json:"last_message_id"`
	Topic                *string                `json:"topic"`
}

DirectoryChannel mirrors the Discord directory channel object.

type DirectoryCounts

type DirectoryCounts map[string]int

DirectoryCounts maps a directory category ID to its number of entries.

type DirectoryEntriesParams

type DirectoryEntriesParams struct {
	Type       *DirectoryEntryType
	CategoryID *DirectoryCategory
}

DirectoryEntriesParams filters GetDirectoryEntries / SearchDirectoryEntries.

type DirectoryEntry

type DirectoryEntry struct {
	Type                DirectoryEntryType       `json:"type"`
	PrimaryCategoryID   DirectoryCategory        `json:"primary_category_id,omitempty"`
	DirectoryChannelID  string                   `json:"directory_channel_id"`
	AuthorID            string                   `json:"author_id"`
	EntityID            string                   `json:"entity_id"`
	CreatedAt           time.Time                `json:"created_at"`
	Description         *string                  `json:"description"`
	Guild               *DirectoryGuild          `json:"guild,omitempty"`
	GuildScheduledEvent *DirectoryScheduledEvent `json:"guild_scheduled_event,omitempty"`
}

DirectoryEntry mirrors the Discord directory entry object.

type DirectoryEntryDeleteEvent

type DirectoryEntryDeleteEvent struct {
	PartialDirectoryEntry
	GuildID string `json:"guild_id"`
}

DirectoryEntryDeleteEvent is GUILD_DIRECTORY_ENTRY_DELETE.

type DirectoryEntryEvent

type DirectoryEntryEvent struct {
	DirectoryEntry
	GuildID string `json:"guild_id"`
}

DirectoryEntryEvent is GUILD_DIRECTORY_ENTRY_CREATE/UPDATE.

type DirectoryEntryParams

type DirectoryEntryParams struct {
	Type              *DirectoryEntryType // create only
	PrimaryCategoryID *DirectoryCategory
	Description       *string
	// NullDescription sends "description": null (create only; an edit sends "" instead).
	NullDescription bool
}

DirectoryEntryParams are the optional body fields of Create/EditDirectoryEntry.

type DirectoryEntryType

type DirectoryEntryType int

DirectoryEntryType is the Discord directory entry type enumeration.

const (
	DirectoryEntryTypeGuild          DirectoryEntryType = 0
	DirectoryEntryTypeScheduledEvent DirectoryEntryType = 1
)

DirectoryEntryType values.

type DirectoryGuild

type DirectoryGuild struct {
	ID                       string   `json:"id"`
	Name                     string   `json:"name"`
	Icon                     *string  `json:"icon"`
	Features                 []string `json:"features"`
	Description              *string  `json:"description"`
	Splash                   *string  `json:"splash"`
	DiscoverySplash          *string  `json:"discovery_splash"`
	HomeHeader               *string  `json:"home_header"`
	ApproximateMemberCount   int      `json:"approximate_member_count"`
	ApproximatePresenceCount int      `json:"approximate_presence_count"`
	FeaturableInDirectory    bool     `json:"featurable_in_directory"`
}

DirectoryGuild mirrors the Discord directory guild object.

type DirectoryScheduledEvent

type DirectoryScheduledEvent struct {
	Guild              PartialGuild             `json:"guild"`
	UserRsvp           bool                     `json:"user_rsvp"`
	UserCount          int                      `json:"user_count,omitempty"`
	ID                 string                   `json:"id"`
	GuildID            string                   `json:"guild_id"`
	EntityID           *string                  `json:"entity_id"`
	Name               string                   `json:"name"`
	ScheduledStartTime time.Time                `json:"scheduled_start_time"`
	PrivacyLevel       PrivacyLevel             `json:"privacy_level"`
	Status             ScheduledEventStatus     `json:"status"`
	CreatorID          *string                  `json:"creator_id,omitempty"`
	Description        *string                  `json:"description,omitempty"`
	Creator            *User                    `json:"creator,omitempty"`
	Image              *string                  `json:"image,omitempty"`
	SKUIDs             []string                 `json:"sku_ids"`
	ChannelID          json.RawMessage          `json:"channel_id"`
	EntityMetadata     json.RawMessage          `json:"entity_metadata"`
	ScheduledEndTime   *time.Time               `json:"scheduled_end_time,omitempty"`
	EntityType         ScheduledEventEntityType `json:"entity_type"`
}

DirectoryScheduledEvent is the flattened superset of DirectoryStageInstanceScheduledEvent, DirectoryVoiceScheduledEvent, DirectoryExternalScheduledEvent; fields absent from a variant are omitted.

type DiscordClient

type DiscordClient interface {
	// Initialize the client
	Initialize(ctx context.Context) error

	// Close the client and cleanup resources
	Close() error

	// API returns the shared, transport-independent REST surface.
	// It is non-nil from construction and usable once Initialize has returned.
	API() *API

	// Get current user info
	GetCurrentUser(ctx context.Context) (*User, error)

	// Send a message to a channel
	SendMessage(ctx context.Context, channelID string, content string) (*Message, error)

	// Get messages from a channel
	// Options: before (message ID), limit (default 50)
	GetMessages(ctx context.Context, channelID string, opts *GetMessagesOptions) ([]*Message, error)

	// Get all messages from a channel with automatic pagination
	// Options: limit, before, after, oldestFirst, progressCB
	GetAllMessages(ctx context.Context, channelID string, opts *GetAllMessagesOptions) ([]*Message, error)

	// Join a guild/server
	JoinGuild(ctx context.Context, inviteCode string) error

	// Get guild info
	GetGuild(ctx context.Context, guildID string) (*Guild, error)

	// Get user's guilds
	GetGuilds(ctx context.Context) ([]*Guild, error)

	// Get guild member count
	GetGuildMemberCount(ctx context.Context, guildID string) (int, error)

	// Get guild emojis
	GetGuildEmojis(ctx context.Context, guildID string) ([]*Emoji, error)

	// Get guild members
	GetGuildMembers(ctx context.Context, guildID string, limit int) ([]*GuildMember, error)

	// React to a message
	// emoji can be a string (unicode emoji like "👍" or custom emoji like "smile:123456789"),
	// an *Emoji object, or an EmojiReaction object
	AddReaction(ctx context.Context, channelID, messageID string, emoji interface{}) error

	// Get channel info
	GetChannel(ctx context.Context, channelID string) (*Channel, error)

	// Get all channels in a guild
	GetGuildChannels(ctx context.Context, guildID string) ([]*Channel, error)
	// SearchMessages searches messages in a channel within a guild.
	// If guildID is empty, it will be resolved from the channel.
	SearchMessages(ctx context.Context, guildID, channelID string, options *MessageSearchOptions) (*MessageSearchResponse, error)
	// GetChannelMessageCount returns the total number of messages in a channel.
	// If guildID is empty, it will be resolved from the channel.
	// If options is nil, defaults are used (no query filter).
	GetChannelMessageCount(ctx context.Context, guildID, channelID string, options *MessageSearchOptions) (int, error)

	// WebSocket methods
	ConnectWebSocket(ctx context.Context) error
	ListenForEvents(ctx context.Context, eventHandler EventHandler) error
	UpdateStatus(ctx context.Context, status string, game *Game, afk bool, since int64) error

	// Guild subscription methods
	SubscribeToGuild(guildID string, options GuildSubscribeOptions) error
	BulkSubscribeToGuilds(subscriptions map[string]GuildSubscribeOptions) error
	SubscribeToGuildMembers(guildID string, memberIDs []string) error
	SubscribeToGuildThreads(guildID string, threadIDs []string) error
	SubscribeToGuildChannels(guildID string, channels map[string][][]int) error
	SubscribeToAllGuildFeatures(guildID string) error
	UnsubscribeFromGuild(guildID string) error

	// WebSocket access
	GetWebSocket() *DiscordWebSocket

	// Name resolution
	GuildName(guildID string) string
	SetGuildName(guildID, name string)

	// CDN helpers
	// GetLatestAttachmentURL searches recent messages in a channel and returns the first attachment CDN URL found.
	GetLatestAttachmentURL(ctx context.Context, channelID string) (string, error)
	// GetLatestAttachmentData downloads the latest attachment's raw bytes, returning data, filename, and content type.
	GetLatestAttachmentData(ctx context.Context, channelID string) ([]byte, string, string, error)
	// DownloadCDN downloads a resource directly from a Discord CDN URL.
	DownloadCDN(ctx context.Context, assetURL string) ([]byte, string, error)

	// Thread methods
	// GetMessage fetches a single message by ID from a channel
	GetMessage(ctx context.Context, channelID, messageID string) (*Message, error)
	// GetMessageThread fetches the thread attached to a message (if any)
	GetMessageThread(ctx context.Context, channelID, messageID string) (*Thread, error)
	// GetActiveThreads returns all active threads in a guild
	GetActiveThreads(ctx context.Context, guildID string) (*ThreadListResponse, error)
	// GetPublicArchivedThreads returns archived public threads in a channel
	GetPublicArchivedThreads(ctx context.Context, channelID string, opts *ArchivedThreadsOptions) (*ThreadListResponse, error)
	// GetPrivateArchivedThreads returns archived private threads in a channel
	GetPrivateArchivedThreads(ctx context.Context, channelID string, opts *ArchivedThreadsOptions) (*ThreadListResponse, error)
	// GetJoinedPrivateArchivedThreads returns archived private threads the user has joined
	GetJoinedPrivateArchivedThreads(ctx context.Context, channelID string, opts *ArchivedThreadsOptions) (*ThreadListResponse, error)
}

DiscordClient represents a Discord selfbot client

func NewClient

func NewClient(config Config) DiscordClient

NewClient creates a new Discord client based on the specified mode

type DiscordWebSocket

type DiscordWebSocket struct {
	// contains filtered or unexported fields
}

DiscordWebSocket is a gateway session. It keeps its handlers and its session across connections: after a dropped connection, RECONNECT, INVALID_SESSION or a missed heartbeat ACK it reconnects by itself and RESUMEs (or re-IDENTIFYs when the session is gone), until Close is called or the server ends the session with a fatal close code (see Done and Err).

func NewDiscordWebSocket

func NewDiscordWebSocket(config Config) *DiscordWebSocket

NewDiscordWebSocket creates a gateway session for config. The client properties are taken from config.ResolvedProperties() now, so create it after the client's Initialize.

func (*DiscordWebSocket) AddCatchAllHandler

func (ws *DiscordWebSocket) AddCatchAllHandler(handler EventHandler) (remove func())

AddCatchAllHandler registers a raw handler that sees every dispatch, including event names this library has never heard of. The returned function removes it.

func (*DiscordWebSocket) AddChannelCreateHandler

func (ws *DiscordWebSocket) AddChannelCreateHandler(handler func(*Channel) error)

AddChannelCreateHandler adds a handler for CHANNEL_CREATE events

func (*DiscordWebSocket) AddChannelDeleteHandler

func (ws *DiscordWebSocket) AddChannelDeleteHandler(handler func(*Channel) error)

AddChannelDeleteHandler adds a handler for CHANNEL_DELETE events

func (*DiscordWebSocket) AddChannelUpdateHandler

func (ws *DiscordWebSocket) AddChannelUpdateHandler(handler func(*Channel) error)

AddChannelUpdateHandler adds a handler for CHANNEL_UPDATE events

func (*DiscordWebSocket) AddConversationSummaryUpdateHandler

func (ws *DiscordWebSocket) AddConversationSummaryUpdateHandler(handler func(*ConversationSummaryUpdateEvent) error)

AddConversationSummaryUpdateHandler adds a handler for CONVERSATION_SUMMARY_UPDATE events

func (*DiscordWebSocket) AddEventHandler

func (ws *DiscordWebSocket) AddEventHandler(eventType string, handler EventHandler)

AddEventHandler adds a raw handler for one dispatch event name. The name "*" registers a catch-all handler (see AddCatchAllHandler). Every dispatch is delivered to raw handlers, whether or not the library knows or can decode it.

func (*DiscordWebSocket) AddGuildCreateHandler

func (ws *DiscordWebSocket) AddGuildCreateHandler(handler func(*Guild) error)

AddGuildCreateHandler adds a handler for GUILD_CREATE events. The guild is decoded with GatewayGuild, so Name/Icon/Description/OwnerID are filled from "properties" when the gateway sends the client_state_v2 layout. Use On(ws, EvGuildCreate, ...) for the full payload.

func (*DiscordWebSocket) AddGuildDeleteHandler

func (ws *DiscordWebSocket) AddGuildDeleteHandler(handler func(*GuildDeleteEvent) error)

AddGuildDeleteHandler adds a handler for GUILD_DELETE events

func (*DiscordWebSocket) AddGuildMemberAddHandler

func (ws *DiscordWebSocket) AddGuildMemberAddHandler(handler func(*GuildMemberEvent) error)

AddGuildMemberAddHandler adds a handler for GUILD_MEMBER_ADD events

func (*DiscordWebSocket) AddGuildMemberListUpdateHandler

func (ws *DiscordWebSocket) AddGuildMemberListUpdateHandler(handler func(*GuildMemberListUpdateEvent) error)

AddGuildMemberListUpdateHandler adds a typed handler for GUILD_MEMBER_LIST_UPDATE events

func (*DiscordWebSocket) AddGuildScheduledEventUserAddHandler

func (ws *DiscordWebSocket) AddGuildScheduledEventUserAddHandler(handler func(*GuildScheduledEventUserEvent) error)

AddGuildScheduledEventUserAddHandler adds a handler for GUILD_SCHEDULED_EVENT_USER_ADD events

func (*DiscordWebSocket) AddGuildScheduledEventUserRemoveHandler

func (ws *DiscordWebSocket) AddGuildScheduledEventUserRemoveHandler(handler func(*GuildScheduledEventUserEvent) error)

AddGuildScheduledEventUserRemoveHandler adds a handler for GUILD_SCHEDULED_EVENT_USER_REMOVE events

func (*DiscordWebSocket) AddGuildUpdateHandler

func (ws *DiscordWebSocket) AddGuildUpdateHandler(handler func(*Guild) error)

AddGuildUpdateHandler adds a handler for GUILD_UPDATE events

func (*DiscordWebSocket) AddMessageCreateHandler

func (ws *DiscordWebSocket) AddMessageCreateHandler(handler func(*Message) error)

AddMessageCreateHandler adds a handler for MESSAGE_CREATE events

func (*DiscordWebSocket) AddMessageDeleteHandler

func (ws *DiscordWebSocket) AddMessageDeleteHandler(handler func(*MessageDeleteEvent) error)

AddMessageDeleteHandler adds a handler for MESSAGE_DELETE events

func (*DiscordWebSocket) AddMessageReactionAddHandler

func (ws *DiscordWebSocket) AddMessageReactionAddHandler(handler func(*MessageReactionEvent) error)

AddMessageReactionAddHandler adds a handler for MESSAGE_REACTION_ADD events

func (*DiscordWebSocket) AddMessageReactionAddManyHandler

func (ws *DiscordWebSocket) AddMessageReactionAddManyHandler(handler func(*MessageReactionAddManyEvent) error)

AddMessageReactionAddManyHandler adds a handler for MESSAGE_REACTION_ADD_MANY events

func (*DiscordWebSocket) AddMessageReactionRemoveHandler

func (ws *DiscordWebSocket) AddMessageReactionRemoveHandler(handler func(*MessageReactionEvent) error)

AddMessageReactionRemoveHandler adds a handler for MESSAGE_REACTION_REMOVE events

func (*DiscordWebSocket) AddMessageUpdateHandler

func (ws *DiscordWebSocket) AddMessageUpdateHandler(handler func(*Message) error)

AddMessageUpdateHandler adds a handler for MESSAGE_UPDATE events

func (*DiscordWebSocket) AddPassiveUpdateV1Handler

func (ws *DiscordWebSocket) AddPassiveUpdateV1Handler(handler func(*PassiveUpdateV1Event) error)

AddPassiveUpdateV1Handler adds a typed handler for PASSIVE_UPDATE_V1 events

func (*DiscordWebSocket) AddPassiveUpdateV2Handler

func (ws *DiscordWebSocket) AddPassiveUpdateV2Handler(handler func(*PassiveUpdateV2Event) error)

AddPassiveUpdateV2Handler adds a typed handler for PASSIVE_UPDATE_V2 events

func (*DiscordWebSocket) AddPresenceUpdateHandler

func (ws *DiscordWebSocket) AddPresenceUpdateHandler(handler func(*PresenceUpdateEvent) error)

AddPresenceUpdateHandler adds a typed handler for PRESENCE_UPDATE events

func (*DiscordWebSocket) AddReadyHandler

func (ws *DiscordWebSocket) AddReadyHandler(handler func(*ReadyPayload) error)

AddReadyHandler adds a typed handler for READY events

func (*DiscordWebSocket) AddReadySupplementalHandler

func (ws *DiscordWebSocket) AddReadySupplementalHandler(handler func(*ReadySupplementalEvent) error)

AddReadySupplementalHandler adds a typed handler for READY_SUPPLEMENTAL events

func (*DiscordWebSocket) AddSessionsReplaceHandler

func (ws *DiscordWebSocket) AddSessionsReplaceHandler(handler func(*SessionsReplaceEvent) error)

AddSessionsReplaceHandler adds a typed handler for SESSIONS_REPLACE events

func (*DiscordWebSocket) AddTestEventHandler deprecated

func (ws *DiscordWebSocket) AddTestEventHandler(handler func(*TestEvent) error)

AddTestEventHandler adds a handler for TEST_EVENT events.

Deprecated: TEST_EVENT is not a Discord dispatch event; it came from a local test harness. The handler still runs if such an event is received.

func (*DiscordWebSocket) AddThreadCreateHandler

func (ws *DiscordWebSocket) AddThreadCreateHandler(handler func(*ThreadEvent) error)

AddThreadCreateHandler adds a handler for THREAD_CREATE events

func (*DiscordWebSocket) AddThreadDeleteHandler

func (ws *DiscordWebSocket) AddThreadDeleteHandler(handler func(*ThreadDeleteEvent) error)

AddThreadDeleteHandler adds a handler for THREAD_DELETE events

func (*DiscordWebSocket) AddThreadListSyncHandler

func (ws *DiscordWebSocket) AddThreadListSyncHandler(handler func(*ThreadListSyncEvent) error)

AddThreadListSyncHandler adds a handler for THREAD_LIST_SYNC events

func (*DiscordWebSocket) AddThreadMemberListUpdateHandler

func (ws *DiscordWebSocket) AddThreadMemberListUpdateHandler(handler func(*ThreadMemberListUpdateEvent) error)

AddThreadMemberListUpdateHandler adds a handler for THREAD_MEMBER_LIST_UPDATE events This is sent after subscribing to a thread member list via SubscribeToGuildThreads

func (*DiscordWebSocket) AddThreadMemberUpdateHandler

func (ws *DiscordWebSocket) AddThreadMemberUpdateHandler(handler func(*ThreadMemberUpdateEvent) error)

AddThreadMemberUpdateHandler adds a handler for THREAD_MEMBER_UPDATE events This is sent when the current user's thread member object is updated

func (*DiscordWebSocket) AddThreadMembersUpdateHandler

func (ws *DiscordWebSocket) AddThreadMembersUpdateHandler(handler func(*ThreadMembersUpdateEvent) error)

AddThreadMembersUpdateHandler adds a handler for THREAD_MEMBERS_UPDATE events This is sent when members are added or removed from a thread

func (*DiscordWebSocket) AddThreadUpdateHandler

func (ws *DiscordWebSocket) AddThreadUpdateHandler(handler func(*ThreadEvent) error)

AddThreadUpdateHandler adds a handler for THREAD_UPDATE events

func (*DiscordWebSocket) AddTypingStartHandler

func (ws *DiscordWebSocket) AddTypingStartHandler(handler func(*TypingStartEvent) error)

AddTypingStartHandler adds a handler for TYPING_START events

func (*DiscordWebSocket) AddUserUpdateHandler

func (ws *DiscordWebSocket) AddUserUpdateHandler(handler func(*User) error)

AddUserUpdateHandler adds a handler for USER_UPDATE events

func (*DiscordWebSocket) AddVoiceStateUpdateHandler

func (ws *DiscordWebSocket) AddVoiceStateUpdateHandler(handler func(*VoiceState) error)

AddVoiceStateUpdateHandler adds a handler for VOICE_STATE_UPDATE events

func (*DiscordWebSocket) BuildIdentify

func (ws *DiscordWebSocket) BuildIdentify() *IdentifyPayload

BuildIdentify returns the IDENTIFY payload the session would send now.

func (*DiscordWebSocket) BulkSubscribeToGuilds

func (ws *DiscordWebSocket) BulkSubscribeToGuilds(subscriptions map[string]GuildSubscribeOptions) error

BulkSubscribeToGuilds subscribes to several guilds with op 37 GUILD_SUBSCRIPTIONS_BULK. Like the web client, it splits the subscriptions into several messages of at most 15360 bytes of entries.

func (*DiscordWebSocket) CallConnect

func (ws *DiscordWebSocket) CallConnect(channelID string) error

CallConnect sends op 13 CALL_CONNECT {channel_id}. With CapabilityAutoCallConnect the gateway connects to existing calls by itself.

func (*DiscordWebSocket) Capabilities

func (ws *DiscordWebSocket) Capabilities() Capabilities

Capabilities returns the capabilities sent in IDENTIFY.

func (*DiscordWebSocket) Close

func (ws *DiscordWebSocket) Close() error

Close ends the session: it closes the connection with 1000 and stops reconnecting. It is safe to call more than once.

func (*DiscordWebSocket) Compression

func (ws *DiscordWebSocket) Compression() GatewayCompression

Compression returns the transport compression this session uses.

func (*DiscordWebSocket) Connect

func (ws *DiscordWebSocket) Connect(ctx context.Context) error

Connect opens the first gateway connection and starts the session; it returns once the socket is open. IDENTIFY (or RESUME) is sent right away and the session then keeps itself alive and reconnects on its own.

func (*DiscordWebSocket) Done

func (ws *DiscordWebSocket) Done() <-chan struct{}

Done is closed when the session has ended for good: Close was called, the server closed it with a fatal code, or reconnecting failed GatewayOptions.MaxReconnectAttempts times. Err says why.

func (*DiscordWebSocket) EnableAllEventLogging

func (ws *DiscordWebSocket) EnableAllEventLogging()

EnableAllEventLogging enables logging for all supported events

func (*DiscordWebSocket) Err

func (ws *DiscordWebSocket) Err() error

Err returns why the session ended, or nil while it is running.

func (*DiscordWebSocket) GetDeletedEntityIDsNotMatchingHash

func (ws *DiscordWebSocket) GetDeletedEntityIDsNotMatchingHash(p DeletedEntityIDsHashes) error

GetDeletedEntityIDsNotMatchingHash sends op 30 GET_DELETED_ENTITY_IDS_NOT_MATCHING_HASH.

func (*DiscordWebSocket) GuildName

func (ws *DiscordWebSocket) GuildName(guildID string) string

GuildName returns the cached guild name for the given ID, or the ID itself if not found.

func (*DiscordWebSocket) IsConnected

func (ws *DiscordWebSocket) IsConnected() bool

IsConnected reports whether a gateway connection is currently open.

func (*DiscordWebSocket) Latency

func (ws *DiscordWebSocket) Latency() time.Duration

Latency returns the time between the last heartbeat and its ACK.

func (*DiscordWebSocket) RequestChannelInfo

func (ws *DiscordWebSocket) RequestChannelInfo(guildID string, fields []string) error

RequestChannelInfo sends op 43 REQUEST_CHANNEL_INFO {guild_id, fields} (the web client asks for fields such as "status" and "voice_start_time"); the answer is CHANNEL_INFO.

func (*DiscordWebSocket) RequestChannelMemberCount

func (ws *DiscordWebSocket) RequestChannelMemberCount(guildID, channelID string) error

RequestChannelMemberCount sends op 39 REQUEST_CHANNEL_MEMBER_COUNT {guild_id, channel_id}; the answer is CHANNEL_MEMBER_COUNT_UPDATE.

func (*DiscordWebSocket) RequestForumUnreads

func (ws *DiscordWebSocket) RequestForumUnreads(guildID, channelID string, threads []ForumUnreadsThread) error

RequestForumUnreads sends op 28 REQUEST_FORUM_UNREADS; the answer is FORUM_UNREADS.

func (*DiscordWebSocket) RequestGuildApplicationCommands

func (ws *DiscordWebSocket) RequestGuildApplicationCommands(payload interface{}) error

RequestGuildApplicationCommands sends op 24 REQUEST_GUILD_APPLICATION_COMMANDS with a caller-supplied payload. The opcode is in the web client's enum but neither reference has a send site, so its payload is not established; payload is marshalled as-is (json.RawMessage is sent verbatim).

func (*DiscordWebSocket) RequestGuildMembers

func (ws *DiscordWebSocket) RequestGuildMembers(p RequestGuildMembersPayload) error

RequestGuildMembers sends op 8 REQUEST_GUILD_MEMBERS; members arrive as GUILD_MEMBERS_CHUNK.

func (*DiscordWebSocket) RequestLastMessages

func (ws *DiscordWebSocket) RequestLastMessages(guildID string, channelIDs []string) error

RequestLastMessages sends op 34 REQUEST_LAST_MESSAGES {guild_id, channel_ids}; the answer is LAST_MESSAGES.

func (*DiscordWebSocket) RequestSoundboardSounds

func (ws *DiscordWebSocket) RequestSoundboardSounds(guildIDs []string) error

RequestSoundboardSounds sends op 31 REQUEST_SOUNDBOARD_SOUNDS {guild_ids}; the answer is one SOUNDBOARD_SOUNDS per guild.

func (*DiscordWebSocket) ResyncGuildChannels

func (ws *DiscordWebSocket) ResyncGuildChannels(guildID string, obfuscatedChannelIDs []string) error

ResyncGuildChannels sends op 38 GUILD_CHANNELS_RESYNC {guild_id, obfuscated_channel_ids}; the answer is CHANNEL_SYNC.

func (*DiscordWebSocket) SearchRecentMembers

func (ws *DiscordWebSocket) SearchRecentMembers(p SearchRecentMembersPayload) error

SearchRecentMembers sends op 35 SEARCH_RECENT_MEMBERS; the answer is GUILD_MEMBERS_CHUNK.

func (*DiscordWebSocket) SendHeartbeat

func (ws *DiscordWebSocket) SendHeartbeat() error

SendHeartbeat sends a heartbeat now: op 40 QOS_HEARTBEAT, or op 1 with GatewayOptions.LegacyHeartbeat. The session already heartbeats by itself.

func (*DiscordWebSocket) SendIdentify

func (ws *DiscordWebSocket) SendIdentify() error

SendIdentify sends op 2 IDENTIFY on the current connection, starting a new session. The session does this by itself on connect; use it only to force a re-identify.

func (*DiscordWebSocket) SendLegacyHeartbeat

func (ws *DiscordWebSocket) SendLegacyHeartbeat() error

SendLegacyHeartbeat sends op 1 HEARTBEAT with the last sequence number.

func (*DiscordWebSocket) SendMessage

func (ws *DiscordWebSocket) SendMessage(op int, data interface{}) error

SendMessage sends a payload with any opcode on the current connection, subject to the send rate limit.

func (*DiscordWebSocket) SendQOSHeartbeat

func (ws *DiscordWebSocket) SendQOSHeartbeat(qos *QOSPayload) error

SendQOSHeartbeat sends op 40 QOS_HEARTBEAT {seq, qos} with the given qos object (nil sends the session's current one).

func (*DiscordWebSocket) SendRemoteCommand

func (ws *DiscordWebSocket) SendRemoteCommand(targetSessionID string, payload interface{}) error

SendRemoteCommand sends op 29 REMOTE_COMMAND {target_session_id, payload} to another session of the same account (the web client uses it for remote control of desktop sessions; the payload format is client-defined).

func (*DiscordWebSocket) SendResume

func (ws *DiscordWebSocket) SendResume() error

SendResume sends op 6 RESUME for the current session on the current connection.

func (*DiscordWebSocket) SendUpdateTimeSpentSessionID

func (ws *DiscordWebSocket) SendUpdateTimeSpentSessionID() error

SendUpdateTimeSpentSessionID sends op 41 UPDATE_TIME_SPENT_SESSION_ID {initialization_timestamp, session_id, client_launch_id}. The session sends it after READY and every 30 minutes (discord.py-self); the web client sends it from handleUpdateTimeSpentSessionId, followed by a heartbeat.

func (*DiscordWebSocket) SendVoiceServerPing

func (ws *DiscordWebSocket) SendVoiceServerPing() error

SendVoiceServerPing sends op 5 VOICE_SERVER_PING (d is null).

func (*DiscordWebSocket) Sequence

func (ws *DiscordWebSocket) Sequence() int64

Sequence returns the last dispatch sequence number received.

func (*DiscordWebSocket) SessionID

func (ws *DiscordWebSocket) SessionID() string

SessionID returns the current session ID ("" before READY).

func (*DiscordWebSocket) SetGuildName

func (ws *DiscordWebSocket) SetGuildName(guildID, name string)

SetGuildName stores a guild name in the cache for later resolution.

func (*DiscordWebSocket) SetIdentifyHook

func (ws *DiscordWebSocket) SetIdentifyHook(fn func(*IdentifyPayload))

SetIdentifyHook registers a function that may edit each IDENTIFY payload before it is sent (client_state versions, presence, properties, ...).

func (*DiscordWebSocket) SetQOS

func (ws *DiscordWebSocket) SetQOS(q *QOSPayload)

SetQOS sets the "qos" object sent with every op 40 heartbeat (nil sends null). The default is DefaultQOS().

func (*DiscordWebSocket) StreamCreate

func (ws *DiscordWebSocket) StreamCreate(p StreamCreatePayload) error

StreamCreate sends op 18 STREAM_CREATE.

func (*DiscordWebSocket) StreamDelete

func (ws *DiscordWebSocket) StreamDelete(streamKey string) error

StreamDelete sends op 19 STREAM_DELETE {stream_key}.

func (*DiscordWebSocket) StreamPing

func (ws *DiscordWebSocket) StreamPing(streamKey string) error

StreamPing sends op 21 STREAM_PING {stream_key}.

func (*DiscordWebSocket) StreamSetPaused

func (ws *DiscordWebSocket) StreamSetPaused(streamKey string, paused bool) error

StreamSetPaused sends op 22 STREAM_SET_PAUSED {stream_key, paused}.

func (*DiscordWebSocket) StreamWatch

func (ws *DiscordWebSocket) StreamWatch(streamKey string) error

StreamWatch sends op 20 STREAM_WATCH {stream_key}.

func (*DiscordWebSocket) SubscribeToAllGuildFeatures

func (ws *DiscordWebSocket) SubscribeToAllGuildFeatures(guildID string) error

SubscribeToAllGuildFeatures subscribes to all available features for a guild

func (*DiscordWebSocket) SubscribeToGuild

func (ws *DiscordWebSocket) SubscribeToGuild(guildID string, options GuildSubscribeOptions) error

SubscribeToGuild subscribes to a single guild with op 14 GUILD_SUBSCRIPTIONS (legacy; the web client uses BulkSubscribeToGuilds).

func (*DiscordWebSocket) SubscribeToGuildChannels

func (ws *DiscordWebSocket) SubscribeToGuildChannels(guildID string, channels map[string][][]int) error

SubscribeToGuildChannels subscribes to specific channels with message ranges

func (*DiscordWebSocket) SubscribeToGuildMembers

func (ws *DiscordWebSocket) SubscribeToGuildMembers(guildID string, memberIDs []string) error

SubscribeToGuildMembers subscribes to specific members in a guild

func (*DiscordWebSocket) SubscribeToGuildThreads

func (ws *DiscordWebSocket) SubscribeToGuildThreads(guildID string, threadIDs []string) error

SubscribeToGuildThreads subscribes to threads in a guild

func (*DiscordWebSocket) UnsubscribeFromGuild

func (ws *DiscordWebSocket) UnsubscribeFromGuild(guildID string) error

UnsubscribeFromGuild unsubscribes from a guild by setting all features to false

func (*DiscordWebSocket) UpdatePresence

func (ws *DiscordWebSocket) UpdatePresence(p PresencePayload) error

UpdatePresence sends op 3 PRESENCE_UPDATE {status, since, activities, afk} and remembers it for later re-IDENTIFYs, as discord.py-self does.

func (*DiscordWebSocket) UpdateVoiceState

func (ws *DiscordWebSocket) UpdateVoiceState(p VoiceStateUpdatePayload) error

UpdateVoiceState sends op 4 VOICE_STATE_UPDATE. Joining voice only sets the state on the main gateway; the voice connection itself is not implemented.

type DiscountOffer

type DiscountOffer struct {
	ID         string                   `json:"id"`
	UserID     string                   `json:"user_id"`
	DiscountID string                   `json:"discount_id"`
	Discount   SubscriptionDiscountInfo `json:"discount"`
	ExpiresAt  *time.Time               `json:"expires_at"`
	AppliedAt  *time.Time               `json:"applied_at"`
	InvoiceID  *string                  `json:"invoice_id,omitempty"`
	CreatedAt  *time.Time               `json:"created_at,omitempty"`
	DeletedAt  *time.Time               `json:"deleted_at,omitempty"`
}

DiscountOffer mirrors the Discord discount offer object.

type DisplayNameEffect

type DisplayNameEffect int

DisplayNameEffect is the Discord display name effect enumeration.

const (
	DisplayNameEffectSolid    DisplayNameEffect = 1
	DisplayNameEffectGradient DisplayNameEffect = 2
	DisplayNameEffectNeon     DisplayNameEffect = 3
	DisplayNameEffectToon     DisplayNameEffect = 4
	DisplayNameEffectPop      DisplayNameEffect = 5
	DisplayNameEffectGlow     DisplayNameEffect = 6
)

DisplayNameEffect values.

type DisplayNameFont

type DisplayNameFont int

DisplayNameFont is the Discord display name font enumeration.

const (
	DisplayNameFontBangers      DisplayNameFont = 1
	DisplayNameFontBioRhyme     DisplayNameFont = 2
	DisplayNameFontCherryBomb   DisplayNameFont = 3
	DisplayNameFontChicle       DisplayNameFont = 4
	DisplayNameFontCompagnon    DisplayNameFont = 5
	DisplayNameFontMuseoModerno DisplayNameFont = 6
	DisplayNameFontNeoCastel    DisplayNameFont = 7
	DisplayNameFontPixelify     DisplayNameFont = 8
	DisplayNameFontRibes        DisplayNameFont = 9
	DisplayNameFontSinistre     DisplayNameFont = 10
	DisplayNameFontDefault      DisplayNameFont = 11
	DisplayNameFontZillaSlab    DisplayNameFont = 12
)

DisplayNameFont values.

type DisplayNameStyles

type DisplayNameStyles struct {
	FontID   int   `json:"font_id"`
	EffectID int   `json:"effect_id"`
	Colors   []int `json:"colors"`
}

DisplayNameStyles represents display name styling options

type EditChannelParams

type EditChannelParams struct {
	Name                          *string               `json:"name,omitempty"`
	Type                          *ChannelType          `json:"type,omitempty"`
	Position                      *int                  `json:"position,omitempty"`
	Topic                         *string               `json:"topic,omitempty"`
	NSFW                          *bool                 `json:"nsfw,omitempty"`
	RateLimitPerUser              *int                  `json:"rate_limit_per_user,omitempty"`
	Bitrate                       *int                  `json:"bitrate,omitempty"`
	UserLimit                     *int                  `json:"user_limit,omitempty"`
	PermissionOverwrites          []PermissionOverwrite `json:"permission_overwrites,omitempty"`
	ParentID                      *string               `json:"parent_id,omitempty"`
	RTCRegion                     *string               `json:"rtc_region,omitempty"`
	VideoQualityMode              *VideoQualityMode     `json:"video_quality_mode,omitempty"`
	DefaultAutoArchiveDuration    *int                  `json:"default_auto_archive_duration,omitempty"`
	Flags                         *int                  `json:"flags,omitempty"`
	DefaultThreadRateLimitPerUser *int                  `json:"default_thread_rate_limit_per_user,omitempty"`
	AvailableTags                 []ForumTag            `json:"available_tags,omitempty"`
	DefaultReactionEmoji          *DefaultReaction      `json:"default_reaction_emoji,omitempty"`
	DefaultSortOrder              *ForumOrderType       `json:"default_sort_order,omitempty"`
	DefaultForumLayout            *ForumLayoutType      `json:"default_forum_layout,omitempty"`
	Icon                          *string               `json:"icon,omitempty"` // group DM icon as a data URI

	// Thread fields.
	Archived            *bool    `json:"archived,omitempty"`
	AutoArchiveDuration *int     `json:"auto_archive_duration,omitempty"`
	Locked              *bool    `json:"locked,omitempty"`
	Invitable           *bool    `json:"invitable,omitempty"`
	AppliedTags         []string `json:"applied_tags,omitempty"`

	// Null lists body keys sent as JSON null. Extra sets other body keys
	// (a nil value is sent as null). Both are applied last.
	Null  []string               `json:"-"`
	Extra map[string]interface{} `json:"-"`
}

EditChannelParams are the settable channel fields. Nil pointers / nil slices are left out of the request. Fields that the API accepts as null (parent_id, rtc_region, topic, default_reaction_emoji, ...) are sent as null by naming them in Null; anything not modelled can go in Extra.

type EditConnectionParams

type EditConnectionParams struct {
	Name               *string               `json:"name,omitempty"` // only editable for some connection types
	Visibility         *ConnectionVisibility `json:"visibility,omitempty"`
	MetadataVisibility *ConnectionVisibility `json:"metadata_visibility,omitempty"`
	ShowActivity       *bool                 `json:"show_activity,omitempty"`
	FriendSync         *bool                 `json:"friend_sync,omitempty"`
}

EditConnectionParams is the body of EditConnection. Every field is optional.

type EditCustomEmojiParams

type EditCustomEmojiParams struct {
	Name *string `json:"name,omitempty"`
	// Roles replaces the roles the emoji is restricted to; a pointer to an empty slice lifts the restriction.
	Roles *[]string              `json:"roles,omitempty"`
	Extra map[string]interface{} `json:"-"`
}

EditCustomEmojiParams are the fields of EditCustomEmoji.

type EditEmailSettingsParams

type EditEmailSettingsParams struct {
	Initialized *bool `json:"initialized,omitempty"`
	// Categories maps category names (communication, social,
	// recommendations_and_events, tips, updates_and_announcements,
	// family_center_digest) to on/off.
	Categories map[string]bool `json:"categories,omitempty"`
}

EditEmailSettingsParams is the content of the "settings" body key of EditEmailSettings.

type EditEmbeddedActivityConfigParams

type EditEmbeddedActivityConfigParams struct {
	SupportedPlatforms          []string               `json:"supported_platforms,omitempty"`
	ClientPlatformConfig        map[string]interface{} `json:"client_platform_config,omitempty"`
	DefaultOrientationLockState *int                   `json:"default_orientation_lock_state,omitempty"`
	DefaultTabletOrientation    *int                   `json:"default_tablet_orientation_lock_state,omitempty"`
	RequiresAgeGate             *bool                  `json:"requires_age_gate,omitempty"`
	ShelfRank                   *int                   `json:"shelf_rank,omitempty"`
	FreePeriodStartsAt          *string                `json:"free_period_starts_at,omitempty"`
	FreePeriodEndsAt            *string                `json:"free_period_ends_at,omitempty"`
	PreviewVideoAssetID         NullableField[string]  `json:"activity_preview_video_asset_id,omitzero"`
	Extra                       map[string]interface{} `json:"-"`
}

EditEmbeddedActivityConfigParams is the body of EditEmbeddedActivityConfig. Unset fields are left out; PreviewVideoAssetID can be NullField to clear it.

type EditEmoji

type EditEmoji struct {
	Name  string   `json:"name"`
	Roles []string `json:"roles"`
}

EditEmoji is the request body for editing a emoji.

type EditGuildOnboardingParams

type EditGuildOnboardingParams struct {
	Prompts           *[]OnboardingPrompt    `json:"prompts,omitempty"`
	DefaultChannelIDs *[]string              `json:"default_channel_ids,omitempty"`
	Enabled           *bool                  `json:"enabled,omitempty"`
	Mode              *OnboardingMode        `json:"mode,omitempty"`
	Extra             map[string]interface{} `json:"-"`
}

EditGuildOnboardingParams are the fields of EditGuildOnboarding. Nil pointers are left out of the request.

type EditGuildParams

type EditGuildParams struct {
	Name                        *string                          `json:"name,omitempty"`
	Description                 NullableField[string]            `json:"description,omitzero"`
	Icon                        NullableField[string]            `json:"icon,omitzero"`             // data URI
	Banner                      NullableField[string]            `json:"banner,omitzero"`           // data URI
	Splash                      NullableField[string]            `json:"splash,omitzero"`           // data URI
	DiscoverySplash             NullableField[string]            `json:"discovery_splash,omitzero"` // data URI
	AfkChannelID                NullableField[string]            `json:"afk_channel_id,omitzero"`
	AfkTimeout                  *int                             `json:"afk_timeout,omitempty"`
	OwnerID                     *string                          `json:"owner_id,omitempty"`
	DefaultMessageNotifications *DefaultMessageNotificationLevel `json:"default_message_notifications,omitempty"`
	VerificationLevel           *VerificationLevel               `json:"verification_level,omitempty"`
	ExplicitContentFilter       *ExplicitContentFilterLevel      `json:"explicit_content_filter,omitempty"`
	SystemChannelID             NullableField[string]            `json:"system_channel_id,omitzero"`
	SystemChannelFlags          *int                             `json:"system_channel_flags,omitempty"`
	PreferredLocale             *string                          `json:"preferred_locale,omitempty"`
	RulesChannelID              NullableField[string]            `json:"rules_channel_id,omitzero"`
	PublicUpdatesChannelID      NullableField[string]            `json:"public_updates_channel_id,omitzero"`
	SafetyAlertsChannelID       NullableField[string]            `json:"safety_alerts_channel_id,omitzero"`
	PremiumProgressBarEnabled   *bool                            `json:"premium_progress_bar_enabled,omitempty"`
	Features                    *[]string                        `json:"features,omitempty"` // the full feature list to set
	Extra                       map[string]interface{}           `json:"-"`
}

EditGuildParams are the settable guild fields. Nil pointers and unset NullableFields are left out of the request; NullField sends null. Anything not modelled goes in Extra.

type EditGuildProfileParams

type EditGuildProfileParams struct {
	Description         NullableField[string]  `json:"description,omitzero"`
	BrandColorPrimary   NullableField[string]  `json:"brand_color_primary,omitzero"`
	GameApplicationIDs  *[]string              `json:"game_application_ids,omitempty"`
	Tag                 NullableField[string]  `json:"tag,omitzero"`
	Badge               NullableField[int]     `json:"badge,omitzero"`
	BadgeColorPrimary   NullableField[string]  `json:"badge_color_primary,omitzero"`
	BadgeColorSecondary NullableField[string]  `json:"badge_color_secondary,omitzero"`
	Traits              *[]GuildProfileTrait   `json:"traits,omitempty"`
	Visibility          NullableField[int]     `json:"visibility,omitzero"`
	CustomBanner        NullableField[string]  `json:"custom_banner,omitzero"` // data URI
	Extra               map[string]interface{} `json:"-"`
}

EditGuildProfileParams are the fields of EditGuildProfile.

type EditGuildSettingsParams

type EditGuildSettingsParams struct {
	Muted                *bool                     `json:"muted,omitempty"`
	MuteConfig           NullableField[MuteConfig] `json:"mute_config,omitzero"` // {"selected_time_window": -1, "end_time": null} mutes forever
	MessageNotifications *MessageNotificationLevel `json:"message_notifications,omitempty"`
	SuppressEveryone     *bool                     `json:"suppress_everyone,omitempty"`
	SuppressRoles        *bool                     `json:"suppress_roles,omitempty"`
	MobilePush           *bool                     `json:"mobile_push,omitempty"`
	HideMutedChannels    *bool                     `json:"hide_muted_channels,omitempty"`
	MuteScheduledEvents  *bool                     `json:"mute_scheduled_events,omitempty"`
	NotifyHighlights     *HighlightLevel           `json:"notify_highlights,omitempty"`
	Flags                *int                      `json:"flags,omitempty"`
	// ChannelOverrides maps channel IDs to their overrides.
	ChannelOverrides map[string]*ChannelOverrideParams `json:"channel_overrides,omitempty"`
}

EditGuildSettingsParams is the body of EditGuildSettings. Every field is optional.

type EditGuildWidgetSettings

type EditGuildWidgetSettings struct {
	Enabled   *bool   `json:"enabled,omitempty"`
	ChannelID *string `json:"channel_id,omitempty"`
}

EditGuildWidgetSettings is the request body for editing a guild widget settings.

type EditIncidentActionsParams

type EditIncidentActionsParams struct {
	InvitesDisabledUntil NullableField[string]  `json:"invites_disabled_until,omitzero"` // RFC 3339 time
	DMsDisabledUntil     NullableField[string]  `json:"dms_disabled_until,omitzero"`     // RFC 3339 time
	Extra                map[string]interface{} `json:"-"`
}

EditIncidentActionsParams are the fields of EditGuildIncidentActions.

type EditIntegrationParams

type EditIntegrationParams struct {
	ExpireBehavior    *IntegrationExpireBehavior `json:"expire_behavior,omitempty"`
	ExpireGracePeriod *int                       `json:"expire_grace_period,omitempty"`
	EnableEmoticons   *bool                      `json:"enable_emoticons,omitempty"`
	Extra             map[string]interface{}     `json:"-"`
}

EditIntegrationParams are the fields of EditIntegration.

type EditLibraryEntryParams

type EditLibraryEntryParams struct {
	Flags *int `json:"flags,omitempty"`
}

EditLibraryEntryParams is the body of EditLibraryEntry.

type EditMemberParams

type EditMemberParams struct {
	Nick   NullableField[string] `json:"nick,omitzero"`
	Avatar NullableField[string] `json:"avatar,omitzero"` // data URI (own member only)
	Banner NullableField[string] `json:"banner,omitzero"` // data URI (own member only)
	Bio    *string               `json:"bio,omitempty"`   // own member only
	Deaf   *bool                 `json:"deaf,omitempty"`
	Mute   *bool                 `json:"mute,omitempty"`
	// ChannelID moves the member to a voice channel; NullField disconnects them.
	ChannelID NullableField[string] `json:"channel_id,omitzero"`
	// Roles replaces the member's roles; a pointer to an empty slice removes all of them.
	Roles *[]string `json:"roles,omitempty"`
	// CommunicationDisabledUntil times the member out until the given time; NullField ends the timeout.
	CommunicationDisabledUntil NullableField[time.Time] `json:"communication_disabled_until,omitzero"`
	Flags                      *int                     `json:"flags,omitempty"`
	Extra                      map[string]interface{}   `json:"-"`
}

EditMemberParams are the settable member fields. Nil pointers and unset NullableFields are left out of the request; NullField sends an explicit null (clears the nickname, removes the voice channel, ends a timeout).

type EditMemberVerificationParams

type EditMemberVerificationParams struct {
	Enabled     *bool                          `json:"enabled,omitempty"`
	FormFields  *[]MemberVerificationFormField `json:"form_fields,omitempty"`
	Description NullableField[string]          `json:"description,omitzero"`
	// BulkAction is what to do with pending join requests when disabling the
	// gate: JoinRequestStatusApproved or JoinRequestStatusRejected.
	BulkAction *JoinRequestStatus     `json:"bulk_action,omitempty"`
	Extra      map[string]interface{} `json:"-"`
}

EditMemberVerificationParams are the fields of EditMemberVerification.

type EditMessageParams

type EditMessageParams struct {
	// Content replaces the text; a pointer to "" clears it. To send an explicit
	// JSON null use Null: []string{"content"} (or ClearContent).
	Content      *string
	ClearContent bool // sends "content": null

	// Embeds replaces the embeds; a non-nil empty slice sends [] (removes them).
	Embeds []Embed

	// Attachments lists the existing attachments to keep (PartialAttachment{ID: ...});
	// a non-nil empty slice with no Files removes all attachments. New Files are
	// appended with ids "0".."N-1".
	Attachments []PartialAttachment
	Files       []File

	Flags           *int
	AllowedMentions *AllowedMentions
	Components      []Component // a non-nil empty slice removes the components

	// Null lists body keys to send as JSON null; Extra sets arbitrary body keys
	// (nil value => null). Both are applied last.
	Null  []string
	Extra map[string]interface{}
}

EditMessageParams are the optional parts of EditMessage. Unset (nil / zero) fields are left out of the request and so left unchanged on the message.

type EditPaymentSourceParams

type EditPaymentSourceParams struct {
	BillingAddress *BillingAddress `json:"billing_address,omitempty"`
	Default        *bool           `json:"default,omitempty"`
	ExpiresMonth   *int            `json:"expires_month,omitempty"`
	ExpiresYear    *int            `json:"expires_year,omitempty"`
}

EditPaymentSourceParams is the body of EditPaymentSource.

type EditProfileParams

type EditProfileParams struct {
	Password          *string                `json:"password,omitempty"`
	NewPassword       *string                `json:"new_password,omitempty"`
	Email             *string                `json:"email,omitempty"`
	Username          *string                `json:"username,omitempty"`
	Discriminator     *int                   `json:"discriminator,omitempty"`
	GlobalName        NullableField[string]  `json:"global_name,omitzero"`
	Avatar            NullableField[string]  `json:"avatar,omitzero"`     // data URI, or NullField to remove
	AvatarID          *string                `json:"avatar_id,omitempty"` // reuse a recent avatar (GetRecentAvatars)
	AvatarDescription *string                `json:"avatar_description,omitempty"`
	AvatarDecoration  NullableField[string]  `json:"avatar_decoration,omitzero"` // data URI, or NullField to remove
	Banner            NullableField[string]  `json:"banner,omitzero"`            // data URI, or NullField to remove
	AccentColor       NullableField[int]     `json:"accent_color,omitzero"`      // RGB integer, or NullField to clear
	Bio               *string                `json:"bio,omitempty"`              // "" clears the bio
	DateOfBirth       *string                `json:"date_of_birth,omitempty"`    // YYYY-MM-DD
	Extra             map[string]interface{} `json:"-"`                          // merged into the body last; for fields not modelled above
}

EditProfileParams is the body of EditProfile. Every field is optional. Image fields take data URIs (see ImageDataURI); NullField removes them. Changing the password, e-mail, username or discriminator requires Password.

func (EditProfileParams) MarshalJSON

func (p EditProfileParams) MarshalJSON() ([]byte, error)

MarshalJSON adds Extra to the modelled fields.

type EditProtoSettingsParams

type EditProtoSettingsParams struct {
	// RequiredDataVersion makes the edit fail instead of overwriting newer
	// settings written by another client.
	RequiredDataVersion *int
}

EditProtoSettingsParams are the options of EditProtoSettings.

type EditRelationshipParams

type EditRelationshipParams struct {
	// Nickname is the friend nickname; NullField removes it.
	Nickname NullableField[string] `json:"nickname,omitzero"`
}

EditRelationshipParams is the body of EditRelationship.

type EditScheduledMessageParams

type EditScheduledMessageParams struct {
	ScheduledTimestamp string `json:"scheduled_timestamp,omitempty"`
	Content            string `json:"content,omitempty"`
	Flags              *int   `json:"flags,omitempty"`
}

EditScheduledMessageParams is the body of EditScheduledMessage.

type EditSettingsParams

type EditSettingsParams struct {
	Locale                          *string                           `json:"locale,omitempty"`
	Theme                           *string                           `json:"theme,omitempty"`
	Status                          *string                           `json:"status,omitempty"`
	CustomStatus                    NullableField[LegacyCustomStatus] `json:"custom_status,omitzero"` // NullField clears it
	ExplicitContentFilter           *int                              `json:"explicit_content_filter,omitempty"`
	AnimateStickers                 *int                              `json:"animate_stickers,omitempty"`
	AnimateEmoji                    *bool                             `json:"animate_emoji,omitempty"`
	FriendSourceFlags               map[string]bool                   `json:"friend_source_flags,omitempty"`
	FriendDiscoveryFlags            *int                              `json:"friend_discovery_flags,omitempty"`
	RestrictedGuilds                []string                          `json:"restricted_guilds,omitempty"`
	ActivityRestrictedGuildIDs      []string                          `json:"activity_restricted_guild_ids,omitempty"`
	ActivityJoiningRestrictedGuilds []string                          `json:"activity_joining_restricted_guild_ids,omitempty"`
	DeveloperMode                   *bool                             `json:"developer_mode,omitempty"`
	MessageDisplayCompact           *bool                             `json:"message_display_compact,omitempty"`
	InlineAttachmentMedia           *bool                             `json:"inline_attachment_media,omitempty"`
	InlineEmbedMedia                *bool                             `json:"inline_embed_media,omitempty"`
	GifAutoPlay                     *bool                             `json:"gif_auto_play,omitempty"`
	RenderEmbeds                    *bool                             `json:"render_embeds,omitempty"`
	RenderReactions                 *bool                             `json:"render_reactions,omitempty"`
	ShowCurrentGame                 *bool                             `json:"show_current_game,omitempty"`
	ViewNSFWGuilds                  *bool                             `json:"view_nsfw_guilds,omitempty"`
	ViewNSFWCommands                *bool                             `json:"view_nsfw_commands,omitempty"`
	TimezoneOffset                  *int                              `json:"timezone_offset,omitempty"`
	Extra                           map[string]interface{}            `json:"-"`
}

EditSettingsParams is the body of EditSettings. Every field is optional; Extra carries any other settings key.

func (EditSettingsParams) MarshalJSON

func (p EditSettingsParams) MarshalJSON() ([]byte, error)

MarshalJSON adds Extra to the modelled fields.

type EditStageInstanceParams

type EditStageInstanceParams struct {
	Topic        *string
	PrivacyLevel *PrivacyLevel
}

EditStageInstanceParams are the editable fields of a stage instance.

type EditSubscriptionParams

type EditSubscriptionParams struct {
	Items              []SubscriptionItemParams `json:"items,omitempty"`
	PaymentSourceID    *string                  `json:"payment_source_id,omitempty"`
	PaymentSourceToken *string                  `json:"payment_source_token,omitempty"`
	Currency           *string                  `json:"currency,omitempty"`
	Status             *int                     `json:"status,omitempty"`
	// Location and LocationStack become query parameters, not body keys.
	Location *SubscriptionLocationParams `json:"-"`
}

EditSubscriptionParams is the body of EditSubscription. Every field is optional.

type EditTemplateParams

type EditTemplateParams struct {
	Name        *string                `json:"name,omitempty"`
	Description NullableField[string]  `json:"description,omitzero"`
	Extra       map[string]interface{} `json:"-"`
}

EditTemplateParams are the fields of EditTemplate.

type EditVoiceStateParams

type EditVoiceStateParams struct {
	ChannelID *string `json:"channel_id,omitempty"`
	Suppress  *bool   `json:"suppress,omitempty"`
	// RequestToSpeakTimestamp is an RFC 3339 time; NullField clears the request.
	RequestToSpeakTimestamp NullableField[string]  `json:"request_to_speak_timestamp,omitzero"`
	Extra                   map[string]interface{} `json:"-"`
}

EditVoiceStateParams are the fields of EditMyVoiceState and EditVoiceState.

type EditWebhookMessageParams

type EditWebhookMessageParams struct {
	EditMessageParams
	ThreadID string
}

EditWebhookMessageParams are the options of EditWebhookMessage: the same fields as EditMessageParams plus the thread the message lives in.

type EditWebhookParams

type EditWebhookParams struct {
	Name *string
	// Avatar sets a new image (sent as a data URI); ClearAvatar sends "avatar": null.
	Avatar      []byte
	ClearAvatar bool
	ChannelID   string // move the webhook to another channel (not with a token)
}

EditWebhookParams are the optional fields of EditWebhook / EditWebhookWithToken.

type EditWelcomeScreenParams

type EditWelcomeScreenParams struct {
	Enabled         *bool                   `json:"enabled,omitempty"`
	Description     NullableField[string]   `json:"description,omitzero"`
	WelcomeChannels *[]WelcomeScreenChannel `json:"welcome_channels,omitempty"`
	Extra           map[string]interface{}  `json:"-"`
}

EditWelcomeScreenParams are the fields of EditWelcomeScreen.

type EditWidgetParams

type EditWidgetParams struct {
	Enabled   *bool                  `json:"enabled,omitempty"`
	ChannelID NullableField[string]  `json:"channel_id,omitzero"` // NullField removes the invite channel
	Extra     map[string]interface{} `json:"-"`
}

EditWidgetParams are the fields of EditWidget.

type EmailDomainLookup

type EmailDomainLookup struct {
	GuildsInfo       []HubGuild `json:"guilds_info,omitempty"`
	HasMatchingGuild bool       `json:"has_matching_guild"`
}

EmailDomainLookup mirrors the Discord email domain lookup object.

type EmailDomainVerification

type EmailDomainVerification struct {
	Guild  *Guild `json:"guild"`
	Joined bool   `json:"joined"`
}

EmailDomainVerification mirrors the Discord email domain verification object.

type EmailSettings

type EmailSettings struct {
	Initialized bool                    `json:"initialized"`
	Categories  EmailSettingsCategories `json:"categories"`
}

EmailSettings mirrors the Discord email settings object.

type EmailSettingsCategories

type EmailSettingsCategories struct {
	Communication            bool `json:"communication"`
	Social                   bool `json:"social"`
	RecommendationsAndEvents bool `json:"recommendations_and_events"`
	Tips                     bool `json:"tips"`
	UpdatesAndAnnouncements  bool `json:"updates_and_announcements"`
	FamilyCenterDigest       bool `json:"family_center_digest"`
}

EmailSettingsCategories mirrors the Discord email settings categories object.

type Embed

type Embed struct {
	Title       string         `json:"title,omitempty"`
	Type        EmbedType      `json:"type,omitempty"`
	Description string         `json:"description,omitempty"`
	URL         string         `json:"url,omitempty"`
	Timestamp   *time.Time     `json:"timestamp,omitempty"`
	Color       int            `json:"color,omitempty"`
	Footer      *EmbedFooter   `json:"footer,omitempty"`
	Image       *EmbedMedia    `json:"image,omitempty"`
	Thumbnail   *EmbedMedia    `json:"thumbnail,omitempty"`
	Video       *EmbedMedia    `json:"video,omitempty"`
	Provider    *EmbedProvider `json:"provider,omitempty"`
	Author      *EmbedAuthor   `json:"author,omitempty"`
	Fields      []EmbedField   `json:"fields,omitempty"`
	ReferenceID string         `json:"reference_id,omitempty"`
	Flags       int            `json:"flags,omitempty"`
}

Embed mirrors the Discord embed object.

type EmbedAuthor

type EmbedAuthor struct {
	Name         string `json:"name"`
	URL          string `json:"url,omitempty"`
	IconURL      string `json:"icon_url,omitempty"`
	ProxyIconURL string `json:"proxy_icon_url,omitempty"`
}

EmbedAuthor mirrors the Discord embed author object.

type EmbedField

type EmbedField struct {
	Name   string `json:"name"`
	Value  string `json:"value"`
	Inline bool   `json:"inline,omitempty"`
}

EmbedField mirrors the Discord embed field object.

type EmbedFooter

type EmbedFooter struct {
	Text         string `json:"text"`
	IconURL      string `json:"icon_url,omitempty"`
	ProxyIconURL string `json:"proxy_icon_url,omitempty"`
}

EmbedFooter mirrors the Discord embed footer object.

type EmbedMedia

type EmbedMedia struct {
	URL                string `json:"url"`
	ProxyURL           string `json:"proxy_url,omitempty"`
	Height             int    `json:"height,omitempty"`
	Width              int    `json:"width,omitempty"`
	Flags              int    `json:"flags,omitempty"`
	PlaceholderVersion int    `json:"placeholder_version,omitempty"`
	Placeholder        string `json:"placeholder,omitempty"`
}

EmbedMedia mirrors the Discord embed media object.

type EmbedProvider

type EmbedProvider struct {
	Name string `json:"name,omitempty"`
	URL  string `json:"url,omitempty"`
}

EmbedProvider mirrors the Discord embed provider object.

type EmbedType

type EmbedType string

EmbedType is the Discord embed type enumeration.

const (
	EmbedTypeRich                       EmbedType = "rich"
	EmbedTypeImage                      EmbedType = "image"
	EmbedTypeVideo                      EmbedType = "video"
	EmbedTypeGifv                       EmbedType = "gifv"
	EmbedTypeArticle                    EmbedType = "article"
	EmbedTypeLink                       EmbedType = "link"
	EmbedTypeAutoModerationMessage      EmbedType = "auto_moderation_message"
	EmbedTypeAutoModerationNotification EmbedType = "auto_moderation_notification"
	EmbedTypePollResult                 EmbedType = "poll_result"
	EmbedTypePostPreview                EmbedType = "post_preview"
	EmbedTypeApplicationNews            EmbedType = "application_news"
)

EmbedType values.

type EmbeddedActivity

type EmbeddedActivity struct {
	ApplicationID string `json:"application_id"`
	ChannelID     string `json:"channel_id"`
	GuildID       string `json:"guild_id,omitempty"`
	MaxAge        int    `json:"max_age"`
	MaxUses       int    `json:"max_uses"`
	Code          string `json:"code"`
	Temporary     bool   `json:"temporary"`
	Uses          int    `json:"uses"`
	CreatedAt     string `json:"created_at"`
}

EmbeddedActivity represents an embedded activity in a call

type EmbeddedActivityConfig

type EmbeddedActivityConfig struct {
	ApplicationID                     string                                                      `json:"application_id,omitempty"`
	ActivityPreviewVideoAssetID       *string                                                     `json:"activity_preview_video_asset_id,omitempty"`
	ClientPlatformConfig              map[EmbeddedActivityPlatform]EmbeddedActivityPlatformConfig `json:"client_platform_config"`
	DefaultOrientationLockState       EmbeddedActivityOrientation                                 `json:"default_orientation_lock_state"`
	TabletDefaultOrientationLockState EmbeddedActivityOrientation                                 `json:"tablet_default_orientation_lock_state"`
	FreePeriodEndsAt                  *time.Time                                                  `json:"free_period_ends_at,omitempty"`
	FreePeriodStartsAt                *time.Time                                                  `json:"free_period_starts_at,omitempty"`
	PremiumTierRequirement            *int                                                        `json:"premium_tier_requirement,omitempty"` // one of 1, 2, 3
	RequiresAgeGate                   bool                                                        `json:"requires_age_gate"`
	ShelfRank                         int                                                         `json:"shelf_rank"`
	SupportedPlatforms                []EmbeddedActivityPlatform                                  `json:"supported_platforms"`
}

EmbeddedActivityConfig mirrors the Discord embedded activity config object.

type EmbeddedActivityLabelType

type EmbeddedActivityLabelType int

EmbeddedActivityLabelType is the Discord embedded activity label type enumeration.

const (
	EmbeddedActivityLabelTypeNone    EmbeddedActivityLabelType = 0
	EmbeddedActivityLabelTypeNew     EmbeddedActivityLabelType = 1
	EmbeddedActivityLabelTypeUpdated EmbeddedActivityLabelType = 2
)

EmbeddedActivityLabelType values.

type EmbeddedActivityOrientation

type EmbeddedActivityOrientation int

EmbeddedActivityOrientation is the Discord embedded activity orientation enumeration.

const (
	EmbeddedActivityOrientationUnlocked  EmbeddedActivityOrientation = 1
	EmbeddedActivityOrientationPortrait  EmbeddedActivityOrientation = 2
	EmbeddedActivityOrientationLandscape EmbeddedActivityOrientation = 3
)

EmbeddedActivityOrientation values.

type EmbeddedActivityPlatform

type EmbeddedActivityPlatform string

EmbeddedActivityPlatform is the Discord embedded activity platform enumeration.

const (
	EmbeddedActivityPlatformWeb     EmbeddedActivityPlatform = "web"
	EmbeddedActivityPlatformAndroid EmbeddedActivityPlatform = "android"
	EmbeddedActivityPlatformIOS     EmbeddedActivityPlatform = "ios"
)

EmbeddedActivityPlatform values.

type EmbeddedActivityPlatformConfig

type EmbeddedActivityPlatformConfig struct {
	LabelType    EmbeddedActivityLabelType            `json:"label_type"`
	LabelUntil   *string                              `json:"label_until"`
	ReleasePhase EmbeddedActivityPlatformReleasePhase `json:"release_phase"`
}

EmbeddedActivityPlatformConfig mirrors the Discord embedded activity platform config object.

type EmbeddedActivityPlatformReleasePhase

type EmbeddedActivityPlatformReleasePhase string

EmbeddedActivityPlatformReleasePhase is the Discord embedded activity platform release phase enumeration.

const (
	EmbeddedActivityPlatformReleasePhaseInDevelopment   EmbeddedActivityPlatformReleasePhase = "in_development"
	EmbeddedActivityPlatformReleasePhaseActivitiesTeam  EmbeddedActivityPlatformReleasePhase = "activities_team"
	EmbeddedActivityPlatformReleasePhaseEmployeeRelease EmbeddedActivityPlatformReleasePhase = "employee_release"
	EmbeddedActivityPlatformReleasePhaseSoftLaunch      EmbeddedActivityPlatformReleasePhase = "soft_launch"
	EmbeddedActivityPlatformReleasePhaseGlobalLaunch    EmbeddedActivityPlatformReleasePhase = "global_launch"
)

EmbeddedActivityPlatformReleasePhase values.

type EmbeddedActivityUpdateV2Event

type EmbeddedActivityUpdateV2Event struct {
	ApplicationID         string          `json:"application_id"`
	GuildID               string          `json:"guild_id,omitempty"`
	LaunchID              string          `json:"launch_id,omitempty"`
	CompositeInstanceID   string          `json:"composite_instance_id,omitempty"`
	Location              json.RawMessage `json:"location,omitempty"`
	Participants          json.RawMessage `json:"participants,omitempty"`
	ContentClassification json.RawMessage `json:"content_classification,omitempty"`
}

EmbeddedActivityUpdateV2Event is EMBEDDED_ACTIVITY_UPDATE_V2 (web).

type Emoji

type Emoji struct {
	ID            string   `json:"id"`
	Name          string   `json:"name"`
	Roles         []string `json:"roles"`
	User          *User    `json:"user"`
	RequireColons bool     `json:"require_colons"`
	Managed       bool     `json:"managed"`
	Animated      bool     `json:"animated"`
	Available     bool     `json:"available"`
}

Emoji represents a Discord custom emoji

type EmojiReaction

type EmojiReaction struct {
	ID   *string `json:"id"`
	Name string  `json:"name"`
}

EmojiReaction represents an emoji in reactions

type EmojiSource

type EmojiSource struct {
	Type        string          `json:"type"`
	Guild       json.RawMessage `json:"guild,omitempty"`
	Application json.RawMessage `json:"application,omitempty"`
	Pack        json.RawMessage `json:"pack,omitempty"`
}

EmojiSource says where an emoji comes from: Type is "GUILD", "APPLICATION" or "PACK" and the matching field is set.

type EmptyEvent

type EmptyEvent struct{}

EmptyEvent is the payload of events that carry no data (d is null).

type Endpoint

type Endpoint struct {
	Key     string   // catalog key, e.g. "USER_RELATIONSHIPS"
	Path    string   // e.g. "/users/123/relationships" — relative to the API root, no "/api/v9"
	Methods []string // HTTP methods seen in the clients; empty means unknown
}

Endpoint is one concrete REST route: a path with its parameters filled in.

func BuildCDNEndpoint

func BuildCDNEndpoint(key string, args ...string) (Endpoint, error)

BuildCDNEndpoint is BuildEndpoint for the CDN catalog.

func BuildEndpoint

func BuildEndpoint(key string, args ...string) (Endpoint, error)

BuildEndpoint fills a REST template by key with positional arguments. For routes with optional segments, pass either the required arguments only or all of them. It errors on an unknown key or a wrong argument count.

type EndpointInfo

type EndpointInfo struct {
	Key      string   // catalog key
	Template string   // e.g. "/users/{user_id}/relationships"; optional segments are written [/{param}]
	Params   []string // parameter names in order, optional ones included
	Methods  []string
	Sources  string // "W" web, "A" Android, "P" discord.py-self, concatenated
	Area     string

	// Optional lists the parameters that sit in an optional path segment. A
	// route with optional segments accepts len(Params)-len(Optional) arguments
	// (segments omitted) or len(Params) arguments (segments present).
	Optional []string
	// Query lists the inline query keys the client appends to the path. They
	// are not part of Endpoint.Path. A trailing "?" marks an optional key and
	// "key=value" a fixed value the caller must send.
	Query []string
	// Absolute is true when Path is a complete URL instead of an API-relative path.
	Absolute bool
}

EndpointInfo describes one catalog entry (the template, not a concrete path).

func CDNEndpointByKey

func CDNEndpointByKey(key string) (EndpointInfo, bool)

CDNEndpointByKey looks one CDN route up by its catalog key.

func CDNEndpointCatalog

func CDNEndpointCatalog() []EndpointInfo

CDNEndpointCatalog lists every CDN asset route, sorted by key.

func EndpointByKey

func EndpointByKey(key string) (EndpointInfo, bool)

EndpointByKey looks one REST entry up by its catalog key.

func EndpointCatalog

func EndpointCatalog() []EndpointInfo

EndpointCatalog lists every REST entry, sorted by key.

type Entitlement

type Entitlement struct {
	ID               string                   `json:"id"`
	Type             EntitlementType          `json:"type"`
	UserID           string                   `json:"user_id"`
	SKUID            string                   `json:"sku_id"`
	ApplicationID    string                   `json:"application_id"`
	PromotionID      *string                  `json:"promotion_id"`
	ParentID         string                   `json:"parent_id,omitempty"`
	GuildID          string                   `json:"guild_id,omitempty"`
	Branches         []string                 `json:"branches,omitempty"`
	GifterUserID     string                   `json:"gifter_user_id,omitempty"`
	GiftStyle        GiftStyle                `json:"gift_style,omitempty"`
	GiftCodeBatchID  string                   `json:"gift_code_batch_id,omitempty"`
	GiftCodeFlags    int                      `json:"gift_code_flags,omitempty"`
	Deleted          bool                     `json:"deleted"`
	Consumed         bool                     `json:"consumed,omitempty"`
	StartsAt         *time.Time               `json:"starts_at,omitempty"`
	EndsAt           *time.Time               `json:"ends_at,omitempty"`
	SubscriptionID   string                   `json:"subscription_id,omitempty"`
	SubscriptionPlan *PartialSubscriptionPlan `json:"subscription_plan,omitempty"`
	SKU              *PublicSKU               `json:"sku,omitempty"`
}

Entitlement mirrors the Discord entitlement object.

type EntitlementType

type EntitlementType int

EntitlementType is the Discord entitlement type enumeration.

const (
	EntitlementTypePurchase                EntitlementType = 1
	EntitlementTypePremiumSubscription     EntitlementType = 2
	EntitlementTypeDeveloperGift           EntitlementType = 3
	EntitlementTypeTestModePurchase        EntitlementType = 4
	EntitlementTypeFreePurchase            EntitlementType = 5
	EntitlementTypeUserGift                EntitlementType = 6
	EntitlementTypePremiumPurchase         EntitlementType = 7
	EntitlementTypeApplicationSubscription EntitlementType = 8
)

EntitlementType values.

type ErrorResponse

type ErrorResponse struct {
	Code    int             `json:"code"`
	Message string          `json:"message"`
	Errors  json.RawMessage `json:"errors,omitempty"` // recursive map keyed by field name whose leaves are FormErrorWrapper objects
}

ErrorResponse mirrors the Discord error response object.

type Event

type Event[T any] struct {
	Name string
}

Event is a typed descriptor of a dispatch event: its name and the Go type its payload decodes into. The package defines one per known event (EvReady, EvMessageCreate, ...; see events_registry_gen.go). Register handlers with On.

func (Event[T]) Decode

func (e Event[T]) Decode(data []byte) (*T, error)

Decode decodes a raw dispatch payload into T.

type EventHandler

type EventHandler func(event *WebSocketEvent) error

EventHandler is a function that handles WebSocket events

type ExecuteWebhookParams

type ExecuteWebhookParams struct {
	Content         string
	Username        string
	AvatarURL       string
	TTS             bool
	Embeds          []Embed
	AllowedMentions *AllowedMentions
	Components      []Component
	Flags           *int
	Poll            *PollCreate
	StickerIDs      []string

	// Attachments / Files: see SendMessageParams.
	Attachments []PartialAttachment
	Files       []File

	// ThreadName creates a new forum thread named so; AppliedTags tags it.
	ThreadName  string
	AppliedTags []string

	// ThreadID posts into an existing thread (?thread_id=).
	ThreadID string
	// Wait makes Discord answer with the created message (?wait=1). Without it
	// ExecuteWebhook returns a nil message.
	Wait bool

	Null  []string
	Extra map[string]interface{}
}

ExecuteWebhookParams are the options of ExecuteWebhook.

type ExperimentOverride

type ExperimentOverride struct {
	B int   `json:"b"`
	K []int `json:"k"`
}

ExperimentOverride mirrors the Discord experiment override object.

type ExperimentResponse

type ExperimentResponse struct {
	Fingerprint string            `json:"fingerprint,omitempty"`
	Assignments []json.RawMessage `json:"assignments"` // JSON array [int, int, int, -1|0, int, int, 0|1, 0|1, string|null, int|null, int|null]
}

ExperimentResponse mirrors the Discord experiment response object.

type ExperimentResponseWithGuild

type ExperimentResponseWithGuild struct {
	Fingerprint      string            `json:"fingerprint,omitempty"`
	Assignments      []json.RawMessage `json:"assignments"`                 // JSON array [int, int, int, -1|0, int, int, 0|1, 0|1, string|null, int|null, int|null]
	GuildExperiments []json.RawMessage `json:"guild_experiments,omitempty"` // JSON array [int, string|null, int, []Population, []Override, [][]Population, string|null, int|null, 0|1, 0|1]
}

ExperimentResponseWithGuild mirrors the Discord experiment response with guild object.

type ExperimentRolloutData

type ExperimentRolloutData struct {
	S int `json:"s"`
	E int `json:"e"`
}

ExperimentRolloutData mirrors the Discord experiment rollout data object.

type ExperimentSessionOverrideEvent

type ExperimentSessionOverrideEvent struct {
	ExperimentName string          `json:"experiment_name"`
	VariantID      json.RawMessage `json:"variant_id,omitempty"` // CREATE only
}

ExperimentSessionOverrideEvent is EXPERIMENT_SESSION_OVERRIDE_CREATE/DELETE (web).

type ExplicitContentFilterLevel

type ExplicitContentFilterLevel int

ExplicitContentFilterLevel is the Discord explicit content filter level enumeration.

const (
	ExplicitContentFilterLevelDisabled   ExplicitContentFilterLevel = 0
	ExplicitContentFilterLevelNoRole     ExplicitContentFilterLevel = 1
	ExplicitContentFilterLevelAllMembers ExplicitContentFilterLevel = 2
)

ExplicitContentFilterLevel values.

type ExplicitMediaMessage

type ExplicitMediaMessage struct {
	ChannelID string `json:"channel_id"`
	MessageID string `json:"message_id"`
}

ExplicitMediaMessage identifies one message for ScanExplicitMediaMultiChannel.

type ExternalAsset

type ExternalAsset struct {
	URL               string `json:"url"`
	ExternalAssetPath string `json:"external_asset_path"`
}

ExternalAsset mirrors the Discord external asset object.

type ExternalScheduledEvent

type ExternalScheduledEvent struct {
	ID                 string                       `json:"id"`
	GuildID            string                       `json:"guild_id"`
	EntityID           *string                      `json:"entity_id"`
	Name               string                       `json:"name"`
	ScheduledStartTime time.Time                    `json:"scheduled_start_time"`
	PrivacyLevel       PrivacyLevel                 `json:"privacy_level"`
	Status             ScheduledEventStatus         `json:"status"`
	CreatorID          *string                      `json:"creator_id,omitempty"`
	Description        *string                      `json:"description,omitempty"`
	Creator            *User                        `json:"creator,omitempty"`
	UserCount          int                          `json:"user_count,omitempty"`
	Image              *string                      `json:"image,omitempty"`
	SKUIDs             []string                     `json:"sku_ids"`
	ChannelID          json.RawMessage              `json:"channel_id"`
	EntityMetadata     ScheduledEventEntityMetadata `json:"entity_metadata"`
	ScheduledEndTime   time.Time                    `json:"scheduled_end_time"`
	EntityType         ScheduledEventEntityType     `json:"entity_type"` // always 3
}

ExternalScheduledEvent mirrors the Discord external scheduled event object.

type File

type File struct {
	Name        string // filename
	ContentType string // optional; default application/octet-stream
	Data        []byte
	Description string // optional
	Field       string // optional multipart part name; "" => "files[N]"
}

File is one multipart upload part.

type FileComponent

type FileComponent struct {
	Type    ComponentType     `json:"type"`
	ID      int               `json:"id,omitempty"`
	File    UnfurledMediaItem `json:"file"`
	Spoiler bool              `json:"spoiler,omitempty"`
	Name    string            `json:"name,omitempty"`
	Size    int               `json:"size,omitempty"`
}

FileComponent mirrors the Discord file component object.

type FileUploadComponent

type FileUploadComponent struct {
	Type      ComponentType `json:"type"`
	ID        int           `json:"id,omitempty"`
	CustomID  string        `json:"custom_id"`
	MaxValues int           `json:"max_values,omitempty"`
	MinValues int           `json:"min_values,omitempty"`
	Required  bool          `json:"required,omitempty"`
}

FileUploadComponent mirrors the Discord file upload component object.

type FinishWebAuthnLoginParams

type FinishWebAuthnLoginParams struct {
	Source        string
	GiftCodeSKUID string
}

FinishWebAuthnLoginParams are the optional fields of FinishWebAuthnConditionalLogin.

type FollowerWebhook

type FollowerWebhook struct {
	ChannelID     string              `json:"channel_id"`
	WebhookID     string              `json:"webhook_id"`
	SourceChannel *PartialChannel     `json:"source_channel,omitempty"`
	SourceGuild   *WebhookSourceGuild `json:"source_guild,omitempty"`
}

FollowerWebhook mirrors the Discord follower webhook object.

type FormError

type FormError struct {
	Code    string `json:"code"`
	Message string `json:"message"`
}

FormError mirrors the Discord form error object.

type FormErrorWrapper

type FormErrorWrapper struct {
	Errors []FormError `json:"_errors"`
}

FormErrorWrapper mirrors the Discord form error wrapper object.

type FormFieldType

type FormFieldType string

FormFieldType is the Discord form field type enumeration.

const (
	FormFieldTypeTerms          FormFieldType = "TERMS"
	FormFieldTypeTextInput      FormFieldType = "TEXT_INPUT"
	FormFieldTypeParagraph      FormFieldType = "PARAGRAPH"
	FormFieldTypeMultipleChoice FormFieldType = "MULTIPLE_CHOICE"
)

FormFieldType values.

type ForumChannel

type ForumChannel struct {
	ID                            string                 `json:"id"`
	GuildID                       string                 `json:"guild_id"`
	Position                      int                    `json:"position"`
	PermissionOverwrites          []*PermissionOverwrite `json:"permission_overwrites"`
	ParentID                      *string                `json:"parent_id"`
	Name                          string                 `json:"name"`
	Flags                         int                    `json:"flags"`
	Topic                         string                 `json:"topic,omitempty"`
	LastMessageID                 *string                `json:"last_message_id,omitempty"`
	LastPinTimestamp              *time.Time             `json:"last_pin_timestamp,omitempty"`
	RateLimitPerUser              int                    `json:"rate_limit_per_user,omitempty"`
	DefaultThreadRateLimitPerUser int                    `json:"default_thread_rate_limit_per_user,omitempty"`
	DefaultAutoArchiveDuration    ThreadArchiveDuration  `json:"default_auto_archive_duration,omitempty"`
	NSFW                          bool                   `json:"nsfw,omitempty"`
	AvailableTags                 []ForumTag             `json:"available_tags"`
	DefaultReactionEmoji          *DefaultReaction       `json:"default_reaction_emoji"`
	DefaultSortOrder              *ForumOrderType        `json:"default_sort_order"`
	DefaultForumLayout            ForumLayoutType        `json:"default_forum_layout,omitempty"`
	Type                          ChannelType            `json:"type"` // always 15
}

ForumChannel mirrors the Discord forum channel object.

type ForumLayoutType

type ForumLayoutType int

ForumLayoutType is the Discord forum layout type enumeration.

const (
	ForumLayoutTypeNotSet      ForumLayoutType = 0
	ForumLayoutTypeListView    ForumLayoutType = 1
	ForumLayoutTypeGalleryView ForumLayoutType = 2
)

ForumLayoutType values.

type ForumOrderType

type ForumOrderType int

ForumOrderType is the Discord forum order type enumeration.

const (
	ForumOrderTypeLatestActivity ForumOrderType = 0
	ForumOrderTypeCreationDate   ForumOrderType = 1
)

ForumOrderType values.

type ForumTag

type ForumTag struct {
	ID        string  `json:"id"`
	Name      string  `json:"name"`
	Moderated bool    `json:"moderated"`
	EmojiID   *string `json:"emoji_id"`
	EmojiName *string `json:"emoji_name"`
}

ForumTag mirrors the Discord forum tag object.

type ForumTagParams

type ForumTagParams struct {
	EmojiID   string // custom emoji ID
	EmojiName string // unicode emoji or custom emoji name
	Moderated bool   // only moderators can apply the tag
}

ForumTagParams are the optional fields of CreateForumTag / EditForumTag.

type ForumThread

type ForumThread struct {
	ID               string          `json:"id"`
	GuildID          string          `json:"guild_id"`
	ParentID         string          `json:"parent_id"`
	OwnerID          string          `json:"owner_id"`
	Name             string          `json:"name"`
	Type             ThreadType      `json:"type"`
	MemberCount      int             `json:"member_count"`
	MessageCount     int             `json:"message_count"`
	TotalMessageSent int             `json:"total_message_sent"`
	RateLimitPerUser int             `json:"rate_limit_per_user"`
	ThreadMetadata   *ThreadMetadata `json:"thread_metadata"`
	MemberIDsPreview []string        `json:"member_ids_preview"`
	Member           *ThreadMember   `json:"member,omitempty"`
	LastMessageID    *string         `json:"last_message_id,omitempty"`
	LastPinTimestamp *time.Time      `json:"last_pin_timestamp,omitempty"`
	NewlyCreated     bool            `json:"newly_created,omitempty"`
	Flags            int             `json:"flags,omitempty"`
	AppliedTags      []string        `json:"applied_tags,omitempty"`
	Message          *Message        `json:"message"`
}

ForumThread mirrors the Discord forum thread object.

type ForumUnreadThread

type ForumUnreadThread struct {
	ThreadID string `json:"thread_id"`
	Missing  bool   `json:"missing,omitempty"`
	Count    *int   `json:"count,omitempty"`
}

ForumUnreadThread is one thread of FORUM_UNREADS.

type ForumUnreadsEvent

type ForumUnreadsEvent struct {
	ChannelID        string              `json:"channel_id"`
	PermissionDenied bool                `json:"permission_denied,omitempty"`
	Threads          []ForumUnreadThread `json:"threads"`
}

ForumUnreadsEvent is FORUM_UNREADS, the answer to op 28 REQUEST_FORUM_UNREADS (web).

type ForumUnreadsThread

type ForumUnreadsThread struct {
	ThreadID     string `json:"thread_id"`
	AckMessageID string `json:"ack_message_id"`
}

ForumUnreadsThread is one thread of op 28.

type FriendSuggestion

type FriendSuggestion struct {
	SuggestedUser             *User                    `json:"suggested_user"`
	Reasons                   []FriendSuggestionReason `json:"reasons"`
	FromSuggestedUserContacts bool                     `json:"from_suggested_user_contacts,omitempty"`
}

FriendSuggestion mirrors the Discord friend suggestion object.

type FriendSuggestionDeleteEvent

type FriendSuggestionDeleteEvent struct {
	SuggestedUserID string `json:"suggested_user_id"`
}

FriendSuggestionDeleteEvent is FRIEND_SUGGESTION_DELETE.

type FriendSuggestionEvent

type FriendSuggestionEvent struct {
	SuggestedUserID string `json:"suggested_user_id"`
	Reasons         []struct {
		Type int    `json:"type"`
		Name string `json:"name"`
	} `json:"reasons,omitempty"`
}

FriendSuggestionEvent represents friend suggestion events

type FriendSuggestionReason

type FriendSuggestionReason struct {
	Name         string         `json:"name"`
	PlatformType ConnectionType `json:"platform_type"`
	Type         int            `json:"type"` // always 1
}

FriendSuggestionReason mirrors the Discord friend suggestion reason object.

type Game

type Game struct {
	Name string `json:"name"`
	Type int    `json:"type"`
}

Game represents a Discord game status

type GameActivity

type GameActivity struct {
	ActivityLevel int `json:"activity_level"`
	ActivityScore int `json:"activity_score"`
}

GameActivity mirrors the Discord game activity object.

type GameRelationshipEvent

type GameRelationshipEvent struct {
	ID            string          `json:"id"`
	ApplicationID string          `json:"application_id"`
	Type          json.RawMessage `json:"type,omitempty"`
	DMAccessType  json.RawMessage `json:"dm_access_type,omitempty"`
	Since         *string         `json:"since,omitempty"`
	User          *User           `json:"user,omitempty"`
}

GameRelationshipEvent is GAME_RELATIONSHIP_ADD (web).

type GameRelationshipRemoveEvent

type GameRelationshipRemoveEvent struct {
	ID            string `json:"id"`
	ApplicationID string `json:"application_id"`
}

GameRelationshipRemoveEvent is GAME_RELATIONSHIP_REMOVE (web).

type GameServerDeleteEvent

type GameServerDeleteEvent struct {
	GuildID      string `json:"guild_id"`
	GameServerID string `json:"game_server_id"`
}

GameServerDeleteEvent is GAME_SERVER_DELETE (web).

type GameServerEvent

type GameServerEvent struct {
	GuildID    string          `json:"guild_id"`
	GameServer json.RawMessage `json:"game_server,omitempty"`
}

GameServerEvent is GAME_SERVER_CREATE/UPDATE (web).

type GatewayClosedError

type GatewayClosedError struct {
	Code   int
	Reason string
}

GatewayClosedError is the error a session ends with when the server closes it with a code that cannot be recovered from (4004 authentication failed, 4010-4014), as in discord.py-self.

func (*GatewayClosedError) Error

func (e *GatewayClosedError) Error() string

type GatewayCompression

type GatewayCompression string

GatewayCompression selects the transport compression of the gateway connection.

const (
	// GatewayCompressionAuto picks what the presented client uses: zstd-stream
	// for the desktop client types, zlib-stream for the web client.
	GatewayCompressionAuto GatewayCompression = ""
	// GatewayCompressionZstdStream is one zstd stream for the whole connection,
	// flushed after each message (Electron/native clients).
	GatewayCompressionZstdStream GatewayCompression = "zstd-stream"
	// GatewayCompressionZlibStream is one zlib stream for the whole connection,
	// each message ending with a Z_SYNC_FLUSH (browsers).
	GatewayCompressionZlibStream GatewayCompression = "zlib-stream"
	// GatewayCompressionNone sends no compress parameter and IDENTIFY compress:false,
	// so the gateway sends plain JSON text frames.
	GatewayCompressionNone GatewayCompression = "none"
	// GatewayCompressionPayload sends no compress parameter and IDENTIFY
	// compress:true: large payloads arrive as individually zlib-compressed binary
	// messages. This is what both reference clients do when they cannot use a
	// stream compression.
	GatewayCompressionPayload GatewayCompression = "payload"
)

type GatewayEvent

type GatewayEvent struct {
	Op   int             `json:"op"`
	Data json.RawMessage `json:"d"`
	Type string          `json:"t"`
}

GatewayEvent represents a Discord Gateway event

type GatewayGift

type GatewayGift struct {
	Code      string `json:"code"`
	Uses      int    `json:"uses"`
	SKUID     string `json:"sku_id"`
	ChannelID string `json:"channel_id,omitempty"`
	GuildID   string `json:"guild_id,omitempty"`
}

GatewayGift mirrors the Discord gateway gift object.

type GatewayGuild

type GatewayGuild struct {
	GuildProperties
	Properties *GuildProperties `json:"properties,omitempty"`

	DataMode                 string `json:"data_mode,omitempty"` // "full" or "partial"
	Version                  int64  `json:"version,omitempty"`
	Unavailable              bool   `json:"unavailable,omitempty"`
	GeoRestricted            bool   `json:"geo_restricted,omitempty"`
	JoinedAt                 string `json:"joined_at,omitempty"`
	Large                    bool   `json:"large,omitempty"`
	Lazy                     bool   `json:"lazy,omitempty"`
	MemberCount              int    `json:"member_count,omitempty"`
	PremiumSubscriptionCount int    `json:"premium_subscription_count,omitempty"`
	UnableToSyncDeletes      bool   `json:"unable_to_sync_deletes,omitempty"`

	Channels             []Channel             `json:"channels,omitempty"`
	Threads              []ThreadEvent         `json:"threads,omitempty"`
	Roles                []Role                `json:"roles,omitempty"`
	Emojis               []Emoji               `json:"emojis,omitempty"`
	Stickers             []GuildSticker        `json:"stickers,omitempty"`
	GuildScheduledEvents []GuildScheduledEvent `json:"guild_scheduled_events,omitempty"`
	StageInstances       []StageInstance       `json:"stage_instances,omitempty"`
	VoiceStates          []VoiceState          `json:"voice_states,omitempty"`
	Members              []GuildMemberEvent    `json:"members,omitempty"`
	Presences            []PresenceUpdateEvent `json:"presences,omitempty"`

	// Not established.
	ApplicationCommandCounts json.RawMessage `json:"application_command_counts,omitempty"`
	EmbeddedActivities       json.RawMessage `json:"embedded_activities,omitempty"`
	ActivityInstances        json.RawMessage `json:"activity_instances,omitempty"`
	PartialUpdates           json.RawMessage `json:"partial_updates,omitempty"` // data_mode "partial"
}

GatewayGuild is a guild as the gateway sends it in READY guilds, GUILD_CREATE, GUILD_UPDATE and INITIAL_GUILD. Both layouts decode: the guild fields are either in the embedded GuildProperties (top level) or in Properties (client_state_v2). Use Props to read them either way.

func (*GatewayGuild) GuildID

func (g *GatewayGuild) GuildID() string

GuildID returns the guild ID from either layout.

func (*GatewayGuild) Props

func (g *GatewayGuild) Props() *GuildProperties

Props returns the guild fields from whichever layout the payload used.

func (*GatewayGuild) ToGuild

func (g *GatewayGuild) ToGuild() *Guild

ToGuild converts to the library's compact Guild.

type GatewayMessageEvent

type GatewayMessageEvent struct {
	Message Message `json:"message"`
}

GatewayMessageEvent represents a message event

type GatewayOptions

type GatewayOptions struct {
	// URL is the gateway base URL. Empty means DefaultGatewayURL, which is where
	// the web and desktop clients connect without a REST lookup.
	URL string
	// LookupURL fetches the base URL from GET /gateway (API v9, through the
	// client's own HTTP stack) before the first connection, as bots do. No
	// official client does this. Ignored when URL is set.
	LookupURL bool
	// Compression selects the transport compression (default: by client type).
	Compression GatewayCompression
	// Capabilities sent in IDENTIFY. Zero means CapabilitiesDefault (22525).
	Capabilities Capabilities
	// LegacyHeartbeat keeps alive with op 1 HEARTBEAT {d: seq} instead of op 40
	// QOS_HEARTBEAT, and does not send op 41.
	LegacyHeartbeat bool
	// NoInitialVoiceState disables the op 4 (all fields null) both reference
	// clients send once the session is established.
	NoInitialVoiceState bool
	// NoQOSToken omits qos_token from IDENTIFY (discord.py-self does not send it;
	// the web client always does).
	NoQOSToken bool
	// MaxReconnectAttempts bounds consecutive failed reconnects; 0 means retry
	// forever with backoff (1 s doubling to 60 s, as the web client does).
	MaxReconnectAttempts int
}

GatewayOptions configures the gateway connection. The zero value behaves like the client type the Config presents as.

type GatewayPayload

type GatewayPayload struct {
	Op       int             `json:"op"`
	Data     json.RawMessage `json:"d"`
	Type     string          `json:"t,omitempty"`
	Sequence *int64          `json:"s,omitempty"`
}

GatewayPayload represents a Discord Gateway message

type GatewayProtoSettings

type GatewayProtoSettings struct {
	Proto string            `json:"proto"`
	Type  ProtoSettingsType `json:"type"`
}

GatewayProtoSettings is the settings object of USER_SETTINGS_PROTO_UPDATE: a base64 protobuf of the given settings type.

type GatewayReadyEvent

type GatewayReadyEvent struct {
	User    User    `json:"user"`
	Guilds  []Guild `json:"guilds"`
	Session string  `json:"session_id"`
}

GatewayReadyEvent represents the ready event data

type GatewayResponse

type GatewayResponse struct {
	URL string `json:"url"`
}

GatewayResponse is the response of GET /gateway.

func (GatewayResponse) WebSocketURL

func (g GatewayResponse) WebSocketURL(encoding, compress string) string

WebSocketURL builds the gateway connection URL as discord.py-self does (encoding json by default, API version 9). compress may be "" or "zlib-stream".

type GenericPushNotificationSentEvent

type GenericPushNotificationSentEvent struct {
	Title        string          `json:"title"`
	Body         string          `json:"body"`
	Icon         *string         `json:"icon,omitempty"`
	Tag          *string         `json:"tag,omitempty"`
	Route        json.RawMessage `json:"route,omitempty"`
	TrackingType json.RawMessage `json:"tracking_type,omitempty"`
}

GenericPushNotificationSentEvent is GENERIC_PUSH_NOTIFICATION_SENT (web).

type GetActivitySecretParams

type GetActivitySecretParams struct {
	ChannelID string
	MessageID string
}

GetActivitySecretParams are the options of GetActivitySecret.

type GetAllIntegrationsParams

type GetAllIntegrationsParams struct {
	// IncludeApplications includes the bot integrations (default true).
	IncludeApplications *bool
	// IncludeRoleConnectionsMetadata includes the linked-role metadata of applications.
	IncludeRoleConnectionsMetadata bool
	// HasCommands only returns integrations that have application commands.
	HasCommands bool
}

GetAllIntegrationsParams are the optional parts of GetAllIntegrations.

type GetAllMessagesOptions

type GetAllMessagesOptions struct {
	Limit       int                  // Maximum number of messages to fetch (0 = unlimited)
	Before      string               // Start fetching before this message ID (optional)
	After       string               // Start fetching after this message ID (optional)
	OldestFirst *bool                // If true, return messages oldest->newest; defaults to true when After is set
	ProgressCB  func(p ProgressInfo) // Optional progress callback
}

GetAllMessagesOptions contains options for fetching all messages from a channel. Mirrors discord.py-self history() parameters for pagination and ordering.

type GetAppEntitlementsParams

type GetAppEntitlementsParams struct {
	UserID         string
	GuildID        string
	SKUIDs         []string
	ExcludeEnded   bool
	ExcludeDeleted *bool // default true
	Before         string
	After          string
	Limit          int // default 100; sent when different
}

GetAppEntitlementsParams are the options of GetAppEntitlements.

type GetAppSKUsParams

type GetAppSKUsParams struct {
	CountryCode     string
	Localize        *bool // nil/true: localised names (default); false sends localize=false
	WithBundledSKUs *bool // default true
}

GetAppSKUsParams are the options of GetAppSKUs.

type GetAuditLogsParams

type GetAuditLogsParams struct {
	Limit      *int // default 100
	Before     string
	After      string
	UserID     string
	ActionType *AuditLogEvent
}

GetAuditLogsParams are the filters of GetAuditLogs.

type GetBansParams

type GetBansParams struct {
	Limit  *int // default 1000
	Before string
	After  string
}

GetBansParams are the optional parts of GetBans.

type GetDiscoverableGuildsParams

type GetDiscoverableGuildsParams struct {
	Offset     *int
	Limit      *int
	Categories []int // discovery category IDs
}

GetDiscoverableGuildsParams are the optional parts of GetDiscoverableGuilds.

type GetExperimentsParams

type GetExperimentsParams struct {
	// WithGuildExperiments defaults to true (discord.py-self always sends it).
	WithGuildExperiments *bool
	// Platform is the optional platform filter (for example "desktop").
	Platform string
	// NoAuth drops the Authorization header: the logged-out request that
	// bootstraps a fingerprint before login.
	NoAuth bool
}

GetExperimentsParams are the options of GetExperiments.

type GetGiftParams

type GetGiftParams struct {
	CountryCode          string
	WithApplication      bool
	WithSubscriptionPlan *bool // default true
}

GetGiftParams are the options of GetGift.

type GetGlobalActivityStatisticsParams

type GetGlobalActivityStatisticsParams struct {
	WithUsers        bool
	WithApplications bool
}

GetGlobalActivityStatisticsParams are the options of GetGlobalActivityStatistics.

type GetGuildApplicationsParams

type GetGuildApplicationsParams struct {
	Type        *int
	IncludeTeam bool
	ChannelID   string
}

GetGuildApplicationsParams are the optional parts of GetGuildApplications.

type GetGuildEntitlementsParams

type GetGuildEntitlementsParams struct {
	WithSKU         *bool // default true
	WithApplication *bool // default true
	ExcludeEnded    *bool // default false
	ExcludeDeleted  *bool // default true
	EntitlementType *int
}

GetGuildEntitlementsParams are the optional parts of GetGuildEntitlements.

type GetGuildParams

type GetGuildParams struct {
	// WithCounts asks for approximate member and presence counts (default true).
	WithCounts *bool
}

GetGuildParams are the optional parts of GetGuild.

type GetInviteParams

type GetInviteParams struct {
	WithCounts      *bool
	WithPermissions *bool
	WithProfile     *bool
	// GuildScheduledEventID asks for the scheduled event as well.
	GuildScheduledEventID string
	// InputValue is the text the invite was entered as.
	InputValue string
}

GetInviteParams are the optional parts of GetInvite. The With* options default to true when nil, as in discord.py-self.

type GetJoinRequestsParams

type GetJoinRequestsParams struct {
	Limit  *int // default 100
	Before string
	After  string
}

GetJoinRequestsParams are the optional parts of GetJoinRequests.

type GetMeParams

type GetMeParams struct {
	// WithAnalyticsToken asks for the analytics token; nil means true (discord.py-self default).
	WithAnalyticsToken *bool
}

GetMeParams are the options of GetMe.

type GetMemberVerificationParams

type GetMemberVerificationParams struct {
	// WithGuild includes a guild preview in the answer.
	WithGuild bool
	// InviteCode is the invite the lookup is made through (for guilds you have not joined).
	InviteCode string
}

GetMemberVerificationParams are the optional parts of GetMemberVerification.

type GetMessagesOptions

type GetMessagesOptions struct {
	Before string // Get messages before this message ID (optional)
	After  string // Get messages after this message ID (optional)
	Around string // Get messages around this message ID (optional, max limit 101)
	Limit  int    // Number of messages to fetch (default 50, max 100 unless Around is set)
}

GetMessagesOptions contains options for fetching messages from a channel

type GetMyApplicationsParams

type GetMyApplicationsParams struct {
	WithTeamApplications *bool // default true (discord.py-self always sends it)
}

GetMyApplicationsParams are the options of GetMyApplications.

type GetPaymentsParams

type GetPaymentsParams struct {
	Before string // payment ID cursor
	After  string // payment ID cursor
}

GetPaymentsParams are the options of GetPayments.

type GetPriceTiersParams

type GetPriceTiersParams struct {
	Type    int // price_tier_type; sent when non-zero
	GuildID string
}

GetPriceTiersParams are the options of GetPriceTiers.

type GetScheduledEventUsersParams

type GetScheduledEventUsersParams struct {
	Limit      *int // default 100
	WithMember bool // include each user's guild member
	Before     string
	After      string
}

GetScheduledEventUsersParams are the optional parts of GetScheduledEventUsers.

type GetSubscriptionsParams

type GetSubscriptionsParams struct {
	Limit           *int
	IncludeInactive bool
}

GetSubscriptionsParams are the options of GetSubscriptions.

type GetTeamPayoutsParams

type GetTeamPayoutsParams struct {
	Limit  int    // default 96 (discord.py-self always sends it)
	Before string // payout ID cursor
}

GetTeamPayoutsParams are the options of GetTeamPayouts.

type GetTeamsParams

type GetTeamsParams struct {
	IncludePayoutAccountStatus bool
}

GetTeamsParams are the options of GetTeams.

type GetUserAppEntitlementsParams

type GetUserAppEntitlementsParams struct {
	SKUIDs          []string
	ExcludeConsumed *bool // nil means true (discord.py-self default)
}

GetUserAppEntitlementsParams are the options of GetUserAppEntitlements.

type GetUserEntitlementsParams

type GetUserEntitlementsParams struct {
	WithSKU         *bool // nil means true
	WithApplication *bool // nil means true
	ExcludeEnded    *bool // nil means false
	EntitlementType *int
}

GetUserEntitlementsParams are the options of GetUserEntitlements.

type GetUserGuildsParams

type GetUserGuildsParams struct {
	WithCounts *bool  // nil means true (discord.py-self default)
	Before     string // guild ID cursor
	After      string // guild ID cursor
	Limit      *int   // 1-200
}

GetUserGuildsParams are the options of GetGuilds.

type GetUserOfferParams

type GetUserOfferParams struct {
	PaymentGateway *PaymentGateway `json:"payment_gateway,omitempty"`
	OfferID        string          `json:"offer_id,omitempty"`
}

GetUserOfferParams are the options of GetUserOffer.

type GetUserProfileParams

type GetUserProfileParams struct {
	GuildID                string // include the user's profile in this guild
	WithMutualGuilds       *bool  // nil means true (discord.py-self default)
	WithMutualFriends      *bool  // nil means false
	WithMutualFriendsCount *bool  // nil means false
}

GetUserProfileParams are the options of GetUserProfile.

type GetUserSurveyParams

type GetUserSurveyParams struct {
	SurveyOverride  string
	DisableAutoSeen *bool
}

GetUserSurveyParams are the options of GetUserSurvey.

type GifQueryParams

type GifQueryParams struct {
	Locale      string // e.g. "en-US"
	MediaFormat string // e.g. "mp4", "gif"
	Limit       int    // 0 = server default
}

GifQueryParams are the common options of the GIF picker routes.

type Gift

type Gift struct {
	Code                string              `json:"code"`
	Uses                int                 `json:"uses"`
	SKUID               string              `json:"sku_id"`
	ChannelID           string              `json:"channel_id,omitempty"`
	GuildID             string              `json:"guild_id,omitempty"`
	ExpiresAt           *time.Time          `json:"expires_at"`
	ApplicationID       string              `json:"application_id"`
	BatchID             string              `json:"batch_id,omitempty"`
	EntitlementBranches []string            `json:"entitlement_branches,omitempty"`
	GiftStyle           *GiftStyle          `json:"gift_style,omitempty"`
	Flags               int                 `json:"flags"`
	MaxUses             int                 `json:"max_uses"`
	Redeemed            bool                `json:"redeemed"`
	Revoked             bool                `json:"revoked,omitempty"`
	StoreListing        *PublicStoreListing `json:"store_listing,omitempty"`
	Promotion           *Promotion          `json:"promotion,omitempty"`
	SubscriptionTrial   *SubscriptionTrial  `json:"subscription_trial,omitempty"`
	SubscriptionPlanID  string              `json:"subscription_plan_id,omitempty"`
	SubscriptionPlan    *SubscriptionPlan   `json:"subscription_plan,omitempty"`
	User                *User               `json:"user,omitempty"`
}

Gift mirrors the Discord gift object.

type GiftBatch

type GiftBatch struct {
	ID                  string     `json:"id"`
	SKUID               string     `json:"sku_id"`
	Amount              int        `json:"amount"`
	Description         string     `json:"description,omitempty"`
	EntitlementBranches []string   `json:"entitlement_branches,omitempty"`
	EntitlementStartsAt *time.Time `json:"entitlement_starts_at,omitempty"`
	EntitlementEndsAt   *time.Time `json:"entitlement_ends_at,omitempty"`
}

GiftBatch mirrors the Discord gift batch object.

type GiftStyle

type GiftStyle int

GiftStyle is the Discord gift style enumeration.

const (
	GiftStyleSnowglobe GiftStyle = 1
	GiftStyleBox       GiftStyle = 2
	GiftStyleCup       GiftStyle = 3
)

GiftStyle values.

type GlobalActivityStatistics

type GlobalActivityStatistics struct {
	ApplicationID string              `json:"application_id"`
	Application   *PartialApplication `json:"application,omitempty"`
	UserID        string              `json:"user_id"`
	User          *User               `json:"user,omitempty"`
	Duration      int                 `json:"duration"`
	UpdatedAt     time.Time           `json:"updated_at"`
}

GlobalActivityStatistics mirrors the Discord global activity statistics object.

type GravityMessageItem

type GravityMessageItem struct {
	ChannelID string `json:"channel_id"`
	MessageID string `json:"message_id"`
}

GravityMessageItem names a message to hydrate in GetGravityContent.

type GroupDMChannel

type GroupDMChannel struct {
	ID              string            `json:"id"`
	Type            ChannelType       `json:"type"` // always 3
	Name            *string           `json:"name"`
	Icon            *string           `json:"icon"`
	OwnerID         string            `json:"owner_id"`
	ApplicationID   string            `json:"application_id,omitempty"`
	Managed         bool              `json:"managed,omitempty"`
	Nicks           []GroupDMNickname `json:"nicks,omitempty"`
	Recipients      []*User           `json:"recipients"`
	OriginChannelID string            `json:"origin_channel_id,omitempty"` // Only present in CHANNEL_CREATE
}

GroupDMChannel mirrors the Discord group dm channel object.

type GroupDMNickname

type GroupDMNickname struct {
	ID   string `json:"id"`
	Nick string `json:"nick"`
}

GroupDMNickname mirrors the Discord group dm nickname object.

type Guild

type Guild struct {
	ID          string    `json:"id"`
	Name        string    `json:"name"`
	Icon        string    `json:"icon"`
	Description string    `json:"description"`
	OwnerID     string    `json:"owner_id"`
	Region      string    `json:"region"`
	MemberCount int       `json:"member_count"`
	Channels    []Channel `json:"channels,omitempty"`
}

Guild represents a Discord guild/server

type GuildAffinities

type GuildAffinities struct {
	GuildAffinities []GuildAffinity `json:"guild_affinities"`
}

GuildAffinities mirrors the Discord guild affinities object.

type GuildAffinity

type GuildAffinity struct {
	GuildID  string  `json:"guild_id"`
	Affinity float64 `json:"affinity"`
}

GuildAffinity mirrors the Discord guild affinity object.

type GuildApplicationCommandIndex

type GuildApplicationCommandIndex struct {
	ApplicationCommands []ApplicationCommand `json:"application_commands"`
	Applications        []CommandApplication `json:"applications"`
	Version             string               `json:"version"`
}

GuildApplicationCommandIndex mirrors the Discord guild application command index object.

type GuildApplicationCommandIndexUpdateEvent

type GuildApplicationCommandIndexUpdateEvent struct {
	GuildID string          `json:"guild_id"`
	Version json.RawMessage `json:"version,omitempty"`
}

GuildApplicationCommandIndexUpdateEvent is GUILD_APPLICATION_COMMAND_INDEX_UPDATE.

type GuildApplicationCommandPermissions

type GuildApplicationCommandPermissions struct {
	ID            string                          `json:"id"`
	ApplicationID string                          `json:"application_id"`
	GuildID       string                          `json:"guild_id"`
	Permissions   []ApplicationCommandPermissions `json:"permissions"`
}

GuildApplicationCommandPermissions mirrors the Discord guild application command permissions object.

type GuildAppliedBoostsUpdateEvent

type GuildAppliedBoostsUpdateEvent struct {
	GuildID string `json:"guild_id"`
}

GuildAppliedBoostsUpdateEvent is GUILD_APPLIED_BOOSTS_UPDATE (web; only guild_id is read by the client).

type GuildAuditLogEntryCreateEvent

type GuildAuditLogEntryCreateEvent struct {
	AuditLogEntry
	GuildID string `json:"guild_id"`
}

GuildAuditLogEntryCreateEvent is GUILD_AUDIT_LOG_ENTRY_CREATE.

type GuildBan

type GuildBan struct {
	Reason *string `json:"reason"`
	User   *User   `json:"user"`
}

GuildBan mirrors the Discord guild ban object.

type GuildBanEvent

type GuildBanEvent struct {
	GuildID string `json:"guild_id"`
	User    User   `json:"user"`
}

GuildBanEvent is GUILD_BAN_ADD/REMOVE.

type GuildBulkBanUpdateEvent

type GuildBulkBanUpdateEvent struct {
	GuildID string               `json:"guild_id"`
	BulkBan *BulkBanUserResponse `json:"bulk_ban,omitempty"`
}

GuildBulkBanUpdateEvent is GUILD_BULK_BAN_UPDATE (web).

type GuildChannel

type GuildChannel struct {
	ID                            string                 `json:"id"`
	GuildID                       string                 `json:"guild_id"`
	Position                      int                    `json:"position,omitempty"`
	PermissionOverwrites          []*PermissionOverwrite `json:"permission_overwrites,omitempty"`
	ParentID                      *string                `json:"parent_id"`
	Name                          string                 `json:"name,omitempty"`
	Flags                         int                    `json:"flags"`
	Topic                         *string                `json:"topic,omitempty"`
	LastMessageID                 *string                `json:"last_message_id,omitempty"`
	LastPinTimestamp              *time.Time             `json:"last_pin_timestamp,omitempty"`
	RateLimitPerUser              int                    `json:"rate_limit_per_user,omitempty"`
	DefaultThreadRateLimitPerUser int                    `json:"default_thread_rate_limit_per_user,omitempty"`
	DefaultAutoArchiveDuration    ThreadArchiveDuration  `json:"default_auto_archive_duration,omitempty"`
	NSFW                          bool                   `json:"nsfw,omitempty"`
	Type                          ChannelType            `json:"type"`
	Bitrate                       int                    `json:"bitrate,omitempty"`
	UserLimit                     int                    `json:"user_limit,omitempty"`
	RTCRegion                     *string                `json:"rtc_region,omitempty"`
	VideoQualityMode              VideoQualityMode       `json:"video_quality_mode,omitempty"`
	OwnerID                       string                 `json:"owner_id,omitempty"`
	MessageCount                  int                    `json:"message_count,omitempty"`
	MemberCount                   int                    `json:"member_count,omitempty"`
	TotalMessageSent              int                    `json:"total_message_sent,omitempty"`
	ThreadMetadata                *ThreadMetadata        `json:"thread_metadata,omitempty"`
	Member                        *ThreadMember          `json:"member,omitempty"`
	AppliedTags                   []string               `json:"applied_tags,omitempty"`
	AvailableTags                 []ForumTag             `json:"available_tags,omitempty"`
	DefaultReactionEmoji          *DefaultReaction       `json:"default_reaction_emoji,omitempty"`
	DefaultSortOrder              *ForumOrderType        `json:"default_sort_order,omitempty"`
	DefaultForumLayout            ForumLayoutType        `json:"default_forum_layout,omitempty"`
}

GuildChannel is the flattened superset of the 9 guild channel variants; fields absent from a variant are omitted.

type GuildDeleteEvent

type GuildDeleteEvent struct {
	ID          string `json:"id"`
	Unavailable bool   `json:"unavailable,omitempty"`
	// Set when the guild is hidden for geo-restriction (the web client shows Name/Icon).
	GeoRestricted bool    `json:"geo_restricted,omitempty"`
	Name          string  `json:"name,omitempty"`
	Icon          *string `json:"icon,omitempty"`
}

GuildDeleteEvent represents a guild deletion (or leaving)

type GuildEmojisUpdateEvent

type GuildEmojisUpdateEvent struct {
	GuildID string  `json:"guild_id"`
	Emojis  []Emoji `json:"emojis"`
}

GuildEmojisUpdateEvent is GUILD_EMOJIS_UPDATE.

type GuildEventRecurrenceRule

type GuildEventRecurrenceRule struct {
	Start      string  `json:"start"`
	End        *string `json:"end"`
	Frequency  int     `json:"frequency"`
	Interval   int     `json:"interval"`
	ByWeekday  []int   `json:"by_weekday"`
	ByNWeekday []struct {
		N   int `json:"n"`
		Day int `json:"day"`
	} `json:"by_n_weekday"`
	ByMonth    []int `json:"by_month"`
	ByMonthDay []int `json:"by_month_day"`
	ByYearDay  []int `json:"by_year_day"`
	Count      *int  `json:"count"`
}

GuildEventRecurrenceRule is the recurrence rule of a recurring scheduled event, as the web client sends it. Start and End are RFC 3339 times.

type GuildIntegrationsUpdateEvent

type GuildIntegrationsUpdateEvent struct {
	GuildID string `json:"guild_id"`
}

GuildIntegrationsUpdateEvent is GUILD_INTEGRATIONS_UPDATE.

type GuildJoinRequestDeleteEvent

type GuildJoinRequestDeleteEvent struct {
	GuildID string `json:"guild_id"`
	ID      string `json:"id"`
	UserID  string `json:"user_id"`
}

GuildJoinRequestDeleteEvent is GUILD_JOIN_REQUEST_DELETE.

type GuildJoinRequestEvent

type GuildJoinRequestEvent struct {
	GuildID string            `json:"guild_id"`
	Request JoinRequest       `json:"request"`
	Status  JoinRequestStatus `json:"status"`
}

GuildJoinRequestEvent is GUILD_JOIN_REQUEST_CREATE/UPDATE.

type GuildMFALevel

type GuildMFALevel struct {
	Level MFALevel `json:"level"`
}

GuildMFALevel mirrors the Discord guild mfa level object.

type GuildMember

type GuildMember struct {
	User                       *User      `json:"user"`
	Nick                       *string    `json:"nick"`
	Avatar                     *string    `json:"avatar"`
	Roles                      []string   `json:"roles"`
	JoinedAt                   *time.Time `json:"joined_at"`
	PremiumSince               *time.Time `json:"premium_since"`
	Deaf                       bool       `json:"deaf"`
	Mute                       bool       `json:"mute"`
	Flags                      int        `json:"flags"`
	Pending                    bool       `json:"pending"`
	CommunicationDisabledUntil *time.Time `json:"communication_disabled_until"`
}

GuildMember represents a Discord guild member with user info

type GuildMemberEvent

type GuildMemberEvent struct {
	GuildID                    string   `json:"guild_id"`
	User                       User     `json:"user"`
	Nick                       *string  `json:"nick"`
	Avatar                     *string  `json:"avatar"`
	Roles                      []string `json:"roles"`
	JoinedAt                   string   `json:"joined_at"`
	PremiumSince               *string  `json:"premium_since"`
	Deaf                       bool     `json:"deaf"`
	Mute                       bool     `json:"mute"`
	Flags                      int      `json:"flags"`
	Pending                    bool     `json:"pending"`
	Permissions                string   `json:"permissions,omitempty"`
	CommunicationDisabledUntil *string  `json:"communication_disabled_until"`

	// UserID replaces User in deduplicated payloads (READY merged_members).
	UserID                 string                `json:"user_id,omitempty"`
	Banner                 *string               `json:"banner,omitempty"`
	AvatarDecorationData   *AvatarDecorationData `json:"avatar_decoration_data,omitempty"`
	Presence               *BasePresenceUpdate   `json:"presence,omitempty"` // GUILD_MEMBER_ADD
	UnusualDMActivityUntil *string               `json:"unusual_dm_activity_until,omitempty"`
	// Fields the web client reads whose shape is not established.
	Collectibles                json.RawMessage `json:"collectibles,omitempty"`
	DisplayNameStyles           json.RawMessage `json:"display_name_styles,omitempty"`
	MemberGamingLeaderboardData json.RawMessage `json:"member_gaming_leaderboard_data,omitempty"`
}

GuildMemberEvent represents guild member related events

type GuildMemberListGroup

type GuildMemberListGroup struct {
	ID    string `json:"id"`
	Count int    `json:"count"`
}

GuildMemberListGroup represents a member list group

type GuildMemberListOP

type GuildMemberListOP struct {
	Op    string        `json:"op"`
	Range []int         `json:"range,omitempty"`
	Index int           `json:"index,omitempty"`
	Items []interface{} `json:"items,omitempty"`
	Item  interface{}   `json:"item,omitempty"`
}

GuildMemberListOP represents member list operations

type GuildMemberListUpdateEvent

type GuildMemberListUpdateEvent struct {
	ID          string                 `json:"id"`
	GuildID     string                 `json:"guild_id"`
	MemberCount int                    `json:"member_count"`
	OnlineCount int                    `json:"online_count"`
	Groups      []GuildMemberListGroup `json:"groups"`
	Ops         []GuildMemberListOP    `json:"ops"`
}

GuildMemberListUpdateEvent represents guild member list updates

type GuildMemberRemoveEvent

type GuildMemberRemoveEvent struct {
	GuildID string `json:"guild_id"`
	User    User   `json:"user"`
}

GuildMemberRemoveEvent is GUILD_MEMBER_REMOVE.

type GuildMemberSearchQuery

type GuildMemberSearchQuery struct {
	OrQuery  map[string]interface{} `json:"or_query"`
	AndQuery map[string]interface{} `json:"and_query"`
	Sort     string                 `json:"sort,omitempty"`
	Limit    *int                   `json:"limit,omitempty"`
	Before   string                 `json:"before,omitempty"`
	After    string                 `json:"after,omitempty"`
}

GuildMemberSearchQuery is the body of SearchGuildMembers, the member safety page search. OrQuery and AndQuery map a field to its filter, for example {"usernames": {"or_query": ["neo"]}, "role_ids": {"and_query": ["1"]}, "guild_joined_at": {"range": {"gte": 1700000000000}}}; OrQuery may also hold "safety_signals".

type GuildMemberSearchResult

type GuildMemberSearchResult struct {
	Members          []json.RawMessage `json:"members"`
	PageResultCount  int               `json:"page_result_count"`
	TotalResultCount int               `json:"total_result_count"`
}

GuildMemberSearchResult is the answer of SearchGuildMembers.

type GuildMembersChunkEvent

type GuildMembersChunkEvent struct {
	GuildID    string                `json:"guild_id"`
	Members    []GuildMemberEvent    `json:"members"`
	ChunkIndex int                   `json:"chunk_index"`
	ChunkCount int                   `json:"chunk_count"`
	NotFound   []json.RawMessage     `json:"not_found,omitempty"` // snowflakes (string or number)
	Presences  []PresenceUpdateEvent `json:"presences,omitempty"`
	Nonce      string                `json:"nonce,omitempty"`
}

GuildMembersChunkEvent is GUILD_MEMBERS_CHUNK, the answer to op 8.

type GuildOfficialGameApplicationsUpdateEvent

type GuildOfficialGameApplicationsUpdateEvent struct {
	GuildID            string   `json:"guild_id"`
	GameApplicationIDs []string `json:"game_application_ids"`
}

GuildOfficialGameApplicationsUpdateEvent is GUILD_OFFICIAL_GAME_APPLICATIONS_UPDATE (web).

type GuildPowerupEntitlementsEvent

type GuildPowerupEntitlementsEvent struct {
	GuildID      string        `json:"guild_id"`
	Entitlements []Entitlement `json:"entitlements"`
}

GuildPowerupEntitlementsEvent is GUILD_POWERUP_ENTITLEMENTS_CREATE/DELETE (web).

type GuildPreview

type GuildPreview struct {
	ID                       string         `json:"id"`
	Name                     string         `json:"name"`
	Icon                     *string        `json:"icon"`
	Features                 []string       `json:"features"`
	Description              *string        `json:"description"`
	Splash                   *string        `json:"splash"`
	DiscoverySplash          *string        `json:"discovery_splash"`
	HomeHeader               *string        `json:"home_header"`
	Emojis                   []*Emoji       `json:"emojis"`
	Stickers                 []GuildSticker `json:"stickers"`
	ApproximateMemberCount   int            `json:"approximate_member_count"`
	ApproximatePresenceCount int            `json:"approximate_presence_count"`
}

GuildPreview mirrors the Discord guild preview object.

type GuildProductPurchase

type GuildProductPurchase struct {
	ListingID   string `json:"listing_id"`
	ProductName string `json:"product_name"`
}

GuildProductPurchase mirrors the Discord guild product purchase object.

type GuildProfile

type GuildProfile struct {
	ID                       string                  `json:"id"`
	Name                     string                  `json:"name"`
	IconHash                 *string                 `json:"icon_hash"`
	MemberCount              int                     `json:"member_count"`
	OnlineCount              int                     `json:"online_count"`
	Description              string                  `json:"description"`
	BrandColorPrimary        *string                 `json:"brand_color_primary"`
	GameApplicationIDs       []string                `json:"game_application_ids"`
	GameActivity             map[string]GameActivity `json:"game_activity"`
	Tag                      *string                 `json:"tag"`
	Badge                    *GuildProfileBadge      `json:"badge"`
	BadgeColorPrimary        *string                 `json:"badge_color_primary"`
	BadgeColorSecondary      *string                 `json:"badge_color_secondary"`
	BadgeHash                *string                 `json:"badge_hash"`
	Traits                   []GuildProfileTrait     `json:"traits"`
	Features                 []string                `json:"features"` // only community features
	Visibility               GuildVisibility         `json:"visibility"`
	CustomBannerHash         *string                 `json:"custom_banner_hash"`
	PremiumSubscriptionCount int                     `json:"premium_subscription_count"`
	PremiumTier              PremiumTier             `json:"premium_tier"`
}

GuildProfile mirrors the Discord guild profile object.

type GuildProfileBadge

type GuildProfileBadge int

GuildProfileBadge is the Discord guild profile badge enumeration (fmt: off).

const (
	GuildProfileBadgeSword      GuildProfileBadge = 0
	GuildProfileBadgeWaterDrop  GuildProfileBadge = 1
	GuildProfileBadgeSkull      GuildProfileBadge = 2
	GuildProfileBadgeToadstool  GuildProfileBadge = 3
	GuildProfileBadgeMoon       GuildProfileBadge = 4
	GuildProfileBadgeLightning  GuildProfileBadge = 5
	GuildProfileBadgeLeaf       GuildProfileBadge = 6
	GuildProfileBadgeHeart      GuildProfileBadge = 7
	GuildProfileBadgeFire       GuildProfileBadge = 8
	GuildProfileBadgeCompass    GuildProfileBadge = 9
	GuildProfileBadgeCrosshairs GuildProfileBadge = 10
	GuildProfileBadgeFlower     GuildProfileBadge = 11
	GuildProfileBadgeForce      GuildProfileBadge = 12
	GuildProfileBadgeGem        GuildProfileBadge = 13
	GuildProfileBadgeLava       GuildProfileBadge = 14
	GuildProfileBadgePsychic    GuildProfileBadge = 15
	GuildProfileBadgeSmoke      GuildProfileBadge = 16
	GuildProfileBadgeSnow       GuildProfileBadge = 17
	GuildProfileBadgeSound      GuildProfileBadge = 18
	GuildProfileBadgeSun        GuildProfileBadge = 19
	GuildProfileBadgeWind       GuildProfileBadge = 20
	GuildProfileBadgeBunny      GuildProfileBadge = 21
	GuildProfileBadgeDog        GuildProfileBadge = 22
	GuildProfileBadgeFrog       GuildProfileBadge = 23
	GuildProfileBadgeGoat       GuildProfileBadge = 24
	GuildProfileBadgeCat        GuildProfileBadge = 25
	GuildProfileBadgeDiamond    GuildProfileBadge = 26
	GuildProfileBadgeCrown      GuildProfileBadge = 27
	GuildProfileBadgeTrophy     GuildProfileBadge = 28
	GuildProfileBadgeMoneyBag   GuildProfileBadge = 29
	GuildProfileBadgeDollarSign GuildProfileBadge = 30
)

GuildProfileBadge values.

type GuildProfileTrait

type GuildProfileTrait struct {
	EmojiID       *string `json:"emoji_id"`
	EmojiName     *string `json:"emoji_name"`
	EmojiAnimated bool    `json:"emoji_animated"`
	Label         string  `json:"label"`
	Position      int     `json:"position"`
}

GuildProfileTrait mirrors the Discord guild profile trait object.

type GuildProperties

type GuildProperties struct {
	ID                          string        `json:"id,omitempty"`
	Name                        string        `json:"name,omitempty"`
	Icon                        *string       `json:"icon,omitempty"`
	Description                 *string       `json:"description,omitempty"`
	Splash                      *string       `json:"splash,omitempty"`
	DiscoverySplash             *string       `json:"discovery_splash,omitempty"`
	HomeHeader                  *string       `json:"home_header,omitempty"`
	Banner                      *string       `json:"banner,omitempty"`
	OwnerID                     string        `json:"owner_id,omitempty"`
	ApplicationID               *string       `json:"application_id,omitempty"`
	AFKChannelID                *string       `json:"afk_channel_id,omitempty"`
	AFKTimeout                  int           `json:"afk_timeout,omitempty"`
	SystemChannelID             *string       `json:"system_channel_id,omitempty"`
	SystemChannelFlags          int           `json:"system_channel_flags,omitempty"`
	RulesChannelID              *string       `json:"rules_channel_id,omitempty"`
	PublicUpdatesChannelID      *string       `json:"public_updates_channel_id,omitempty"`
	SafetyAlertsChannelID       *string       `json:"safety_alerts_channel_id,omitempty"`
	VerificationLevel           int           `json:"verification_level,omitempty"`
	ExplicitContentFilter       int           `json:"explicit_content_filter,omitempty"`
	DefaultMessageNotifications int           `json:"default_message_notifications,omitempty"`
	MFALevel                    int           `json:"mfa_level,omitempty"`
	NSFW                        bool          `json:"nsfw,omitempty"`
	NSFWLevel                   int           `json:"nsfw_level,omitempty"`
	OwnerConfiguredContentLevel int           `json:"owner_configured_content_level,omitempty"`
	PremiumTier                 int           `json:"premium_tier,omitempty"`
	PremiumProgressBarEnabled   bool          `json:"premium_progress_bar_enabled,omitempty"`
	PreferredLocale             string        `json:"preferred_locale,omitempty"`
	Features                    []string      `json:"features,omitempty"`
	VanityURLCode               *string       `json:"vanity_url_code,omitempty"`
	MaxMembers                  *int          `json:"max_members,omitempty"`
	MaxVideoChannelUsers        int           `json:"max_video_channel_users,omitempty"`
	MaxStageVideoChannelUsers   int           `json:"max_stage_video_channel_users,omitempty"`
	HubType                     *int          `json:"hub_type,omitempty"`
	LatestOnboardingQuestionID  *string       `json:"latest_onboarding_question_id,omitempty"`
	IncidentsData               *IncidentData `json:"incidents_data,omitempty"`
	// Not established.
	Profile                                json.RawMessage `json:"profile,omitempty"`
	PremiumFeatures                        json.RawMessage `json:"premium_features,omitempty"`
	ModeratorReporting                     json.RawMessage `json:"moderator_reporting,omitempty"`
	PremiumProgressBarEnabledUserUpdatedAt json.RawMessage `json:"premium_progress_bar_enabled_user_updated_at,omitempty"`
}

GuildProperties are the guild's own fields. With CapabilityClientStateV2 the gateway sends them under "properties" in READY guilds and GUILD_CREATE; other payloads (GUILD_UPDATE) carry them at the top level.

type GuildPrune

type GuildPrune struct {
	Pruned *int `json:"pruned"`
}

GuildPrune is a request body sent to the API (guild prune).

type GuildPruneProgress

type GuildPruneProgress struct {
	IsPreview    bool     `json:"is_preview"`
	IsFinished   bool     `json:"is_finished"`
	Days         int      `json:"days"`
	PruneCount   int      `json:"prune_count"`
	IncludeRoles []string `json:"include_roles"`
}

GuildPruneProgress is the prune object of GUILD_PRUNE_UPDATE (web).

type GuildPruneUpdateEvent

type GuildPruneUpdateEvent struct {
	GuildID string             `json:"guild_id"`
	Prune   GuildPruneProgress `json:"prune"`
}

GuildPruneUpdateEvent is GUILD_PRUNE_UPDATE (web).

type GuildRoleDeleteEvent

type GuildRoleDeleteEvent struct {
	GuildID string          `json:"guild_id"`
	RoleID  string          `json:"role_id"`
	Version json.RawMessage `json:"version,omitempty"` // read by the web client
}

GuildRoleDeleteEvent is GUILD_ROLE_DELETE.

type GuildRoleEvent

type GuildRoleEvent struct {
	GuildID string `json:"guild_id"`
	Role    Role   `json:"role"`
}

GuildRoleEvent is GUILD_ROLE_CREATE/UPDATE.

type GuildRoomDisconnectEvent

type GuildRoomDisconnectEvent struct {
	RoomID string `json:"room_id"`
	UserID string `json:"user_id"`
}

GuildRoomDisconnectEvent is GUILD_ROOM_DISCONNECT (web).

type GuildScheduledEvent

type GuildScheduledEvent struct {
	ID                 string      `json:"id"`
	GuildID            string      `json:"guild_id"`
	ChannelID          string      `json:"channel_id,omitempty"`
	CreatorID          string      `json:"creator_id,omitempty"`
	Name               string      `json:"name"`
	Description        string      `json:"description,omitempty"`
	ScheduledStartTime string      `json:"scheduled_start_time"`
	ScheduledEndTime   string      `json:"scheduled_end_time,omitempty"`
	PrivacyLevel       int         `json:"privacy_level"`
	Status             int         `json:"status"`
	EntityType         int         `json:"entity_type"`
	EntityID           string      `json:"entity_id,omitempty"`
	EntityMetadata     interface{} `json:"entity_metadata,omitempty"`
	Creator            *User       `json:"creator,omitempty"`
	UserCount          int         `json:"user_count,omitempty"`
	Image              string      `json:"image,omitempty"`
	SKUIDs             []string    `json:"sku_ids,omitempty"`
	// Recurrence and exception fields the newer clients carry; shape not established.
	RecurrenceRule                json.RawMessage `json:"recurrence_rule,omitempty"`
	GuildScheduledEventExceptions json.RawMessage `json:"guild_scheduled_event_exceptions,omitempty"`
}

GuildScheduledEvent represents guild scheduled events

type GuildScheduledEventUserEvent

type GuildScheduledEventUserEvent struct {
	GuildScheduledEventID string `json:"guild_scheduled_event_id"`
	UserID                string `json:"user_id"`
	GuildID               string `json:"guild_id"`
	// Read by the web client; Response is the RSVP response (shape not established).
	GuildScheduledEventExceptionID string          `json:"guild_scheduled_event_exception_id,omitempty"`
	Response                       json.RawMessage `json:"response,omitempty"`
}

GuildScheduledEventUserEvent represents guild scheduled event user actions

type GuildScheduledEventWithUserCount

type GuildScheduledEventWithUserCount struct {
	ID                 string                   `json:"id"`
	GuildID            string                   `json:"guild_id"`
	EntityID           *string                  `json:"entity_id"`
	Name               string                   `json:"name"`
	ScheduledStartTime time.Time                `json:"scheduled_start_time"`
	PrivacyLevel       PrivacyLevel             `json:"privacy_level"`
	Status             ScheduledEventStatus     `json:"status"`
	CreatorID          *string                  `json:"creator_id,omitempty"`
	Description        *string                  `json:"description,omitempty"`
	Creator            *User                    `json:"creator,omitempty"`
	UserCount          int                      `json:"user_count"`
	Image              *string                  `json:"image,omitempty"`
	SKUIDs             []string                 `json:"sku_ids"`
	ChannelID          json.RawMessage          `json:"channel_id"`
	EntityMetadata     json.RawMessage          `json:"entity_metadata"`
	ScheduledEndTime   *time.Time               `json:"scheduled_end_time,omitempty"`
	EntityType         ScheduledEventEntityType `json:"entity_type"`
}

GuildScheduledEventWithUserCount is the flattened superset of StageInstanceScheduledEventWithUserCount, VoiceScheduledEventWithUserCount, ExternalScheduledEventWithUserCount; fields absent from a variant are omitted.

type GuildSoundboardSoundDeleteEvent

type GuildSoundboardSoundDeleteEvent struct {
	GuildID string `json:"guild_id"`
	SoundID string `json:"sound_id"`
}

GuildSoundboardSoundDeleteEvent is GUILD_SOUNDBOARD_SOUND_DELETE (web).

type GuildSticker

type GuildSticker struct {
	ID          string            `json:"id"`
	Name        string            `json:"name"`
	Description string            `json:"description"`
	Tags        string            `json:"tags"`
	FormatType  StickerFormatType `json:"format_type"`
	Type        StickerType       `json:"type"` // always 2
	Available   bool              `json:"available,omitempty"`
	GuildID     string            `json:"guild_id"`
	User        *User             `json:"user,omitempty"`
}

GuildSticker mirrors the Discord guild sticker object.

type GuildStickersUpdateEvent

type GuildStickersUpdateEvent struct {
	GuildID  string         `json:"guild_id"`
	Stickers []GuildSticker `json:"stickers"`
}

GuildStickersUpdateEvent is GUILD_STICKERS_UPDATE.

type GuildSubscribeOptions

type GuildSubscribeOptions struct {
	Typing            *bool              `json:"typing,omitempty"`
	Threads           *bool              `json:"threads,omitempty"`
	Activities        *bool              `json:"activities,omitempty"`
	MemberUpdates     *bool              `json:"member_updates,omitempty"`
	Members           []string           `json:"members,omitempty"`
	Channels          map[string][][]int `json:"channels,omitempty"`
	ThreadMemberLists []string           `json:"thread_member_lists,omitempty"`
}

GuildSubscribeOptions represents options for guild subscription

type GuildSubscribePayload

type GuildSubscribePayload struct {
	GuildID           string             `json:"guild_id"`
	Typing            *bool              `json:"typing,omitempty"`
	Threads           *bool              `json:"threads,omitempty"`
	Activities        *bool              `json:"activities,omitempty"`
	MemberUpdates     *bool              `json:"member_updates,omitempty"`
	Members           []string           `json:"members,omitempty"`
	Channels          map[string][][]int `json:"channels,omitempty"`
	ThreadMemberLists []string           `json:"thread_member_lists,omitempty"`
}

GuildSubscribePayload represents a single guild subscription payload

type GuildTagProfile

type GuildTagProfile struct {
	Tag   *string `json:"tag"`
	Badge *string `json:"badge"`
}

GuildTagProfile mirrors the Discord guild tag profile object.

type GuildTemplate

type GuildTemplate struct {
	Code                  string    `json:"code"`
	Name                  string    `json:"name"`
	Description           *string   `json:"description"`
	UsageCount            int       `json:"usage_count"`
	CreatorID             string    `json:"creator_id"`
	Creator               *User     `json:"creator"`
	CreatedAt             time.Time `json:"created_at"`
	UpdatedAt             time.Time `json:"updated_at"`
	SourceGuildID         string    `json:"source_guild_id"`
	SerializedSourceGuild *Guild    `json:"serialized_source_guild"`
	IsDirty               *bool     `json:"is_dirty"`
}

GuildTemplate mirrors the Discord guild template object.

type GuildVisibility

type GuildVisibility int

GuildVisibility is the Discord guild visibility enumeration.

const (
	GuildVisibilityPublic                GuildVisibility = 1
	GuildVisibilityRestricted            GuildVisibility = 2
	GuildVisibilityPublicWithRecruitment GuildVisibility = 3
)

GuildVisibility values.

type GuildVoiceState

type GuildVoiceState struct {
	UserID     string  `json:"user_id"`
	SessionID  string  `json:"session_id"`
	Deaf       bool    `json:"deaf"`
	Mute       bool    `json:"mute"`
	SelfDeaf   bool    `json:"self_deaf"`
	SelfMute   bool    `json:"self_mute"`
	SelfVideo  bool    `json:"self_video"`
	Suppress   bool    `json:"suppress"`
	Member     *Member `json:"member,omitempty"`
	SelfStream bool    `json:"self_stream,omitempty"`
	ChannelID  *string `json:"channel_id"`
	GuildID    string  `json:"guild_id"`
}

GuildVoiceState mirrors the Discord guild voice state object.

type GuildWidget

type GuildWidget struct {
	ID            string               `json:"id"`
	Name          string               `json:"name"`
	InstantInvite *string              `json:"instant_invite"`
	Channels      []GuildWidgetChannel `json:"channels"`
	Members       []GuildWidgetMember  `json:"members"`
	PresenceCount int                  `json:"presence_count"`
}

GuildWidget mirrors the Discord guild widget object.

type GuildWidgetChannel

type GuildWidgetChannel struct {
	ID       string `json:"id"`
	Name     string `json:"name"`
	Position int    `json:"position"`
}

GuildWidgetChannel mirrors the Discord guild widget channel object.

type GuildWidgetMember

type GuildWidgetMember struct {
	ID                   string                `json:"id"`
	Username             string                `json:"username"`
	Discriminator        string                `json:"discriminator"`
	Avatar               *string               `json:"avatar"`
	AvatarDecorationData *AvatarDecorationData `json:"avatar_decoration_data,omitempty"`
	PublicFlags          int                   `json:"public_flags,omitempty"`
	Bot                  bool                  `json:"bot,omitempty"`
	System               bool                  `json:"system,omitempty"`
	GlobalName           *string               `json:"global_name"`
	PrimaryGuild         *UserPrimaryGuild     `json:"primary_guild,omitempty"`
	DisplayNameStyles    *DisplayNameStyles    `json:"display_name_styles,omitempty"`
	Collectibles         *UserCollectibles     `json:"collectibles,omitempty"`
	Banner               *string               `json:"banner"`
	AccentColor          *int                  `json:"accent_color"`
	MFAEnabled           bool                  `json:"mfa_enabled,omitempty"`
	Locale               string                `json:"locale,omitempty"`
	Verified             bool                  `json:"verified,omitempty"`
	Email                *string               `json:"email,omitempty"`
	Flags                int                   `json:"flags,omitempty"`
	PurchasedFlags       int                   `json:"purchased_flags,omitempty"`
	PremiumUsageFlags    int                   `json:"premium_usage_flags,omitempty"`
	PremiumType          PremiumType           `json:"premium_type,omitempty"`
	Bio                  string                `json:"bio,omitempty"`
	AnalyticsToken       string                `json:"analytics_token,omitempty"`
	Phone                *string               `json:"phone,omitempty"`
	Token                string                `json:"token,omitempty"`
	NSFWAllowed          *bool                 `json:"nsfw_allowed,omitempty"`
	Desktop              bool                  `json:"desktop,omitempty"`
	Mobile               bool                  `json:"mobile,omitempty"`
	Nick                 string                `json:"nick,omitempty"`
	Game                 *Activity             `json:"game,omitempty"`
	Status               string                `json:"status,omitempty"`
	AvatarURL            string                `json:"avatar_url,omitempty"`
	Deaf                 bool                  `json:"deaf,omitempty"`
	SelfDeaf             bool                  `json:"self_deaf,omitempty"`
	Mute                 bool                  `json:"mute,omitempty"`
	SelfMute             bool                  `json:"self_mute,omitempty"`
	Suppress             bool                  `json:"suppress,omitempty"`
}

GuildWidgetMember mirrors the Discord guild widget member object.

type GuildWidgetSettings

type GuildWidgetSettings struct {
	Enabled   bool    `json:"enabled"`
	ChannelID *string `json:"channel_id"`
}

GuildWidgetSettings mirrors the Discord guild widget settings object.

type GuildWithCounts

type GuildWithCounts struct {
	ID                          string                          `json:"id"`
	Unavailable                 bool                            `json:"unavailable,omitempty"`
	Name                        string                          `json:"name"`
	Icon                        *string                         `json:"icon"`
	Features                    []string                        `json:"features"`
	Description                 *string                         `json:"description"`
	Splash                      *string                         `json:"splash"`
	DiscoverySplash             *string                         `json:"discovery_splash"`
	HomeHeader                  *string                         `json:"home_header"`
	Emojis                      []*Emoji                        `json:"emojis"`
	Stickers                    []GuildSticker                  `json:"stickers"`
	OwnerID                     string                          `json:"owner_id"`
	Region                      string                          `json:"region"`
	AfkChannelID                *string                         `json:"afk_channel_id"`
	AfkTimeout                  int                             `json:"afk_timeout"`
	VerificationLevel           VerificationLevel               `json:"verification_level"`
	DefaultMessageNotifications DefaultMessageNotificationLevel `json:"default_message_notifications"`
	ExplicitContentFilter       ExplicitContentFilterLevel      `json:"explicit_content_filter"`
	Roles                       []Role                          `json:"roles"`
	MFALevel                    MFALevel                        `json:"mfa_level"`
	NSFWLevel                   NSFWLevel                       `json:"nsfw_level"`
	ApplicationID               *string                         `json:"application_id"`
	SystemChannelID             *string                         `json:"system_channel_id"`
	SystemChannelFlags          int                             `json:"system_channel_flags"`
	RulesChannelID              *string                         `json:"rules_channel_id"`
	VanityURLCode               *string                         `json:"vanity_url_code"`
	Banner                      *string                         `json:"banner"`
	PremiumTier                 PremiumTier                     `json:"premium_tier"`
	PreferredLocale             string                          `json:"preferred_locale"`
	PublicUpdatesChannelID      *string                         `json:"public_updates_channel_id"`
	StageInstances              []StageInstance                 `json:"stage_instances"`
	GuildScheduledEvents        []*GuildScheduledEvent          `json:"guild_scheduled_events"`
	Owner                       bool                            `json:"owner,omitempty"`
	Permissions                 string                          `json:"permissions,omitempty"`
	WidgetEnabled               bool                            `json:"widget_enabled,omitempty"`
	WidgetChannelID             *string                         `json:"widget_channel_id,omitempty"`
	JoinedAt                    *time.Time                      `json:"joined_at,omitempty"`
	Large                       bool                            `json:"large,omitempty"`
	MemberCount                 int                             `json:"member_count,omitempty"`
	VoiceStates                 []*VoiceState                   `json:"voice_states,omitempty"`
	Members                     []*Member                       `json:"members,omitempty"`
	Channels                    []GuildChannel                  `json:"channels,omitempty"`
	Presences                   []PartialPresenceUpdate         `json:"presences,omitempty"`
	Threads                     []*Thread                       `json:"threads,omitempty"`
	MaxPresences                *int                            `json:"max_presences,omitempty"`
	MaxMembers                  int                             `json:"max_members,omitempty"`
	PremiumSubscriptionCount    int                             `json:"premium_subscription_count,omitempty"`
	MaxVideoChannelUsers        int                             `json:"max_video_channel_users,omitempty"`
	MaxStageVideoChannelUsers   int                             `json:"max_stage_video_channel_users,omitempty"`
	HubType                     *HubType                        `json:"hub_type"`
	IncidentsData               *IncidentData                   `json:"incidents_data"`
	SafetyAlertsChannelID       *string                         `json:"safety_alerts_channel_id"`
	Profile                     *GuildTagProfile                `json:"profile,omitempty"`
	ApproximateMemberCount      int                             `json:"approximate_member_count"`
	ApproximatePresenceCount    int                             `json:"approximate_presence_count"`
}

GuildWithCounts mirrors the Discord guild with counts object.

type HangStatusVariantType

type HangStatusVariantType string

HangStatusVariantType is the Discord hang status variant type enumeration.

const (
	HangStatusVariantTypeIllocons    HangStatusVariantType = "illocons"
	HangStatusVariantTypeTwemoji     HangStatusVariantType = "twemoji"
	HangStatusVariantTypeTwemojiMild HangStatusVariantType = "twemojimild"
)

HangStatusVariantType values.

type HelloPayload

type HelloPayload struct {
	HeartbeatInterval int `json:"heartbeat_interval"`
}

HelloPayload is the HELLO payload.

type HighlightLevel

type HighlightLevel int

HighlightLevel is the Discord highlight level enumeration.

const (
	HighlightLevelDefault  HighlightLevel = 0
	HighlightLevelDisabled HighlightLevel = 1
	HighlightLevelEnabled  HighlightLevel = 2
)

HighlightLevel values.

type HubGuild

type HubGuild struct {
	ID   string  `json:"id"`
	Name string  `json:"name"`
	Icon *string `json:"icon"`
}

HubGuild mirrors the Discord hub guild object.

type HubLookupParams

type HubLookupParams struct {
	// GuildID narrows the lookup to one hub.
	GuildID string
	// UseVerificationCode sends a verification code (default true).
	UseVerificationCode *bool
	// AllowMultipleGuilds allows several matching hubs (default true).
	AllowMultipleGuilds *bool
}

HubLookupParams are the optional parts of HubLookup.

type HubType

type HubType int

HubType is the Discord hub type enumeration.

const (
	HubTypeDefault    HubType = 0
	HubTypeHighSchool HubType = 1
	HubTypeCollege    HubType = 2
)

HubType values.

type HubWaitlist

type HubWaitlist struct {
	Email       string `json:"email"`
	EmailDomain string `json:"email_domain"`
	School      string `json:"school"`
	UserID      string `json:"user_id"`
}

HubWaitlist mirrors the Discord hub waitlist object.

type IFrameModalSize

type IFrameModalSize int

IFrameModalSize is the Discord i frame modal size enumeration.

const (
	IFrameModalSizeSmall  IFrameModalSize = 1
	IFrameModalSizeNormal IFrameModalSize = 2
	IFrameModalSizeBig    IFrameModalSize = 3
)

IFrameModalSize values.

type IdentifyPayload

type IdentifyPayload struct {
	Token        string                 `json:"token"`
	Capabilities int                    `json:"capabilities"`
	Properties   map[string]interface{} `json:"properties"`
	Presence     *PresencePayload       `json:"presence,omitempty"`
	Compress     bool                   `json:"compress"`
	ClientState  *ClientStatePayload    `json:"client_state"`
	// QOSToken is base64 protobuf QosToken (web client); empty = omitted.
	QOSToken string `json:"qos_token,omitempty"`
	// contains filtered or unexported fields
}

IdentifyPayload is the IDENTIFY payload. It marshals with the web client's key order (see MarshalJSON).

func (IdentifyPayload) MarshalJSON

func (p IdentifyPayload) MarshalJSON() ([]byte, error)

MarshalJSON emits the IDENTIFY payload with the web client's key order, and the properties in the real client's order (super properties, then the gateway extras, then anything else sorted).

type IncidentData

type IncidentData struct {
	InvitesDisabledUntil *time.Time `json:"invites_disabled_until,omitempty"`
	DMsDisabledUntil     *time.Time `json:"dms_disabled_until,omitempty"`
}

IncidentData mirrors the Discord incident data object.

type Integration

type Integration struct {
	ID                      string                    `json:"id"`
	Type                    IntegrationType           `json:"type"`
	Account                 IntegrationAccount        `json:"account"`
	Guild                   IntegrationGuild          `json:"guild"`
	Name                    string                    `json:"name,omitempty"`
	ApplicationID           string                    `json:"application_id,omitempty"`
	Enabled                 bool                      `json:"enabled,omitempty"`
	User                    *User                     `json:"user,omitempty"`
	Scopes                  []string                  `json:"scopes,omitempty"`
	RoleID                  *string                   `json:"role_id,omitempty"`
	EnableEmoticons         bool                      `json:"enable_emoticons,omitempty"`
	SubscriberCount         int                       `json:"subscriber_count,omitempty"`
	Revoked                 bool                      `json:"revoked,omitempty"`
	ExpireBehavior          IntegrationExpireBehavior `json:"expire_behavior,omitempty"`
	ExpireGracePeriod       int                       `json:"expire_grace_period,omitempty"`
	Syncing                 bool                      `json:"syncing,omitempty"`
	SyncedAt                *time.Time                `json:"synced_at,omitempty"`
	Application             *IntegrationApplication   `json:"application,omitempty"`
	RoleConnectionsMetadata []RoleConnectionMetadata  `json:"role_connections_metadata,omitempty"`
}

Integration is the flattened superset of the 4 integration variants; fields absent from a variant are omitted.

type IntegrationAccount

type IntegrationAccount struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

IntegrationAccount mirrors the Discord integration account object.

type IntegrationApplication

type IntegrationApplication struct {
	ID                             string          `json:"id"`
	Name                           string          `json:"name"`
	Description                    string          `json:"description"`
	Icon                           *string         `json:"icon"`
	CoverImage                     string          `json:"cover_image,omitempty"`
	Splash                         string          `json:"splash,omitempty"`
	Type                           *int            `json:"type"`
	PrimarySKUID                   string          `json:"primary_sku_id,omitempty"`
	Summary                        string          `json:"summary,omitempty"`
	DeeplinkURI                    string          `json:"deeplink_uri,omitempty"`
	ThirdPartySKUs                 []ThirdPartySKU `json:"third_party_skus,omitempty"`
	Bot                            *User           `json:"bot,omitempty"`
	IsVerified                     bool            `json:"is_verified"`
	IsDiscoverable                 bool            `json:"is_discoverable"`
	IsMonetized                    bool            `json:"is_monetized"`
	StorefrontAvailable            bool            `json:"storefront_available"`
	RoleConnectionsVerificationURL *string         `json:"role_connections_verification_url,omitempty"`
}

IntegrationApplication mirrors the Discord integration application object.

type IntegrationDeleteEvent

type IntegrationDeleteEvent struct {
	ID            string `json:"id"`
	GuildID       string `json:"guild_id"`
	ApplicationID string `json:"application_id,omitempty"`
}

IntegrationDeleteEvent is INTEGRATION_DELETE.

type IntegrationEvent

type IntegrationEvent struct {
	Integration
	GuildID string `json:"guild_id"`
}

IntegrationEvent is INTEGRATION_CREATE/UPDATE: an integration plus its guild.

type IntegrationExpireBehavior

type IntegrationExpireBehavior int

IntegrationExpireBehavior is the Discord integration expire behavior enumeration.

const (
	IntegrationExpireBehaviorRemoveRole IntegrationExpireBehavior = 0
	IntegrationExpireBehaviorKick       IntegrationExpireBehavior = 1
)

IntegrationExpireBehavior values.

type IntegrationGuild

type IntegrationGuild struct {
	ID   string  `json:"id"`
	Name string  `json:"name"`
	Icon *string `json:"icon"`
}

IntegrationGuild mirrors the Discord integration guild object.

type IntegrationType

type IntegrationType string

IntegrationType is the Discord integration type enumeration.

const (
	IntegrationTypeTwitch            IntegrationType = "twitch"
	IntegrationTypeYouTube           IntegrationType = "youtube"
	IntegrationTypeDiscord           IntegrationType = "discord"
	IntegrationTypeGuildSubscription IntegrationType = "guild_subscription"
)

IntegrationType values.

type InteractParams

type InteractParams struct {
	// ApplicationID is the application receiving the interaction. Required:
	// for slash commands it is the command's application, for component
	// interactions the message author (or message application_id).
	ApplicationID string
	// GuildID is the guild of the channel; empty in DMs.
	GuildID string
	// MessageID is set for component interactions (buttons, selects) on a message.
	MessageID string
	// MessageFlags is the flags value of that message; only sent with MessageID.
	MessageFlags int
	// Nonce identifies the interaction; empty generates a snowflake nonce.
	Nonce string
	// SessionID is the gateway session ID of the account; empty generates a
	// random 16-character value like discord.py-self does when it has none.
	// The REST layer does not know the gateway session: pass it when you have it.
	SessionID string
	// Files are uploaded as a multipart form (payload_json + files[N]) for
	// slash commands with attachment options. Each part is sent as
	// application/octet-stream unless File.ContentType is set.
	Files []File
}

InteractParams are the optional parts of an interaction request.

type InteractionContextType

type InteractionContextType int

InteractionContextType is the Discord interaction context type enumeration.

const (
	InteractionContextTypeGuild          InteractionContextType = 0
	InteractionContextTypeBotDM          InteractionContextType = 1
	InteractionContextTypePrivateChannel InteractionContextType = 2
)

InteractionContextType values.

type InteractionData

type InteractionData struct {
	ID                 string                                    `json:"id,omitempty"`
	Name               string                                    `json:"name,omitempty"`
	Version            string                                    `json:"version,omitempty"`
	GuildID            string                                    `json:"guild_id,omitempty"`
	ApplicationCommand *ApplicationCommand                       `json:"application_command,omitempty"`
	Attachments        []PartialAttachment                       `json:"attachments,omitempty"`
	Options            []ApplicationCommandInteractionDataOption `json:"options,omitempty"`
	Type               ApplicationCommandType                    `json:"type,omitempty"`
	TargetID           string                                    `json:"target_id,omitempty"`
	CustomID           string                                    `json:"custom_id,omitempty"`
	ComponentType      ComponentType                             `json:"component_type,omitempty"`
	Values             []string                                  `json:"values,omitempty"`
	Resolved           *ResolvedData                             `json:"resolved,omitempty"`
	Components         []ComponentInteractionData                `json:"components,omitempty"`
}

InteractionData is the flattened superset of the 7 interaction data variants; fields absent from a variant are omitted.

type InteractionEvent

type InteractionEvent struct {
	ID    string `json:"id"`
	Nonce string `json:"nonce,omitempty"`
}

InteractionEvent is INTERACTION_CREATE and INTERACTION_SUCCESS.

type InteractionFailureEvent

type InteractionFailureEvent struct {
	ID         string `json:"id"`
	Nonce      string `json:"nonce,omitempty"`
	ReasonCode int    `json:"reason_code"`
}

InteractionFailureEvent is INTERACTION_FAILURE.

type InteractionIframeModalCloseEvent

type InteractionIframeModalCloseEvent struct {
	ApplicationID string `json:"application_id"`
}

InteractionIframeModalCloseEvent is INTERACTION_IFRAME_MODAL_CLOSE.

type InteractionIframeModalCreateEvent

type InteractionIframeModalCreateEvent struct {
	ID          string                 `json:"id"`
	Nonce       string                 `json:"nonce,omitempty"`
	ChannelID   string                 `json:"channel_id"`
	CustomID    string                 `json:"custom_id"`
	Application IntegrationApplication `json:"application"`
	Title       string                 `json:"title"`
	IframePath  string                 `json:"iframe_path"`
	ModalSize   IFrameModalSize        `json:"modal_size"`
}

InteractionIframeModalCreateEvent is INTERACTION_IFRAME_MODAL_CREATE.

type InteractionInstallationType

type InteractionInstallationType int

InteractionInstallationType is the Discord interaction installation type enumeration.

const (
	InteractionInstallationTypeGuild InteractionInstallationType = 0
	InteractionInstallationTypeUser  InteractionInstallationType = 1
)

InteractionInstallationType values.

type InteractionModal

type InteractionModal struct {
	ID          string                 `json:"id"`
	Nonce       string                 `json:"nonce,omitempty"`
	ChannelID   string                 `json:"channel_id"`
	Title       string                 `json:"title"`
	CustomID    string                 `json:"custom_id"`
	Application IntegrationApplication `json:"application"`
	Components  []Component            `json:"components"`
}

InteractionModal mirrors the Discord interaction modal object.

type InteractionModalCreateEvent

type InteractionModalCreateEvent struct {
	ID          string                 `json:"id"`
	Nonce       string                 `json:"nonce,omitempty"`
	ChannelID   string                 `json:"channel_id"`
	Title       string                 `json:"title"`
	CustomID    string                 `json:"custom_id"`
	Application IntegrationApplication `json:"application"`
	Components  []Component            `json:"components"`
	Resolved    json.RawMessage        `json:"resolved,omitempty"` // read by the web client
}

InteractionModalCreateEvent is INTERACTION_MODAL_CREATE.

type InteractionType

type InteractionType int

InteractionType is the Discord interaction type enumeration.

const (
	InteractionTypePing               InteractionType = 1
	InteractionTypeApplicationCommand InteractionType = 2
	InteractionTypeComponent          InteractionType = 3
	InteractionTypeAutocomplete       InteractionType = 4
	InteractionTypeModalSubmit        InteractionType = 5
)

InteractionType values.

type InteractionsVersion

type InteractionsVersion int

InteractionsVersion is the Discord interactions version enumeration.

const (
	InteractionsVersionV1 InteractionsVersion = 1
	InteractionsVersionV2 InteractionsVersion = 2
)

InteractionsVersion values.

type Invite

type Invite struct {
	TargetType               InviteTargetType     `json:"target_type,omitempty"`
	TargetUser               *User                `json:"target_user,omitempty"`
	TargetApplication        *PartialApplication  `json:"target_application,omitempty"`
	Code                     string               `json:"code"`
	Type                     InviteType           `json:"type"`
	Channel                  *PartialChannel      `json:"channel"`
	GuildID                  string               `json:"guild_id,omitempty"`
	Guild                    *InviteGuild         `json:"guild,omitempty"`
	Profile                  *GuildProfile        `json:"profile,omitempty"`
	Inviter                  *User                `json:"inviter,omitempty"`
	Flags                    int                  `json:"flags,omitempty"`
	ExpiresAt                *time.Time           `json:"expires_at"`
	GuildScheduledEvent      *GuildScheduledEvent `json:"guild_scheduled_event,omitempty"`
	StageInstance            *InviteStageInstance `json:"stage_instance,omitempty"`
	IsNicknameChangeable     bool                 `json:"is_nickname_changeable,omitempty"`
	ApproximateMemberCount   int                  `json:"approximate_member_count,omitempty"`
	ApproximatePresenceCount int                  `json:"approximate_presence_count,omitempty"`
	Uses                     int                  `json:"uses,omitempty"`
	MaxUses                  int                  `json:"max_uses,omitempty"`
	MaxAge                   int                  `json:"max_age,omitempty"`
	Temporary                bool                 `json:"temporary,omitempty"`
	CreatedAt                *time.Time           `json:"created_at,omitempty"`
	NewMember                bool                 `json:"new_member,omitempty"`
	ShowVerificationForm     bool                 `json:"show_verification_form,omitempty"`
}

Invite is the flattened superset of the 4 invite variants; fields absent from a variant are omitted.

type InviteDeleteEvent

type InviteDeleteEvent struct {
	Code      string `json:"code"`
	ChannelID string `json:"channel_id"`
	GuildID   string `json:"guild_id"`
}

InviteDeleteEvent is INVITE_DELETE.

type InviteEvent

type InviteEvent struct {
	ChannelID             string      `json:"channel_id"`
	GuildID               string      `json:"guild_id,omitempty"`
	Code                  string      `json:"code"`
	CreatedAt             string      `json:"created_at,omitempty"`
	GuildScheduledEventID string      `json:"guild_scheduled_event_id,omitempty"`
	Inviter               *User       `json:"inviter,omitempty"`
	MaxAge                int         `json:"max_age,omitempty"`
	MaxUses               int         `json:"max_uses,omitempty"`
	TargetType            int         `json:"target_type,omitempty"`
	TargetUser            *User       `json:"target_user,omitempty"`
	TargetApplication     interface{} `json:"target_application,omitempty"`
	Temporary             bool        `json:"temporary,omitempty"`
	Uses                  int         `json:"uses,omitempty"`
	Type                  int         `json:"type,omitempty"`
	ExpiresAt             *string     `json:"expires_at,omitempty"`
	Flags                 int         `json:"flags,omitempty"`
}

InviteEvent represents invite-related events

type InviteFriendMembers

type InviteFriendMembers struct {
	FriendMemberIDs []string `json:"friend_member_ids"`
}

InviteFriendMembers is the answer of GetInviteFriendMembers.

type InviteGuild

type InviteGuild struct {
	ID                       string            `json:"id"`
	Name                     string            `json:"name"`
	Icon                     *string           `json:"icon"`
	Description              *string           `json:"description"`
	Banner                   *string           `json:"banner"`
	Splash                   *string           `json:"splash"`
	VerificationLevel        VerificationLevel `json:"verification_level"`
	Features                 []string          `json:"features"`
	VanityURLCode            *string           `json:"vanity_url_code"`
	PremiumSubscriptionCount int               `json:"premium_subscription_count,omitempty"`
	PremiumTier              int               `json:"premium_tier"`
	NSFW                     bool              `json:"nsfw"`
	NSFWLevel                NSFWLevel         `json:"nsfw_level"`
}

InviteGuild mirrors the Discord invite guild object.

type InviteStageInstance

type InviteStageInstance struct {
	Members          []*Member `json:"members"`
	ParticipantCount int       `json:"participant_count"`
	SpeakerCount     int       `json:"speaker_count"`
	Topic            string    `json:"topic"`
}

InviteStageInstance mirrors the Discord invite stage instance object.

type InviteTargetType

type InviteTargetType int

InviteTargetType is the Discord invite target type enumeration.

const (
	InviteTargetTypeStream              InviteTargetType = 1
	InviteTargetTypeEmbeddedApplication InviteTargetType = 2
)

InviteTargetType values.

type InviteType

type InviteType int

InviteType is the Discord invite type enumeration.

const (
	InviteTypeGuild   InviteType = 0
	InviteTypeGroupDM InviteType = 1
	InviteTypeFriend  InviteType = 2
)

InviteType values.

type InviteWithCounts

type InviteWithCounts struct {
	TargetType               InviteTargetType     `json:"target_type,omitempty"`
	TargetUser               *User                `json:"target_user,omitempty"`
	TargetApplication        *PartialApplication  `json:"target_application,omitempty"`
	Code                     string               `json:"code"`
	Type                     InviteType           `json:"type"`
	Channel                  *PartialChannel      `json:"channel"`
	GuildID                  string               `json:"guild_id,omitempty"`
	Guild                    *InviteGuild         `json:"guild,omitempty"`
	Profile                  *GuildProfile        `json:"profile,omitempty"`
	Inviter                  *User                `json:"inviter,omitempty"`
	Flags                    int                  `json:"flags,omitempty"`
	ExpiresAt                *time.Time           `json:"expires_at"`
	GuildScheduledEvent      *GuildScheduledEvent `json:"guild_scheduled_event,omitempty"`
	StageInstance            *InviteStageInstance `json:"stage_instance,omitempty"`
	IsNicknameChangeable     bool                 `json:"is_nickname_changeable,omitempty"`
	ApproximateMemberCount   int                  `json:"approximate_member_count"`
	ApproximatePresenceCount int                  `json:"approximate_presence_count"`
}

InviteWithCounts mirrors the Discord invite with counts object.

type InviteWithMetadata

type InviteWithMetadata struct {
	TargetType           InviteTargetType     `json:"target_type,omitempty"`
	TargetUser           *User                `json:"target_user,omitempty"`
	TargetApplication    *PartialApplication  `json:"target_application,omitempty"`
	Code                 string               `json:"code"`
	Type                 InviteType           `json:"type"`
	Channel              *PartialChannel      `json:"channel"`
	GuildID              string               `json:"guild_id,omitempty"`
	Guild                *InviteGuild         `json:"guild,omitempty"`
	Profile              *GuildProfile        `json:"profile,omitempty"`
	Inviter              *User                `json:"inviter,omitempty"`
	Flags                int                  `json:"flags,omitempty"`
	ExpiresAt            *time.Time           `json:"expires_at"`
	GuildScheduledEvent  *GuildScheduledEvent `json:"guild_scheduled_event,omitempty"`
	StageInstance        *InviteStageInstance `json:"stage_instance,omitempty"`
	IsNicknameChangeable bool                 `json:"is_nickname_changeable,omitempty"`
	Uses                 int                  `json:"uses,omitempty"`
	MaxUses              int                  `json:"max_uses,omitempty"`
	MaxAge               int                  `json:"max_age,omitempty"`
	Temporary            bool                 `json:"temporary,omitempty"`
	CreatedAt            time.Time            `json:"created_at"`
}

InviteWithMetadata mirrors the Discord invite with metadata object.

type JoinGuildParams

type JoinGuildParams struct {
	// Lurker joins as a lurker (guild preview / discovery) instead of a full member.
	Lurker bool
	// SessionID is the gateway session ID.
	SessionID string
	// RecommendationLoadID is the discovery recommendation load ID.
	RecommendationLoadID string
	// Location is the join location (for example "Guild Discovery").
	Location string
	// Source overrides the X-Context-Properties source sent for a non-lurker
	// join; the default is one of the two lurker-mode sources.
	Source string
}

JoinGuildParams are the optional parts of JoinGuild.

type JoinRequest

type JoinRequest struct {
	ID                 string                        `json:"id"`
	JoinRequestID      string                        `json:"join_request_id"`
	CreatedAt          time.Time                     `json:"created_at"`
	ApplicationStatus  JoinRequestStatus             `json:"application_status"`
	GuildID            string                        `json:"guild_id"`
	FormResponses      []MemberVerificationFormField `json:"form_responses,omitempty"`
	LastSeen           *string                       `json:"last_seen"`
	ReviewedAt         *time.Time                    `json:"reviewed_at,omitempty"`
	ActionedByUser     *User                         `json:"actioned_by_user,omitempty"`
	RejectionReason    *string                       `json:"rejection_reason"`
	UserID             string                        `json:"user_id"`
	User               *User                         `json:"user,omitempty"`
	InterviewChannelID *string                       `json:"interview_channel_id"`
}

JoinRequest mirrors the Discord join request object.

type JoinRequestAction

type JoinRequestAction string

JoinRequestAction is the Discord join request action enumeration.

const (
	JoinRequestActionApproved JoinRequestAction = "APPROVED"
	JoinRequestActionRejected JoinRequestAction = "REJECTED"
)

JoinRequestAction values.

type JoinRequestCooldown

type JoinRequestCooldown struct {
	Cooldown int `json:"cooldown"`
}

JoinRequestCooldown mirrors the Discord join request cooldown object.

type JoinRequestList

type JoinRequestList struct {
	GuildJoinRequests []JoinRequest `json:"guild_join_requests"`
	Total             int           `json:"total,omitempty"`
}

JoinRequestList mirrors the Discord join request list object.

type JoinRequestStatus

type JoinRequestStatus string

JoinRequestStatus is the Discord join request status enumeration.

const (
	JoinRequestStatusStarted   JoinRequestStatus = "STARTED"
	JoinRequestStatusSubmitted JoinRequestStatus = "SUBMITTED"
	JoinRequestStatusRejected  JoinRequestStatus = "REJECTED"
	JoinRequestStatusApproved  JoinRequestStatus = "APPROVED"
)

JoinRequestStatus values.

type LabelComponent

type LabelComponent struct {
	Type        ComponentType `json:"type"`
	ID          int           `json:"id,omitempty"`
	Label       string        `json:"label"`
	Description string        `json:"description,omitempty"`
	Component   Component     `json:"component"`
}

LabelComponent mirrors the Discord label component object.

type LastMessagesEvent

type LastMessagesEvent struct {
	GuildID  string    `json:"guild_id"`
	Messages []Message `json:"messages"`
}

LastMessagesEvent is LAST_MESSAGES, the answer to op 34 REQUEST_LAST_MESSAGES (web).

type LaunchActivityParams

type LaunchActivityParams struct {
	SessionID string `json:"session_id,omitempty"`
	GuildID   string `json:"guild_id,omitempty"`
}

LaunchActivityParams are the optional fields of LaunchActivity.

type LegacyCustomStatus

type LegacyCustomStatus struct {
	Text      string  `json:"text,omitempty"`
	ExpiresAt *string `json:"expires_at,omitempty"`
	EmojiID   *string `json:"emoji_id,omitempty"`
	EmojiName *string `json:"emoji_name,omitempty"`
}

LegacyCustomStatus is the custom status stored in the legacy settings.

type LegacyGuildFolder

type LegacyGuildFolder struct {
	ID       *int64   `json:"id"`
	Name     *string  `json:"name"`
	Color    *int     `json:"color"`
	GuildIDs []string `json:"guild_ids"`
}

LegacyGuildFolder is a guild folder in the legacy settings.

type LegacyUserSettings

type LegacyUserSettings struct {
	Locale                          string                 `json:"locale,omitempty"`
	Theme                           string                 `json:"theme,omitempty"`
	Status                          string                 `json:"status,omitempty"`
	CustomStatus                    *LegacyCustomStatus    `json:"custom_status,omitempty"`
	ExplicitContentFilter           int                    `json:"explicit_content_filter,omitempty"`
	AnimateStickers                 int                    `json:"animate_stickers,omitempty"`
	AnimateEmoji                    bool                   `json:"animate_emoji,omitempty"`
	FriendSourceFlags               map[string]bool        `json:"friend_source_flags,omitempty"`
	FriendDiscoveryFlags            int                    `json:"friend_discovery_flags,omitempty"`
	RestrictedGuilds                []string               `json:"restricted_guilds,omitempty"`
	ActivityRestrictedGuildIDs      []string               `json:"activity_restricted_guild_ids,omitempty"`
	ActivityJoiningRestrictedGuilds []string               `json:"activity_joining_restricted_guild_ids,omitempty"`
	GuildPositions                  []string               `json:"guild_positions,omitempty"`
	GuildFolders                    []LegacyGuildFolder    `json:"guild_folders,omitempty"`
	DeveloperMode                   bool                   `json:"developer_mode,omitempty"`
	MessageDisplayCompact           bool                   `json:"message_display_compact,omitempty"`
	InlineAttachmentMedia           bool                   `json:"inline_attachment_media,omitempty"`
	InlineEmbedMedia                bool                   `json:"inline_embed_media,omitempty"`
	GifAutoPlay                     bool                   `json:"gif_auto_play,omitempty"`
	RenderEmbeds                    bool                   `json:"render_embeds,omitempty"`
	RenderReactions                 bool                   `json:"render_reactions,omitempty"`
	ShowCurrentGame                 bool                   `json:"show_current_game,omitempty"`
	ViewNSFWGuilds                  bool                   `json:"view_nsfw_guilds,omitempty"`
	ViewNSFWCommands                bool                   `json:"view_nsfw_commands,omitempty"`
	TimezoneOffset                  int                    `json:"timezone_offset,omitempty"`
	Raw                             map[string]interface{} `json:"-"`
}

LegacyUserSettings is the legacy JSON user settings object. Raw keeps the complete response, including fields not modelled here.

func (*LegacyUserSettings) UnmarshalJSON

func (s *LegacyUserSettings) UnmarshalJSON(b []byte) error

UnmarshalJSON decodes the known fields and keeps the full object in Raw.

type LibraryApplication

type LibraryApplication struct {
	CreatedAt    time.Time          `json:"created_at"`
	Application  PartialApplication `json:"application"`
	SKUID        string             `json:"sku_id"`
	SKU          PartialSKU         `json:"sku"`
	Entitlements []Entitlement      `json:"entitlements"`
	Flags        int                `json:"flags"`
	BranchID     string             `json:"branch_id"`
	Branch       *ApplicationBranch `json:"branch,omitempty"`
}

LibraryApplication mirrors the Discord library application object.

type ListPremiumStickerPacks

type ListPremiumStickerPacks struct {
	StickerPacks []StickerPack `json:"sticker_packs"`
}

ListPremiumStickerPacks mirrors the Discord list premium sticker packs object.

type ListPremiumStickerPacksParams

type ListPremiumStickerPacksParams struct {
	Country string // default "US"
	Locale  string // default "en-US"
}

ListPremiumStickerPacksParams are the optional parts of ListPremiumStickerPacks.

type LocationInfo

type LocationInfo struct {
	CountryCode     string  `json:"country_code"`
	SubdivisionCode *string `json:"subdivision_code"`
}

LocationInfo mirrors the Discord location info object.

type LoginMFAParams

type LoginMFAParams struct {
	LoginSource     string
	GiftCodeSKUID   string
	LoginInstanceID string
	Fingerprint     string
}

LoginMFAParams are the optional fields of LoginMFA.

type LoginParams

type LoginParams struct {
	Undelete      bool   // cancel a pending account deletion
	LoginSource   string // for example "gift" when logging in from a gift link
	GiftCodeSKUID string
	Fingerprint   string // X-Fingerprint, from GetExperiments
}

LoginParams are the optional fields of Login.

type LoginResponse

type LoginResponse struct {
	UserID          string          `json:"user_id,omitempty"`
	Token           string          `json:"token,omitempty"`
	MFA             bool            `json:"mfa,omitempty"`
	SMS             bool            `json:"sms,omitempty"`
	TOTP            bool            `json:"totp,omitempty"`
	WebAuthn        string          `json:"webauthn,omitempty"` // WebAuthn challenge JSON when offered
	Backup          bool            `json:"backup,omitempty"`
	Ticket          string          `json:"ticket,omitempty"`
	LoginInstanceID string          `json:"login_instance_id,omitempty"`
	RequiredActions []string        `json:"required_actions,omitempty"`
	UserSettings    json.RawMessage `json:"user_settings,omitempty"`
	SuspendedToken  string          `json:"suspended_user_token,omitempty"`
}

LoginResponse is the response of the login, MFA and password reset calls. Token is set when the login completed; otherwise one of the MFA fields is set and the flow continues with LoginMFA and Ticket.

type LogoutParams

type LogoutParams struct {
	Provider     string
	PushToken    string
	VoipProvider string
	VoipToken    string
}

LogoutParams are the optional fields of Logout (push notification unregistration).

type LogsFromParams

type LogsFromParams struct {
	Before, After, Around string // message IDs
}

LogsFromParams are the optional cursors of LogsFrom.

type MFALevel

type MFALevel int

MFALevel is the Discord mfa level enumeration.

const (
	MFALevelDisabled   MFALevel = 0
	MFALevelRequire2fa MFALevel = 1
)

MFALevel values.

type MediaChannel

type MediaChannel struct {
	ID                            string                 `json:"id"`
	GuildID                       string                 `json:"guild_id"`
	Position                      int                    `json:"position"`
	PermissionOverwrites          []*PermissionOverwrite `json:"permission_overwrites"`
	ParentID                      *string                `json:"parent_id"`
	Name                          string                 `json:"name"`
	Flags                         int                    `json:"flags"`
	Topic                         string                 `json:"topic,omitempty"`
	LastMessageID                 *string                `json:"last_message_id,omitempty"`
	LastPinTimestamp              *time.Time             `json:"last_pin_timestamp,omitempty"`
	RateLimitPerUser              int                    `json:"rate_limit_per_user,omitempty"`
	DefaultThreadRateLimitPerUser int                    `json:"default_thread_rate_limit_per_user,omitempty"`
	DefaultAutoArchiveDuration    ThreadArchiveDuration  `json:"default_auto_archive_duration,omitempty"`
	NSFW                          bool                   `json:"nsfw,omitempty"`
	AvailableTags                 []ForumTag             `json:"available_tags"`
	DefaultReactionEmoji          *DefaultReaction       `json:"default_reaction_emoji"`
	DefaultSortOrder              *ForumOrderType        `json:"default_sort_order"`
	DefaultForumLayout            ForumLayoutType        `json:"default_forum_layout,omitempty"`
	Type                          ChannelType            `json:"type"` // always 16
}

MediaChannel mirrors the Discord media channel object.

type MediaGalleryComponent

type MediaGalleryComponent struct {
	Type  ComponentType      `json:"type"`
	ID    int                `json:"id,omitempty"`
	Items []MediaGalleryItem `json:"items"`
}

MediaGalleryComponent mirrors the Discord media gallery component object.

type MediaGalleryItem

type MediaGalleryItem struct {
	Media       UnfurledMediaItem `json:"media"`
	Description string            `json:"description,omitempty"`
	Spoiler     bool              `json:"spoiler,omitempty"`
}

MediaGalleryItem mirrors the Discord media gallery item object.

type MediaItemLoadingState

type MediaItemLoadingState int

MediaItemLoadingState is the Discord media item loading state enumeration.

const (
	MediaItemLoadingStateUnknown  MediaItemLoadingState = 0
	MediaItemLoadingStateLoading  MediaItemLoadingState = 1
	MediaItemLoadingStateLoaded   MediaItemLoadingState = 2
	MediaItemLoadingStateNotFound MediaItemLoadingState = 3
)

MediaItemLoadingState values.

type MediaSinkWants

type MediaSinkWants struct {
	Any         int                `json:"any,omitempty"`
	PixelCounts map[string]float64 `json:"pixelCounts,omitempty"`
}

MediaSinkWants mirrors the Discord media sink wants object.

type Member

type Member struct {
	User                       *User                 `json:"user,omitempty"`
	Roles                      []string              `json:"roles"`
	PremiumSince               *time.Time            `json:"premium_since"`
	Pending                    bool                  `json:"pending"`
	Nick                       *string               `json:"nick"`
	Mute                       bool                  `json:"mute"`
	JoinedAt                   time.Time             `json:"joined_at"`
	Flags                      int                   `json:"flags"`
	Deaf                       bool                  `json:"deaf"`
	CommunicationDisabledUntil *time.Time            `json:"communication_disabled_until"`
	Banner                     *string               `json:"banner"`
	Avatar                     *string               `json:"avatar"`
	AvatarDecorationData       *AvatarDecorationData `json:"avatar_decoration_data,omitempty"`
}

Member represents a Discord guild member

type MemberNickname

type MemberNickname struct {
	Nick string `json:"nick"`
}

MemberNickname mirrors the Discord member nickname object.

type MemberVerification

type MemberVerification struct {
	Version     *string                       `json:"version"`
	FormFields  []MemberVerificationFormField `json:"form_fields"`
	Description *string                       `json:"description"`
	Guild       *MemberVerificationGuild      `json:"guild,omitempty"`
	Profile     *GuildProfile                 `json:"profile,omitempty"`
}

MemberVerification mirrors the Discord member verification object.

type MemberVerificationFormField

type MemberVerificationFormField struct {
	FieldType   FormFieldType   `json:"field_type"`
	Label       string          `json:"label"`
	Choices     []string        `json:"choices,omitempty"`
	Values      []string        `json:"values,omitempty"`
	Response    json.RawMessage `json:"response,omitempty"` // union of primitive types on the wire
	Required    bool            `json:"required"`
	Description *string         `json:"description"`
	Automations []string        `json:"automations"`
	Placeholder *string         `json:"placeholder,omitempty"`
}

MemberVerificationFormField mirrors the Discord member verification form field object.

type MemberVerificationGuild

type MemberVerificationGuild struct {
	ID                       string            `json:"id"`
	Name                     string            `json:"name"`
	Icon                     *string           `json:"icon"`
	Features                 []string          `json:"features"`
	Description              *string           `json:"description"`
	Splash                   *string           `json:"splash"`
	DiscoverySplash          *string           `json:"discovery_splash"`
	HomeHeader               *string           `json:"home_header"`
	VerificationLevel        VerificationLevel `json:"verification_level"`
	Emojis                   []*Emoji          `json:"emojis"`
	ApproximateMemberCount   int               `json:"approximate_member_count"`
	ApproximatePresenceCount int               `json:"approximate_presence_count"`
}

MemberVerificationGuild mirrors the Discord member verification guild object.

type MemberWithOptionalUser

type MemberWithOptionalUser struct {
	Roles                      []string   `json:"roles"`
	JoinedAt                   *time.Time `json:"joined_at"`
	Deaf                       bool       `json:"deaf"`
	Mute                       bool       `json:"mute"`
	Flags                      int        `json:"flags"`
	Avatar                     *string    `json:"avatar,omitempty"`
	Nick                       string     `json:"nick,omitempty"`
	PremiumSince               *time.Time `json:"premium_since,omitempty"`
	Pending                    bool       `json:"pending,omitempty"`
	CommunicationDisabledUntil *time.Time `json:"communication_disabled_until,omitempty"`
}

MemberWithOptionalUser mirrors the Discord member with optional user object.

type MemberWithPresence

type MemberWithPresence struct {
	Roles                      []string           `json:"roles"`
	JoinedAt                   *time.Time         `json:"joined_at"`
	Deaf                       bool               `json:"deaf"`
	Mute                       bool               `json:"mute"`
	Flags                      int                `json:"flags"`
	Avatar                     *string            `json:"avatar,omitempty"`
	Nick                       string             `json:"nick,omitempty"`
	PremiumSince               *time.Time         `json:"premium_since,omitempty"`
	Pending                    bool               `json:"pending,omitempty"`
	CommunicationDisabledUntil *time.Time         `json:"communication_disabled_until,omitempty"`
	User                       *User              `json:"user"`
	Presence                   BasePresenceUpdate `json:"presence"`
}

MemberWithPresence mirrors the Discord member with presence object.

type MentionableSelectComponent

type MentionableSelectComponent struct {
	Type          ComponentType         `json:"type"`
	ID            int                   `json:"id,omitempty"`
	CustomID      string                `json:"custom_id"`
	Placeholder   string                `json:"placeholder,omitempty"`
	MinValues     int                   `json:"min_values,omitempty"`
	MaxValues     int                   `json:"max_values,omitempty"`
	Disabled      bool                  `json:"disabled,omitempty"`
	DefaultValues []SelectDefaultValues `json:"default_values,omitempty"`
}

MentionableSelectComponent mirrors the Discord mentionable select component object.

type MergedMembers

type MergedMembers [][]GuildMemberEvent

MergedMembers represents merged member data

type MergedPresences

type MergedPresences struct {
	Guilds  [][]PresenceUpdateEvent `json:"guilds"`
	Friends []PresenceUpdateEvent   `json:"friends"`
}

MergedPresences represents merged presence data

type Message

type Message struct {
	ID                string                   `json:"id"`
	Type              int                      `json:"type"`
	Content           string                   `json:"content"`
	ChannelID         string                   `json:"channel_id"`
	ChannelType       int                      `json:"channel_type"`
	GuildID           string                   `json:"guild_id"`
	Author            *User                    `json:"author"`
	Member            *Member                  `json:"member"`
	Timestamp         time.Time                `json:"timestamp"`
	EditedTimestamp   *time.Time               `json:"edited_timestamp"`
	Flags             int                      `json:"flags"`
	Mentions          []*User                  `json:"mentions"`
	MentionRoles      []string                 `json:"mention_roles"`
	MentionEveryone   bool                     `json:"mention_everyone"`
	Attachments       []map[string]interface{} `json:"attachments"`
	Embeds            []map[string]interface{} `json:"embeds"`
	Components        []map[string]interface{} `json:"components"`
	Reactions         []map[string]interface{} `json:"reactions"`
	Pinned            bool                     `json:"pinned"`
	TTS               bool                     `json:"tts"`
	Nonce             string                   `json:"nonce"`
	Thread            *Thread                  `json:"thread,omitempty"`
	StickerItems      []*StickerItem           `json:"sticker_items,omitempty"`
	MessageReference  *MessageReference        `json:"message_reference,omitempty"`
	ReferencedMessage *Message                 `json:"referenced_message,omitempty"`

	// Further wire fields (all optional on the wire).
	Activity             *MessageActivity              `json:"activity,omitempty"`
	Application          *PartialApplication           `json:"application,omitempty"`
	ApplicationID        string                        `json:"application_id,omitempty"`
	Call                 *MessageCall                  `json:"call,omitempty"`
	Hit                  bool                          `json:"hit,omitempty"` // search results: this message matched the query
	Interaction          *MessageInteraction           `json:"interaction,omitempty"`
	InteractionMetadata  json.RawMessage               `json:"interaction_metadata,omitempty"`
	MentionChannels      []ChannelMention              `json:"mention_channels,omitempty"`
	MessageSnapshots     []MessageSnapshotWrapper      `json:"message_snapshots,omitempty"`
	Poll                 *Poll                         `json:"poll,omitempty"`
	Position             *int                          `json:"position,omitempty"`
	PurchaseNotification *PurchaseNotificationResponse `json:"purchase_notification,omitempty"`
	RoleSubscriptionData *RoleSubscriptionData         `json:"role_subscription_data,omitempty"`
	WebhookID            string                        `json:"webhook_id,omitempty"`
}

Message represents a Discord message

func ParseMessageFromMap

func ParseMessageFromMap(data map[string]interface{}) (*Message, error)

ParseMessageFromMap converts a raw map to a Message struct

type MessageAckEvent

type MessageAckEvent struct {
	ChannelID    string `json:"channel_id"`
	MessageID    string `json:"message_id"`
	Flags        *int   `json:"flags"`
	LastViewed   *int   `json:"last_viewed"`
	Manual       bool   `json:"manual,omitempty"`
	MentionCount int    `json:"mention_count,omitempty"`
	AckType      int    `json:"ack_type,omitempty"`
	Version      int    `json:"version"`
}

MessageAckEvent represents message acknowledgment

type MessageActionRowData

type MessageActionRowData struct {
	Type       ComponentType              `json:"type"` // always 1
	Components []ComponentInteractionData `json:"components"`
}

MessageActionRowData mirrors the Discord message action row data object.

type MessageActivity

type MessageActivity struct {
	Type    MessageActivityType `json:"type"`
	PartyID string              `json:"party_id"`
}

MessageActivity mirrors the Discord message activity object.

type MessageActivityType

type MessageActivityType int

MessageActivityType is the Discord message activity type enumeration.

const (
	MessageActivityTypeJoin        MessageActivityType = 1
	MessageActivityTypeSpectate    MessageActivityType = 2
	MessageActivityTypeListen      MessageActivityType = 3
	MessageActivityTypeJoinRequest MessageActivityType = 5
)

MessageActivityType values.

type MessageAttachment

type MessageAttachment struct {
	ID                 string              `json:"id"`
	Filename           string              `json:"filename"`
	Size               int                 `json:"size"`
	URL                string              `json:"url"`
	ProxyURL           string              `json:"proxy_url"`
	Title              string              `json:"title,omitempty"`
	Height             *int                `json:"height,omitempty"`
	Width              *int                `json:"width,omitempty"`
	Description        string              `json:"description,omitempty"`
	ContentType        string              `json:"content_type,omitempty"`
	Ephemeral          bool                `json:"ephemeral,omitempty"`
	DurationSecs       float64             `json:"duration_secs,omitempty"`
	Waveform           string              `json:"waveform,omitempty"`
	Flags              int                 `json:"flags,omitempty"`
	PlaceholderVersion int                 `json:"placeholder_version,omitempty"`
	Placeholder        string              `json:"placeholder,omitempty"`
	ClipCreatedAt      *time.Time          `json:"clip_created_at,omitempty"`
	ClipParticipants   []*User             `json:"clip_participants,omitempty"`
	Application        *PartialApplication `json:"application,omitempty"`
}

MessageAttachment mirrors the Discord message attachment object.

type MessageCache

type MessageCache struct {
	// contains filtered or unexported fields
}

MessageCache represents a cache for Discord messages

func NewMessageCache

func NewMessageCache() *MessageCache

NewMessageCache creates a new message cache

func (*MessageCache) Add

func (c *MessageCache) Add(message map[string]interface{})

Add adds a message to the cache

func (*MessageCache) Delete

func (c *MessageCache) Delete(id string)

Delete removes a message from the cache

func (*MessageCache) Get

func (c *MessageCache) Get(id string) (map[string]interface{}, bool)

Get retrieves a message from the cache

func (*MessageCache) Update

func (c *MessageCache) Update(message map[string]interface{})

Update updates a message in the cache

type MessageCall

type MessageCall struct {
	Participants   []string   `json:"participants"`
	EndedTimestamp *time.Time `json:"ended_timestamp"`
}

MessageCall mirrors the Discord message call object.

type MessageCommandInteractionData

type MessageCommandInteractionData struct {
	ID                 string                                    `json:"id"`
	Name               string                                    `json:"name"`
	Version            string                                    `json:"version"`
	GuildID            string                                    `json:"guild_id,omitempty"`
	ApplicationCommand ApplicationCommand                        `json:"application_command"`
	Attachments        []PartialAttachment                       `json:"attachments"`
	Options            []ApplicationCommandInteractionDataOption `json:"options"`
	TargetID           string                                    `json:"target_id"`
	Type               ApplicationCommandType                    `json:"type"` // always 3
}

MessageCommandInteractionData mirrors the Discord message command interaction data object.

type MessageDeleteBulkEvent

type MessageDeleteBulkEvent struct {
	IDs       []string `json:"ids"`
	ChannelID string   `json:"channel_id"`
	GuildID   string   `json:"guild_id,omitempty"`
}

MessageDeleteBulkEvent is MESSAGE_DELETE_BULK.

type MessageDeleteEvent

type MessageDeleteEvent struct {
	ID        string `json:"id"`
	ChannelID string `json:"channel_id"`
	GuildID   string `json:"guild_id,omitempty"`
}

MessageDeleteEvent represents a message deletion

type MessageInteraction

type MessageInteraction struct {
	ID     string          `json:"id"`
	Type   InteractionType `json:"type"`
	Name   string          `json:"name"`
	User   *User           `json:"user"`
	Member *Member         `json:"member,omitempty"`
}

MessageInteraction mirrors the Discord message interaction object.

type MessageNotificationLevel

type MessageNotificationLevel int

MessageNotificationLevel is the Discord message notification level enumeration.

const (
	MessageNotificationLevelAllMessages   MessageNotificationLevel = 0
	MessageNotificationLevelOnlyMentions  MessageNotificationLevel = 1
	MessageNotificationLevelNothing       MessageNotificationLevel = 2
	MessageNotificationLevelServerDefault MessageNotificationLevel = 3
)

MessageNotificationLevel values.

type MessagePin

type MessagePin struct {
	PinnedAt time.Time `json:"pinned_at"`
	Message  *Message  `json:"message"`
}

MessagePin mirrors the Discord message pin object.

type MessagePollVoteAddManyEvent

type MessagePollVoteAddManyEvent struct {
	ChannelID string         `json:"channel_id"`
	MessageID string         `json:"message_id"`
	GuildID   string         `json:"guild_id,omitempty"`
	Votes     []PollVoteMany `json:"votes"`
}

MessagePollVoteAddManyEvent is MESSAGE_POLL_VOTE_ADD_MANY (web; the client treats each vote like a MESSAGE_REACTION_ADD_MANY item).

type MessagePollVoteEvent

type MessagePollVoteEvent struct {
	UserID    string `json:"user_id"`
	ChannelID string `json:"channel_id"`
	MessageID string `json:"message_id"`
	GuildID   string `json:"guild_id,omitempty"`
	AnswerID  int    `json:"answer_id"`
}

MessagePollVoteEvent is MESSAGE_POLL_VOTE_ADD/REMOVE.

type MessageReaction

type MessageReaction struct {
	Count        int                  `json:"count"`
	Me           bool                 `json:"me"`
	Emoji        *Emoji               `json:"emoji"`
	MeBurst      bool                 `json:"me_burst"`
	CountDetails ReactionCountDetails `json:"count_details"`
	BurstColors  []string             `json:"burst_colors"`
}

MessageReaction mirrors the Discord message reaction object.

type MessageReactionAddManyEvent

type MessageReactionAddManyEvent struct {
	ChannelID string                    `json:"channel_id"`
	GuildID   string                    `json:"guild_id"`
	MessageID string                    `json:"message_id"`
	Reactions []MessageReactionManyItem `json:"reactions"`
}

MessageReactionAddManyEvent represents bulk reaction additions

type MessageReactionEvent

type MessageReactionEvent struct {
	UserID          string        `json:"user_id"`
	ChannelID       string        `json:"channel_id"`
	MessageID       string        `json:"message_id"`
	GuildID         string        `json:"guild_id,omitempty"`
	Member          *Member       `json:"member,omitempty"`
	Emoji           EmojiReaction `json:"emoji"`
	Burst           bool          `json:"burst,omitempty"`
	Type            int           `json:"type,omitempty"`
	MessageAuthorID string        `json:"message_author_id,omitempty"`
	BurstColors     []string      `json:"burst_colors,omitempty"`
}

MessageReactionEvent represents a reaction add/remove event

type MessageReactionManyItem

type MessageReactionManyItem struct {
	Emoji EmojiReaction `json:"emoji"`
	Users []string      `json:"users"`
}

MessageReactionManyItem represents a reaction item in bulk reactions

type MessageReactionRemoveAllEvent

type MessageReactionRemoveAllEvent struct {
	MessageID string `json:"message_id"`
	ChannelID string `json:"channel_id"`
	GuildID   string `json:"guild_id,omitempty"`
}

MessageReactionRemoveAllEvent is MESSAGE_REACTION_REMOVE_ALL.

type MessageReactionRemoveEmojiEvent

type MessageReactionRemoveEmojiEvent struct {
	Emoji     EmojiReaction `json:"emoji"`
	MessageID string        `json:"message_id"`
	ChannelID string        `json:"channel_id"`
	GuildID   string        `json:"guild_id,omitempty"`
}

MessageReactionRemoveEmojiEvent is MESSAGE_REACTION_REMOVE_EMOJI.

type MessageReference

type MessageReference struct {
	Type      int    `json:"type"`
	MessageID string `json:"message_id"`
	ChannelID string `json:"channel_id"`
	GuildID   string `json:"guild_id,omitempty"`
	// FailIfNotExists: when false, sending succeeds even if the referenced message is gone.
	FailIfNotExists *bool `json:"fail_if_not_exists,omitempty"`
}

MessageReference represents a reference to another message (for replies)

type MessageReferenceType

type MessageReferenceType int

MessageReferenceType is the Discord message reference type enumeration.

const (
	MessageReferenceTypeDefault MessageReferenceType = 0
	MessageReferenceTypeForward MessageReferenceType = 1
)

MessageReferenceType values.

type MessageRequestNotificationSentEvent

type MessageRequestNotificationSentEvent struct {
	TriggeringUserID string `json:"triggering_user_id"`
	NumMutualGuilds  int    `json:"num_mutual_guilds"`
}

MessageRequestNotificationSentEvent is MESSAGE_REQUEST_NOTIFICATION_SENT (web).

type MessageSearchAuthorType

type MessageSearchAuthorType string

MessageSearchAuthorType is the Discord message search author type enumeration. Values: 'user', '-user', 'bot', '-bot', 'webhook', '-webhook'.

type MessageSearchHasType

type MessageSearchHasType string

MessageSearchHasType is the Discord message search has type enumeration. Values: 'image', '-image', 'sound', '-sound', 'video', '-video', 'file', '-file', 'sticker', '-sticker', 'embed', '-embed', 'link', '-link'.

type MessageSearchIndexingResult

type MessageSearchIndexingResult struct {
	Message          string `json:"message"`
	Code             int    `json:"code"`
	DocumentsIndexed int    `json:"documents_indexed"`
	RetryAfter       int    `json:"retry_after"`
}

MessageSearchIndexingResult mirrors the Discord message search indexing result object.

type MessageSearchOptions

type MessageSearchOptions struct {
	Query     string // Search query text (content filter)
	AuthorID  string // Filter by author ID
	Offset    int    // Pagination offset (default 0)
	SortBy    string // Sort field (default "timestamp")
	SortOrder string // Sort direction: "asc" or "desc" (default "desc")
}

MessageSearchOptions contains options for searching messages in a channel

type MessageSearchResponse

type MessageSearchResponse struct {
	TotalResults int                        `json:"total_results"`
	Messages     [][]map[string]interface{} `json:"messages"`
	AnalyticsID  string                     `json:"analytics_id"`
}

MessageSearchResponse represents the response from a message search

type MessageSearchResult

type MessageSearchResult struct {
	Messages                 [][]*Message    `json:"messages"`
	Threads                  []*Thread       `json:"threads,omitempty"`
	Members                  []*ThreadMember `json:"members,omitempty"`
	TotalResults             int             `json:"total_results"`
	AnalyticsID              string          `json:"analytics_id"`
	DoingDeepHistoricalIndex bool            `json:"doing_deep_historical_index,omitempty"`
}

MessageSearchResult mirrors the Discord message search result object.

type MessageSearchSortOrder

type MessageSearchSortOrder string

MessageSearchSortOrder is the Discord message search sort order enumeration.

const (
	MessageSearchSortOrderDescending MessageSearchSortOrder = "desc"
	MessageSearchSortOrderAscending  MessageSearchSortOrder = "asc"
)

MessageSearchSortOrder values.

type MessageSearchSortType

type MessageSearchSortType string

MessageSearchSortType is the Discord message search sort type enumeration.

const (
	MessageSearchSortTypeTimestamp MessageSearchSortType = "timestamp"
	MessageSearchSortTypeRelevance MessageSearchSortType = "relevance"
)

MessageSearchSortType values.

type MessageSnapshot

type MessageSnapshot struct {
	Type            MessageType         `json:"type"`
	Content         string              `json:"content"`
	Embeds          []Embed             `json:"embeds"`
	Attachments     []MessageAttachment `json:"attachments"`
	Timestamp       time.Time           `json:"timestamp"`
	EditedTimestamp *time.Time          `json:"edited_timestamp"`
	Flags           int                 `json:"flags,omitempty"`
	Mentions        []UserWithMember    `json:"mentions"`
	MentionRoles    []string            `json:"mention_roles"`
	StickerItems    []*StickerItem      `json:"sticker_items,omitempty"`
	Components      []Component         `json:"components,omitempty"`
}

MessageSnapshot mirrors the Discord message snapshot object.

type MessageSnapshotWrapper

type MessageSnapshotWrapper struct {
	Message MessageSnapshot `json:"message"`
}

MessageSnapshotWrapper is one entry of Message.MessageSnapshots (a forwarded message's snapshot).

type MessageType

type MessageType int

MessageType is the Discord message type enumeration.

const (
	MessageTypeDefault                             MessageType = 0
	MessageTypeRecipientAdd                        MessageType = 1
	MessageTypeRecipientRemove                     MessageType = 2
	MessageTypeCall                                MessageType = 3
	MessageTypeChannelNameChange                   MessageType = 4
	MessageTypeChannelIconChange                   MessageType = 5
	MessageTypeChannelPinnedMessage                MessageType = 6
	MessageTypeMemberJoin                          MessageType = 7
	MessageTypePremiumGuildSubscription            MessageType = 8
	MessageTypePremiumGuildTier1                   MessageType = 9
	MessageTypePremiumGuildTier2                   MessageType = 10
	MessageTypePremiumGuildTier3                   MessageType = 11
	MessageTypeChannelFollowAdd                    MessageType = 12
	MessageTypeGuildDiscoveryDisqualified          MessageType = 14
	MessageTypeGuildDiscoveryRequalified           MessageType = 15
	MessageTypeThreadCreated                       MessageType = 18
	MessageTypeReply                               MessageType = 19
	MessageTypeChatInputCommand                    MessageType = 20
	MessageTypeThreadStarterMessage                MessageType = 21
	MessageTypeGuildInviteReminder                 MessageType = 22
	MessageTypeContextMenuCommand                  MessageType = 23
	MessageTypeAutoModerationAction                MessageType = 24
	MessageTypeRoleSubscriptionPurchase            MessageType = 25
	MessageTypeInteractionPremiumUpsell            MessageType = 26
	MessageTypeStageStart                          MessageType = 27
	MessageTypeStageEnd                            MessageType = 28
	MessageTypeStageSpeaker                        MessageType = 29
	MessageTypeStageRaiseHand                      MessageType = 30
	MessageTypeStageTopic                          MessageType = 31
	MessageTypeGuildApplicationPremiumSubscription MessageType = 32
	MessageTypeGuildIncidentAlertModeEnabled       MessageType = 36
	MessageTypeGuildIncidentAlertModeDisabled      MessageType = 37
	MessageTypeGuildIncidentReportRaid             MessageType = 38
	MessageTypeGuildIncidentReportFalseAlarm       MessageType = 39
	MessageTypePurchaseNotification                MessageType = 44
	MessageTypePollResult                          MessageType = 46
	MessageTypeEmojiAdded                          MessageType = 63
)

MessageType values.

type ModalSubmitActionRowData

type ModalSubmitActionRowData struct {
	Type       ComponentType              `json:"type"` // always 1
	ID         int                        `json:"id,omitempty"`
	Components []ComponentInteractionData `json:"components"`
}

ModalSubmitActionRowData mirrors the Discord modal submit action row data object.

type ModalSubmitCheckboxGroupInteractionData

type ModalSubmitCheckboxGroupInteractionData struct {
	Type     ComponentType `json:"type"` // always 22
	ID       int           `json:"id,omitempty"`
	CustomID string        `json:"custom_id"`
	Values   []string      `json:"values"`
}

ModalSubmitCheckboxGroupInteractionData mirrors the Discord modal submit checkbox group interaction data object.

type ModalSubmitCheckboxInteractionData

type ModalSubmitCheckboxInteractionData struct {
	Type     ComponentType `json:"type"` // always 23
	ID       int           `json:"id,omitempty"`
	CustomID string        `json:"custom_id"`
	Value    bool          `json:"value"`
}

ModalSubmitCheckboxInteractionData mirrors the Discord modal submit checkbox interaction data object.

type ModalSubmitFileUploadInteractionData

type ModalSubmitFileUploadInteractionData struct {
	Type     ComponentType `json:"type"` // always 19
	ID       int           `json:"id,omitempty"`
	CustomID string        `json:"custom_id"`
	Values   []string      `json:"values"`
}

ModalSubmitFileUploadInteractionData mirrors the Discord modal submit file upload interaction data object.

type ModalSubmitInteractionData

type ModalSubmitInteractionData struct {
	ID          string                     `json:"id"`
	CustomID    string                     `json:"custom_id"`
	Components  []ComponentInteractionData `json:"components"`
	Resolved    *ResolvedData              `json:"resolved,omitempty"`
	Attachments []PartialAttachment        `json:"attachments,omitempty"`
}

ModalSubmitInteractionData mirrors the Discord modal submit interaction data object.

type ModalSubmitLabelInteractionData

type ModalSubmitLabelInteractionData struct {
	Type      ComponentType            `json:"type"` // always 18
	ID        int                      `json:"id,omitempty"`
	Component ComponentInteractionData `json:"component"`
}

ModalSubmitLabelInteractionData mirrors the Discord modal submit label interaction data object.

type ModalSubmitRadioGroupInteractionData

type ModalSubmitRadioGroupInteractionData struct {
	Type     ComponentType `json:"type"` // always 21
	ID       int           `json:"id,omitempty"`
	CustomID string        `json:"custom_id"`
	Value    *string       `json:"value"`
}

ModalSubmitRadioGroupInteractionData mirrors the Discord modal submit radio group interaction data object.

type ModalSubmitSelectInteractionData

type ModalSubmitSelectInteractionData struct {
	Type     ComponentType `json:"type"`
	ID       int           `json:"id,omitempty"`
	CustomID string        `json:"custom_id"`
	Values   []string      `json:"values"`
}

ModalSubmitSelectInteractionData mirrors the Discord modal submit select interaction data object.

type ModalSubmitTextDisplayInteractionData

type ModalSubmitTextDisplayInteractionData struct {
	Type    ComponentType `json:"type"` // always 10
	ID      int           `json:"id,omitempty"`
	Content string        `json:"content"`
}

ModalSubmitTextDisplayInteractionData mirrors the Discord modal submit text display interaction data object.

type Mode

type Mode int

Mode represents the client mode

const (
	ModeBrowser Mode = iota // Using rod browser automation
	ModeTLS                 // Using tls-client for HTTP requests
)

type ModifyGuildStickerParams

type ModifyGuildStickerParams struct {
	Name        *string                `json:"name,omitempty"`
	Description *string                `json:"description,omitempty"`
	Tags        *string                `json:"tags,omitempty"`
	Extra       map[string]interface{} `json:"-"`
}

ModifyGuildStickerParams are the fields of ModifyGuildSticker.

type MuteConfig

type MuteConfig struct {
	EndTime            *time.Time `json:"end_time"`
	SelectedTimeWindow *int       `json:"selected_time_window"`
}

MuteConfig mirrors the Discord mute config object.

type MutualGuild

type MutualGuild struct {
	ID   string  `json:"id"`
	Nick *string `json:"nick"`
}

MutualGuild mirrors the Discord mutual guild object.

type NSFWLevel

type NSFWLevel int

NSFWLevel is the Discord nsfw level enumeration.

const (
	NSFWLevelDefault       NSFWLevel = 0
	NSFWLevelExplicit      NSFWLevel = 1
	NSFWLevelSafe          NSFWLevel = 2
	NSFWLevelAgeRestricted NSFWLevel = 3
)

NSFWLevel values.

type NameplateCollectible

type NameplateCollectible struct {
	Asset     string     `json:"asset"`
	SKUID     string     `json:"sku_id"`
	Label     string     `json:"label"`
	ExpiresAt *time.Time `json:"expires_at"`
	Palette   string     `json:"palette"`
}

NameplateCollectible mirrors the Discord nameplate collectible object.

type NameplatePalette

type NameplatePalette string

NameplatePalette is the Discord nameplate palette enumeration.

const (
	NameplatePaletteCrimson   NameplatePalette = "crimson"
	NameplatePaletteBerry     NameplatePalette = "berry"
	NameplatePaletteSky       NameplatePalette = "sky"
	NameplatePaletteTeal      NameplatePalette = "teal"
	NameplatePaletteForest    NameplatePalette = "forest"
	NameplatePaletteBubbleGum NameplatePalette = "bubble_gum"
	NameplatePaletteViolet    NameplatePalette = "violet"
	NameplatePaletteCobalt    NameplatePalette = "cobalt"
	NameplatePaletteClover    NameplatePalette = "clover"
)

NameplatePalette values.

type NewsChannel

type NewsChannel struct {
	ID                            string                 `json:"id"`
	GuildID                       string                 `json:"guild_id"`
	Position                      int                    `json:"position"`
	PermissionOverwrites          []*PermissionOverwrite `json:"permission_overwrites"`
	ParentID                      *string                `json:"parent_id"`
	Name                          string                 `json:"name"`
	Flags                         int                    `json:"flags"`
	Topic                         string                 `json:"topic,omitempty"`
	LastMessageID                 *string                `json:"last_message_id,omitempty"`
	LastPinTimestamp              *time.Time             `json:"last_pin_timestamp,omitempty"`
	RateLimitPerUser              int                    `json:"rate_limit_per_user,omitempty"`
	DefaultThreadRateLimitPerUser int                    `json:"default_thread_rate_limit_per_user,omitempty"`
	DefaultAutoArchiveDuration    ThreadArchiveDuration  `json:"default_auto_archive_duration,omitempty"`
	NSFW                          bool                   `json:"nsfw,omitempty"`
	Type                          ChannelType            `json:"type"` // always 5
}

NewsChannel mirrors the Discord news channel object.

type NonChannelAckEvent

type NonChannelAckEvent struct {
	EntityID   string `json:"entity_id"`
	ResourceID string `json:"resource_id,omitempty"` // GUILD_FEATURE_ACK: the guild
	AckType    int    `json:"ack_type"`
	Version    int    `json:"version"`
}

NonChannelAckEvent is USER_NON_CHANNEL_ACK and GUILD_FEATURE_ACK.

type NotificationCenterItemCompletedEvent

type NotificationCenterItemCompletedEvent struct {
	ItemEnum json.RawMessage `json:"item_enum"`
}

NotificationCenterItemCompletedEvent is NOTIFICATION_CENTER_ITEM_COMPLETED (web).

type NotificationCenterItemEvent

type NotificationCenterItemEvent struct {
	ID string `json:"id"`
}

NotificationCenterItemEvent is NOTIFICATION_CENTER_ITEM_DELETE and NOTIFICATION_CENTER_ITEMS_ACK (web).

type NotificationSettingsUpdateEvent

type NotificationSettingsUpdateEvent struct {
	Flags                    int     `json:"flags"`
	DeclarativeSettingsProto *string `json:"declarative_settings_proto,omitempty"`
}

NotificationSettingsUpdateEvent is NOTIFICATION_SETTINGS_UPDATE (web).

type NullableField

type NullableField[T any] struct {
	// contains filtered or unexported fields
}

NullableField is an optional JSON field that can be left out, sent with a value, or sent as an explicit JSON null. The zero value is "unset" and is omitted from request bodies (the field must carry the `omitzero` tag).

params := &EditProfileParams{Banner: NullField[string]()}  // removes the banner
params := &EditProfileParams{Bio: NewField("hello")}       // sets the bio

func NewField

func NewField[T any](v T) NullableField[T]

NewField returns a field that is sent with value v.

func NullField

func NullField[T any]() NullableField[T]

NullField returns a field that is sent as an explicit JSON null.

func (NullableField[T]) IsNull

func (f NullableField[T]) IsNull() bool

IsNull reports whether the field is set to an explicit null.

func (NullableField[T]) IsZero

func (f NullableField[T]) IsZero() bool

IsZero reports whether the field is unset (used by `omitzero`).

func (NullableField[T]) MarshalJSON

func (f NullableField[T]) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*NullableField[T]) UnmarshalJSON

func (f *NullableField[T]) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

func (NullableField[T]) Value

func (f NullableField[T]) Value() (T, bool)

Value returns the value and whether the field carries one (set and not null).

type OAuth2Authorization

type OAuth2Authorization struct {
	Authorized  bool               `json:"authorized"`
	User        *User              `json:"user"`
	Application PartialApplication `json:"application"`
	Bot         *BotUser           `json:"bot,omitempty"`
	Guilds      []OAuth2Guild      `json:"guilds,omitempty"`
	RedirectURI *string            `json:"redirect_uri,omitempty"`
}

OAuth2Authorization mirrors the Discord o auth2 authorization object.

type OAuth2AuthorizeQuery

type OAuth2AuthorizeQuery struct {
	ResponseType        string
	RedirectURI         string
	CodeChallengeMethod string
	CodeChallenge       string
	State               string
	Nonce               string
}

OAuth2AuthorizeQuery are the optional OAuth2 request parameters shared by GetOAuth2Authorization and AuthorizeOAuth2.

type OAuth2Guild

type OAuth2Guild struct {
	ID          string  `json:"id"`
	Name        string  `json:"name"`
	Icon        *string `json:"icon"`
	Permissions string  `json:"permissions"`
	MFALevel    int     `json:"mfa_level"`
}

OAuth2Guild mirrors the Discord o auth2 guild object.

type OAuth2Location

type OAuth2Location struct {
	Location string `json:"location"`
}

OAuth2Location mirrors the Discord o auth2 location object.

type OAuth2Token

type OAuth2Token struct {
	ID          string             `json:"id"`
	Application PartialApplication `json:"application"`
	Scopes      []string           `json:"scopes"`
}

OAuth2Token mirrors the Discord o auth2 token object.

type OAuth2TokenCreateEvent

type OAuth2TokenCreateEvent struct {
	ID          string          `json:"id"`
	Scopes      []string        `json:"scopes"`
	Application json.RawMessage `json:"application,omitempty"`
}

OAuth2TokenCreateEvent is OAUTH2_TOKEN_CREATE (web).

type OAuth2TokenDeleteEvent

type OAuth2TokenDeleteEvent struct {
	ID            string `json:"id"`
	ApplicationID string `json:"application_id"`
}

OAuth2TokenDeleteEvent is OAUTH2_TOKEN_DELETE (web).

type OAuth2TokenRevokeEvent

type OAuth2TokenRevokeEvent struct {
	AccessToken   string `json:"access_token"`
	ApplicationID string `json:"application_id"`
}

OAuth2TokenRevokeEvent is OAUTH2_TOKEN_REVOKE.

type Onboarding

type Onboarding struct {
	GuildID           string             `json:"guild_id"`
	Prompts           []OnboardingPrompt `json:"prompts"`
	DefaultChannelIDs []string           `json:"default_channel_ids"`
	Enabled           bool               `json:"enabled"`
	Mode              OnboardingMode     `json:"mode"`
}

Onboarding mirrors the Discord onboarding object.

type OnboardingMode

type OnboardingMode int

OnboardingMode is the Discord onboarding mode enumeration.

const (
	OnboardingModeDefault  OnboardingMode = 0
	OnboardingModeAdvanced OnboardingMode = 1
)

OnboardingMode values.

type OnboardingPrompt

type OnboardingPrompt struct {
	ID           string                        `json:"id"`
	Options      []OnboardingPromptOptionEntry `json:"options"`
	Title        string                        `json:"title"`
	SingleSelect bool                          `json:"single_select"`
	Required     bool                          `json:"required"`
	InOnboarding bool                          `json:"in_onboarding"`
	Type         OnboardingPromptType          `json:"type"`
}

OnboardingPrompt mirrors the Discord onboarding prompt object.

type OnboardingPromptOption

type OnboardingPromptOption struct {
	ChannelIDs  []string `json:"channel_ids"`
	RoleIDs     []string `json:"role_ids"`
	Title       string   `json:"title"`
	Description *string  `json:"description"`
	ID          string   `json:"id"`
	Emoji       *Emoji   `json:"emoji,omitempty"`
}

OnboardingPromptOption mirrors the Discord onboarding prompt option object.

type OnboardingPromptOptionEntry

type OnboardingPromptOptionEntry struct {
	ChannelIDs    []string `json:"channel_ids"`
	RoleIDs       []string `json:"role_ids"`
	Title         string   `json:"title"`
	Description   *string  `json:"description"`
	ID            string   `json:"id,omitempty"`
	Emoji         *Emoji   `json:"emoji,omitempty"`
	EmojiID       string   `json:"emoji_id,omitempty"`
	EmojiName     string   `json:"emoji_name,omitempty"`
	EmojiAnimated bool     `json:"emoji_animated,omitempty"`
}

OnboardingPromptOptionEntry is the flattened superset of OnboardingPromptOption, CreateOnboardingPromptOption; fields absent from a variant are omitted.

type OnboardingPromptType

type OnboardingPromptType int

OnboardingPromptType is the Discord onboarding prompt type enumeration.

const (
	OnboardingPromptTypeMultipleChoice OnboardingPromptType = 0
	OnboardingPromptTypeDropdown       OnboardingPromptType = 1
)

OnboardingPromptType values.

type OnboardingResponsesParams

type OnboardingResponsesParams struct {
	OnboardingResponses     []string         `json:"onboarding_responses"`
	OnboardingPromptsSeen   map[string]int64 `json:"onboarding_prompts_seen"`
	OnboardingResponsesSeen map[string]int64 `json:"onboarding_responses_seen"`
}

OnboardingResponsesParams is the body of the onboarding answer routes. The two "seen" maps hold a Unix-millisecond timestamp per prompt or option ID.

type OptionBase

type OptionBase struct {
	Label       string `json:"label"`
	Value       string `json:"value"`
	Default     bool   `json:"default,omitempty"`
	Description string `json:"description,omitempty"`
}

OptionBase mirrors the Discord option base object.

type OrbsArcadeGameStateUpdateEvent

type OrbsArcadeGameStateUpdateEvent struct {
	GameID    string          `json:"game_id"`
	GameState json.RawMessage `json:"game_state"`
}

OrbsArcadeGameStateUpdateEvent is ORBS_ARCADE_GAME_STATE_UPDATE (web).

type OrderGift

type OrderGift struct {
	RecipientID   string   `json:"recipient_id,omitempty"`
	GiftStyle     int      `json:"gift_style,omitempty"`
	EmojiID       string   `json:"emoji_id,omitempty"`
	EmojiName     string   `json:"emoji_name,omitempty"`
	SoundID       string   `json:"sound_id,omitempty"`
	RewardSKUIDs  []string `json:"reward_sku_ids,omitempty"`
	CustomMessage string   `json:"custom_message_contents,omitempty"`
}

OrderGift describes the gifting facet of an order.

type OrderUpdateEvent

type OrderUpdateEvent struct {
	OrderID  string          `json:"order_id"`
	Revision json.RawMessage `json:"revision,omitempty"`
}

OrderUpdateEvent is ORDER_UPDATE (web).

type OverwriteType

type OverwriteType int

OverwriteType is the Discord overwrite type enumeration.

const (
	OverwriteTypeRole   OverwriteType = 0
	OverwriteTypeMember OverwriteType = 1
)

OverwriteType values.

type PartialApplication

type PartialApplication struct {
	ID                          string                    `json:"id"`
	Name                        string                    `json:"name"`
	Description                 string                    `json:"description"`
	Icon                        *string                   `json:"icon"`
	CoverImage                  string                    `json:"cover_image,omitempty"`
	Splash                      string                    `json:"splash,omitempty"`
	Type                        *int                      `json:"type"`
	PrimarySKUID                string                    `json:"primary_sku_id,omitempty"`
	Summary                     string                    `json:"summary,omitempty"`
	DeeplinkURI                 string                    `json:"deeplink_uri,omitempty"`
	ThirdPartySKUs              []ThirdPartySKU           `json:"third_party_skus,omitempty"`
	Bot                         *User                     `json:"bot,omitempty"`
	IsVerified                  bool                      `json:"is_verified"`
	IsDiscoverable              bool                      `json:"is_discoverable"`
	IsMonetized                 bool                      `json:"is_monetized"`
	StorefrontAvailable         bool                      `json:"storefront_available"`
	Hook                        bool                      `json:"hook"`
	Overlay                     bool                      `json:"overlay,omitempty"`
	OverlayMethods              int                       `json:"overlay_methods,omitempty"`
	OverlayWarn                 bool                      `json:"overlay_warn,omitempty"`
	OverlayCompatibilityHook    bool                      `json:"overlay_compatibility_hook,omitempty"`
	Aliases                     []string                  `json:"aliases,omitempty"`
	Executables                 []ApplicationExecutable   `json:"executables,omitempty"`
	Owner                       *User                     `json:"owner,omitempty"` // Not actually ever present in partial app
	Team                        *Team                     `json:"team,omitempty"`
	VerifyKey                   string                    `json:"verify_key"`
	Flags                       int                       `json:"flags"`
	NewFlags                    string                    `json:"new_flags,omitempty"`
	RpcOrigins                  []string                  `json:"rpc_origins,omitempty"`
	TermsOfServiceURL           string                    `json:"terms_of_service_url,omitempty"`
	PrivacyPolicyURL            string                    `json:"privacy_policy_url,omitempty"`
	MaxParticipants             *int                      `json:"max_participants,omitempty"`
	BotPublic                   bool                      `json:"bot_public,omitempty"`
	BotRequireCodeGrant         bool                      `json:"bot_require_code_grant,omitempty"`
	IntegrationPublic           bool                      `json:"integration_public,omitempty"`
	IntegrationRequireCodeGrant bool                      `json:"integration_require_code_grant,omitempty"`
	GuildID                     string                    `json:"guild_id,omitempty"`
	Slug                        string                    `json:"slug,omitempty"`
	Developers                  []ApplicationCompany      `json:"developers,omitempty"`
	Publishers                  []ApplicationCompany      `json:"publishers,omitempty"`
	EULAID                      string                    `json:"eula_id,omitempty"`
	EmbeddedActivityConfig      *EmbeddedActivityConfig   `json:"embedded_activity_config,omitempty"`
	Guild                       *PartialGuild             `json:"guild,omitempty"`
	InstallParams               *ApplicationInstallParams `json:"install_params,omitempty"`
	StoreListingSKUID           string                    `json:"store_listing_sku_id,omitempty"`
}

PartialApplication mirrors the Discord partial application object.

type PartialAttachment

type PartialAttachment struct {
	ID                 string     `json:"id,omitempty"`
	Filename           string     `json:"filename"`
	Description        string     `json:"description,omitempty"`
	UploadedFilename   string     `json:"uploaded_filename,omitempty"`
	Title              string     `json:"title,omitempty"`
	DurationSecs       *float64   `json:"duration_secs,omitempty"`
	Waveform           string     `json:"waveform,omitempty"`
	IsSpoiler          *bool      `json:"is_spoiler,omitempty"`
	IsRemix            *bool      `json:"is_remix,omitempty"`
	IsClip             *bool      `json:"is_clip,omitempty"`
	ApplicationID      string     `json:"application_id,omitempty"`
	ClipCreatedAt      *time.Time `json:"clip_created_at,omitempty"`
	ClipParticipantIDs []string   `json:"clip_participant_ids,omitempty"`
}

PartialAttachment is a request body sent to the API (partial attachment).

type PartialChannel

type PartialChannel struct {
	ID         string             `json:"id"`
	Name       *string            `json:"name"`
	Type       ChannelType        `json:"type"`
	Icon       *string            `json:"icon,omitempty"`
	Recipients []PartialRecipient `json:"recipients,omitempty"`
}

PartialChannel mirrors the Discord partial channel object.

type PartialConnection

type PartialConnection struct {
	ID       string         `json:"id"`
	Type     ConnectionType `json:"type"`
	Name     string         `json:"name"`
	Verified bool           `json:"verified"`
	Metadata map[string]any `json:"metadata,omitempty"`
}

PartialConnection mirrors the Discord partial connection object.

type PartialConsentSettings

type PartialConsentSettings struct {
	Personalization ConsentSetting `json:"personalization"`
}

PartialConsentSettings mirrors the Discord partial consent settings object.

type PartialDirectoryEntry

type PartialDirectoryEntry struct {
	Type               DirectoryEntryType `json:"type"`
	PrimaryCategoryID  DirectoryCategory  `json:"primary_category_id,omitempty"`
	DirectoryChannelID string             `json:"directory_channel_id"`
	AuthorID           string             `json:"author_id"`
	EntityID           string             `json:"entity_id"`
	CreatedAt          time.Time          `json:"created_at"`
	Description        *string            `json:"description"`
}

PartialDirectoryEntry mirrors the Discord partial directory entry object.

type PartialGuild

type PartialGuild struct {
	ID              string   `json:"id"`
	Name            string   `json:"name"`
	Icon            *string  `json:"icon"`
	Features        []string `json:"features"`
	Description     *string  `json:"description"`
	Splash          *string  `json:"splash"`
	DiscoverySplash *string  `json:"discovery_splash"`
	HomeHeader      *string  `json:"home_header"`
}

PartialGuild mirrors the Discord partial guild object.

type PartialIntegration

type PartialIntegration struct {
	ID            string             `json:"id"`
	Type          IntegrationType    `json:"type"`
	Account       IntegrationAccount `json:"account"`
	Guild         IntegrationGuild   `json:"guild"`
	Name          string             `json:"name"`
	ApplicationID string             `json:"application_id,omitempty"`
}

PartialIntegration mirrors the Discord partial integration object.

type PartialInvite

type PartialInvite struct {
	TargetType           InviteTargetType     `json:"target_type,omitempty"`
	TargetUser           *User                `json:"target_user,omitempty"`
	TargetApplication    *PartialApplication  `json:"target_application,omitempty"`
	Code                 string               `json:"code"`
	Type                 InviteType           `json:"type"`
	Channel              *PartialChannel      `json:"channel"`
	GuildID              string               `json:"guild_id,omitempty"`
	Guild                *InviteGuild         `json:"guild,omitempty"`
	Profile              *GuildProfile        `json:"profile,omitempty"`
	Inviter              *User                `json:"inviter,omitempty"`
	Flags                int                  `json:"flags,omitempty"`
	ExpiresAt            *time.Time           `json:"expires_at"`
	GuildScheduledEvent  *GuildScheduledEvent `json:"guild_scheduled_event,omitempty"`
	StageInstance        *InviteStageInstance `json:"stage_instance,omitempty"`
	IsNicknameChangeable bool                 `json:"is_nickname_changeable,omitempty"`
}

PartialInvite mirrors the Discord partial invite object.

type PartialPayment

type PartialPayment struct {
	ID           string `json:"id"`
	Amount       int    `json:"amount"`
	Tax          int    `json:"tax"`
	TaxInclusive bool   `json:"tax_inclusive"`
	Currency     string `json:"currency"`
}

PartialPayment mirrors the Discord partial payment object.

type PartialPaymentSource

type PartialPaymentSource struct {
	ID                     string            `json:"id"`
	Brand                  string            `json:"brand,omitempty"`
	Country                string            `json:"country,omitempty"`
	Last4                  string            `json:"last_4,omitempty"`
	Type                   PaymentSourceType `json:"type"`
	PaymentGateway         PaymentGateway    `json:"payment_gateway"`
	PaymentGatewaySourceID string            `json:"payment_gateway_source_id,omitempty"`
	Invalid                bool              `json:"invalid"`
	Flags                  int               `json:"flags"`
	DeletedAt              *time.Time        `json:"deleted_at"`
	ExpiresMonth           int               `json:"expires_month,omitempty"`
	ExpiresYear            int               `json:"expires_year,omitempty"`
	Email                  string            `json:"email,omitempty"`
	Bank                   string            `json:"bank,omitempty"`
	Username               string            `json:"username,omitempty"`
}

PartialPaymentSource mirrors the Discord partial payment source object.

type PartialPresenceUpdate

type PartialPresenceUpdate struct {
	Status               StatusType      `json:"status"`
	Activities           []*Activity     `json:"activities"`
	HiddenActivities     []*Activity     `json:"hidden_activities,omitempty"`
	ClientStatus         *ClientStatus   `json:"client_status"`
	ProcessedAtTimestamp json.RawMessage `json:"processed_at_timestamp"` // union of primitive types on the wire
	User                 *User           `json:"user"`
	GuildID              string          `json:"guild_id,omitempty"`
}

PartialPresenceUpdate is the request body for updating a partial presence.

type PartialRecipient

type PartialRecipient struct {
	Username string `json:"username"`
}

PartialRecipient mirrors the Discord partial recipient object.

type PartialRoleConnection

type PartialRoleConnection struct {
	PlatformName     *string           `json:"platform_name"`
	PlatformUsername *string           `json:"platform_username"`
	Metadata         map[string]string `json:"metadata"`
}

PartialRoleConnection mirrors the Discord partial role connection object.

type PartialSKU

type PartialSKU struct {
	ID                  string     `json:"id"`
	Type                SKUType    `json:"type"`
	Premium             bool       `json:"premium"`
	PreorderReleaseDate *string    `json:"preorder_release_date"`
	PreorderReleasedAt  *time.Time `json:"preorder_released_at"`
}

PartialSKU mirrors the Discord partial sku object.

type PartialSubscription

type PartialSubscription struct {
	ID                           string             `json:"id"`
	Type                         int                `json:"type"` // one of 1, 2, 3
	PaymentGateway               *PaymentGateway    `json:"payment_gateway"`
	Currency                     string             `json:"currency"`
	Items                        []SubscriptionItem `json:"items"`
	PaymentGatewayPlanID         *string            `json:"payment_gateway_plan_id"`
	PaymentGatewaySubscriptionID *string            `json:"payment_gateway_subscription_id,omitempty"`
	CurrentPeriodStart           time.Time          `json:"current_period_start"`
	CurrentPeriodEnd             time.Time          `json:"current_period_end"`
	StreakStartedAt              *time.Time         `json:"streak_started_at,omitempty"`
}

PartialSubscription mirrors the Discord partial subscription object.

type PartialSubscriptionPlan

type PartialSubscriptionPlan struct {
	ID            string               `json:"id"`
	Name          string               `json:"name"`
	SKUID         string               `json:"sku_id"`
	Interval      SubscriptionInterval `json:"interval"`
	IntervalCount int                  `json:"interval_count"`
	TaxInclusive  bool                 `json:"tax_inclusive"`
}

PartialSubscriptionPlan mirrors the Discord partial subscription plan object.

type PartialUpdateChannel

type PartialUpdateChannel struct {
	ID               string  `json:"id"`
	LastMessageID    *string `json:"last_message_id"`
	LastPinTimestamp *string `json:"last_pin_timestamp,omitempty"`
}

PartialUpdateChannel represents partial channel update data

type PartialWebhook

type PartialWebhook struct {
	ID      string      `json:"id"`
	Type    WebhookType `json:"type"`
	GuildID string      `json:"guild_id,omitempty"`
	User    *User       `json:"user,omitempty"`
	Token   string      `json:"token,omitempty"`
}

PartialWebhook mirrors the Discord partial webhook object.

type PassiveUpdateV1Event

type PassiveUpdateV1Event struct {
	GuildID     string                 `json:"guild_id"`
	Channels    []PartialUpdateChannel `json:"channels"`
	VoiceStates []VoiceState           `json:"voice_states,omitempty"`
	Members     []GuildMemberEvent     `json:"members,omitempty"`
}

PassiveUpdateV1Event represents passive guild updates (version 1)

type PassiveUpdateV2Event

type PassiveUpdateV2Event struct {
	GuildID            string                 `json:"guild_id"`
	RemovedVoiceStates []string               `json:"removed_voice_states"`
	UpdatedChannels    []PartialUpdateChannel `json:"updated_channels"`
	UpdatedMembers     []GuildMemberEvent     `json:"updated_members"`
	UpdatedVoiceStates []VoiceState           `json:"updated_voice_states"`
}

PassiveUpdateV2Event represents passive guild updates (version 2)

type PayInvoiceParams

type PayInvoiceParams struct {
	PaymentSourceToken string
	Currency           string // default "usd"
	ReturnURL          string
}

PayInvoiceParams are the optional fields of PayInvoice.

type Payment

type Payment struct {
	ID                            string                `json:"id"`
	Amount                        int                   `json:"amount"`
	Tax                           int                   `json:"tax"`
	TaxInclusive                  bool                  `json:"tax_inclusive"`
	Currency                      string                `json:"currency"`
	AmountRefunded                int                   `json:"amount_refunded"`
	Description                   string                `json:"description"`
	Status                        PaymentStatus         `json:"status"`
	CreatedAt                     time.Time             `json:"created_at"`
	SKUID                         string                `json:"sku_id,omitempty"`
	SKUPrice                      int                   `json:"sku_price,omitempty"`
	SKUSubscriptionPlanID         string                `json:"sku_subscription_plan_id,omitempty"`
	PaymentGateway                PaymentGateway        `json:"payment_gateway,omitempty"`
	PaymentGatewayPaymentID       string                `json:"payment_gateway_payment_id,omitempty"`
	DownloadableInvoice           string                `json:"downloadable_invoice,omitempty"`
	DownloadableRefundInvoices    []string              `json:"downloadable_refund_invoices,omitempty"`
	RefundDisqualificationReasons []string              `json:"refund_disqualification_reasons,omitempty"`
	Flags                         int                   `json:"flags"`
	SKU                           *PublicSKU            `json:"sku,omitempty"`
	PaymentSource                 *PartialPaymentSource `json:"payment_source,omitempty"`
	Subscription                  *PartialSubscription  `json:"subscription,omitempty"`
	Metadata                      PaymentMetadata       `json:"metadata"`
}

Payment mirrors the Discord payment object.

type PaymentBrowserCheckoutDoneEvent

type PaymentBrowserCheckoutDoneEvent struct {
	LoadID                string `json:"load_id"`
	SKUID                 string `json:"sku_id"`
	SKUSubscriptionPlanID string `json:"sku_subscription_plan_id"`
}

PaymentBrowserCheckoutDoneEvent is USER_PAYMENT_BROWSER_CHECKOUT_DONE (web).

type PaymentClientAddEvent

type PaymentClientAddEvent struct {
	PurchaseTokenHash string `json:"purchase_token_hash"`
	ExpiresAt         string `json:"expires_at"`
}

PaymentClientAddEvent is USER_PAYMENT_CLIENT_ADD.

type PaymentGateway

type PaymentGateway int

PaymentGateway is the Discord payment gateway enumeration.

const (
	PaymentGatewayStripe    PaymentGateway = 1
	PaymentGatewayBraintree PaymentGateway = 2
	PaymentGatewayApple     PaymentGateway = 3
	PaymentGatewayGoogle    PaymentGateway = 4
	PaymentGatewayAdyen     PaymentGateway = 5
	PaymentGatewayApplePay  PaymentGateway = 6
)

PaymentGateway values.

type PaymentMetadata

type PaymentMetadata struct {
	BillingErrorCode *int `json:"billing_error_code"`
}

PaymentMetadata mirrors the Discord payment metadata object.

type PaymentSource

type PaymentSource struct {
	ID                     string            `json:"id"`
	Brand                  string            `json:"brand,omitempty"`
	Country                string            `json:"country,omitempty"`
	Last4                  string            `json:"last_4,omitempty"`
	Type                   PaymentSourceType `json:"type"`
	PaymentGateway         PaymentGateway    `json:"payment_gateway"`
	PaymentGatewaySourceID string            `json:"payment_gateway_source_id,omitempty"`
	Invalid                bool              `json:"invalid"`
	Flags                  int               `json:"flags"`
	DeletedAt              *time.Time        `json:"deleted_at"`
	ExpiresMonth           int               `json:"expires_month,omitempty"`
	ExpiresYear            int               `json:"expires_year,omitempty"`
	Email                  string            `json:"email,omitempty"`
	Bank                   string            `json:"bank,omitempty"`
	Username               string            `json:"username,omitempty"`
	BillingAddress         BillingAddress    `json:"billing_address"`
	Default                bool              `json:"default"`
}

PaymentSource mirrors the Discord payment source object.

type PaymentSourceType

type PaymentSourceType int

PaymentSourceType is the Discord payment source type enumeration.

const (
	PaymentSourceTypeUnknown     PaymentSourceType = 0
	PaymentSourceTypeCard        PaymentSourceType = 1
	PaymentSourceTypePaypal      PaymentSourceType = 2
	PaymentSourceTypeGiropay     PaymentSourceType = 3
	PaymentSourceTypeSofort      PaymentSourceType = 4
	PaymentSourceTypePrzzelewy24 PaymentSourceType = 5
	PaymentSourceTypeSepaDebit   PaymentSourceType = 6
	PaymentSourceTypePaysafecard PaymentSourceType = 7
	PaymentSourceTypeGcash       PaymentSourceType = 8
	PaymentSourceTypeGrabpay     PaymentSourceType = 9
	PaymentSourceTypeMomoWallet  PaymentSourceType = 10
	PaymentSourceTypeVenmo       PaymentSourceType = 11
	PaymentSourceTypeGopayWallet PaymentSourceType = 12
	PaymentSourceTypeKakaopay    PaymentSourceType = 13
	PaymentSourceTypeBancontact  PaymentSourceType = 14
	PaymentSourceTypeEps         PaymentSourceType = 15
	PaymentSourceTypeIdeal       PaymentSourceType = 16
	PaymentSourceTypeCashApp     PaymentSourceType = 17
)

PaymentSourceType values.

type PaymentStatus

type PaymentStatus int

PaymentStatus is the Discord payment status enumeration.

const (
	PaymentStatusPending   PaymentStatus = 0
	PaymentStatusCompleted PaymentStatus = 1
	PaymentStatusFailed    PaymentStatus = 2
	PaymentStatusReversed  PaymentStatus = 3
	PaymentStatusRefunded  PaymentStatus = 4
	PaymentStatusCanceled  PaymentStatus = 5
)

PaymentStatus values.

type PaymentUpdateEvent

type PaymentUpdateEvent struct {
	ID             string `json:"id"`
	Status         int    `json:"status"`
	Amount         int    `json:"amount"`
	Currency       string `json:"currency"`
	PaymentGateway int    `json:"payment_gateway"`
}

PaymentUpdateEvent represents payment updates

type PermissionOverwrite

type PermissionOverwrite struct {
	ID    string `json:"id"`
	Type  int    `json:"type"`
	Allow string `json:"allow"`
	Deny  string `json:"deny"`
}

PermissionOverwrite represents a channel permission overwrite

type PinsFromParams

type PinsFromParams struct {
	Limit  *int   // 1-50
	Before string // ISO8601 pinned_at timestamp of the last item of the previous page
}

PinsFromParams are the optional pagination parameters of PinsFrom.

type Poll

type Poll struct {
	AllowMultiselect bool               `json:"allow_multiselect"`
	Answers          []PollAnswerWithID `json:"answers"`
	Expiry           time.Time          `json:"expiry"`
	LayoutType       PollLayoutType     `json:"layout_type"`
	Question         PollMedia          `json:"question"`
	Results          PollResult         `json:"results"`
}

Poll mirrors the Discord poll object.

We don't subclass Poll as it will still have the duration field, which is converted into expiry when poll is fetched from a message or returned by a `send` method in a Messageable

type PollAnswer

type PollAnswer struct {
	PollMedia PollMedia `json:"poll_media"`
}

PollAnswer mirrors the Discord poll answer object.

type PollAnswerCount

type PollAnswerCount struct {
	ID      string `json:"id"`
	Count   int    `json:"count"`
	MeVoted bool   `json:"me_voted"`
}

PollAnswerCount mirrors the Discord poll answer count object.

type PollAnswerVoters

type PollAnswerVoters struct {
	Users []*User `json:"users"`
}

PollAnswerVoters mirrors the Discord poll answer voters object.

type PollAnswerWithID

type PollAnswerWithID struct {
	PollMedia PollMedia `json:"poll_media"`
	AnswerID  int       `json:"answer_id"`
}

PollAnswerWithID mirrors the Discord poll answer with id object.

type PollCreate

type PollCreate struct {
	AllowMultiselect bool           `json:"allow_multiselect"`
	Answers          []PollAnswer   `json:"answers"`
	Duration         float64        `json:"duration"`
	LayoutType       PollLayoutType `json:"layout_type"`
	Question         PollMedia      `json:"question"`
}

PollCreate is the request body for creating a poll.

type PollLayoutType

type PollLayoutType int

PollLayoutType is the Discord poll layout type enumeration (1 = Default).

const (
	PollLayoutTypeDefault          PollLayoutType = 1
	PollLayoutTypeImageOnlyAnswers PollLayoutType = 2
)

PollLayoutType values.

type PollMedia

type PollMedia struct {
	Text  string `json:"text"`
	Emoji *Emoji `json:"emoji,omitempty"`
}

PollMedia mirrors the Discord poll media object.

type PollResult

type PollResult struct {
	IsFinalized  bool              `json:"is_finalized"`
	AnswerCounts []PollAnswerCount `json:"answer_counts"`
}

PollResult mirrors the Discord poll result object.

type PollVoteMany

type PollVoteMany struct {
	AnswerID int      `json:"answer_id"`
	Users    []string `json:"users,omitempty"`
}

PollVoteMany is one answer of MESSAGE_POLL_VOTE_ADD_MANY.

type PollVotersParams

type PollVotersParams struct {
	After string // user ID to start after
	Limit *int   // 1-100
}

PollVotersParams are the optional pagination parameters of GetPollAnswerVoters.

type PomeloAttempt

type PomeloAttempt struct {
	Taken bool `json:"taken"`
}

PomeloAttempt mirrors the Discord pomelo attempt object.

type PomeloSuggestion

type PomeloSuggestion struct {
	Username string `json:"username"`
}

PomeloSuggestion mirrors the Discord pomelo suggestion object.

type PowerupGameServerParams

type PowerupGameServerParams struct {
	GameServerName   string `json:"game_server_name,omitempty"`
	GameServerRegion string `json:"game_server_region,omitempty"`
}

PowerupGameServerParams are the optional game server settings of EnableGuildPowerup.

type PremiumGuildSubscription

type PremiumGuildSubscription struct {
	ID          string     `json:"id"`
	GuildID     string     `json:"guild_id"`
	UserID      string     `json:"user_id"`
	User        *User      `json:"user,omitempty"`
	Ended       bool       `json:"ended"`
	EndsAt      *time.Time `json:"ends_at,omitempty"`
	PauseEndsAt *time.Time `json:"pause_ends_at"`
}

PremiumGuildSubscription mirrors the Discord premium guild subscription object.

type PremiumGuildSubscriptionCooldown

type PremiumGuildSubscriptionCooldown struct {
	EndsAt    time.Time `json:"ends_at"`
	Limit     int       `json:"limit"`
	Remaining int       `json:"remaining"`
}

PremiumGuildSubscriptionCooldown mirrors the Discord premium guild subscription cooldown object.

type PremiumGuildSubscriptionSlot

type PremiumGuildSubscriptionSlot struct {
	ID                       string                    `json:"id"`
	SubscriptionID           string                    `json:"subscription_id"`
	Canceled                 bool                      `json:"canceled"`
	CooldownEndsAt           *time.Time                `json:"cooldown_ends_at"`
	PremiumGuildSubscription *PremiumGuildSubscription `json:"premium_guild_subscription"`
}

PremiumGuildSubscriptionSlot mirrors the Discord premium guild subscription slot object.

type PremiumPrice

type PremiumPrice struct {
	Amount     int `json:"amount"`
	Percentage int `json:"percentage"`
}

PremiumPrice mirrors the Discord premium price object.

type PremiumTier

type PremiumTier int

PremiumTier is the Discord premium tier enumeration.

const (
	PremiumTierNone  PremiumTier = 0
	PremiumTierTier1 PremiumTier = 1
	PremiumTierTier2 PremiumTier = 2
	PremiumTierTier3 PremiumTier = 3
)

PremiumTier values.

type PremiumType

type PremiumType int

PremiumType is the Discord premium type enumeration.

const (
	PremiumTypeNone         PremiumType = 0
	PremiumTypeNitroClassic PremiumType = 1
	PremiumTypeNitro        PremiumType = 2
	PremiumTypeNitroBasic   PremiumType = 3
)

PremiumType values.

type PremiumUsage

type PremiumUsage struct {
	NitroStickerSends   PremiumUsageValue `json:"nitro_sticker_sends"`
	TotalAnimatedEmojis PremiumUsageValue `json:"total_animated_emojis"`
	TotalGlobalEmojis   PremiumUsageValue `json:"total_global_emojis"`
	TotalLargeUploads   PremiumUsageValue `json:"total_large_uploads"`
	TotalHdStreams      PremiumUsageValue `json:"total_hd_streams"`
	HdHoursStreamed     PremiumUsageValue `json:"hd_hours_streamed"`
}

PremiumUsage mirrors the Discord premium usage object.

type PremiumUsageValue

type PremiumUsageValue struct {
	Value int `json:"value"`
}

PremiumUsageValue mirrors the Discord premium usage value object.

type PresencePayload

type PresencePayload struct {
	Status     string     `json:"status"`
	Since      int64      `json:"since"`
	Activities []Activity `json:"activities"`
	AFK        bool       `json:"afk"`
}

PresencePayload is the op 3 PRESENCE_UPDATE payload and the IDENTIFY presence.

type PresenceUpdateEvent

type PresenceUpdateEvent struct {
	User                 User         `json:"user"`
	GuildID              string       `json:"guild_id,omitempty"`
	Status               string       `json:"status"`
	Activities           []Activity   `json:"activities"`
	ClientStatus         ClientStatus `json:"client_status"`
	ProcessedAtTimestamp int64        `json:"processed_at_timestamp,omitempty"`
	HiddenActivities     []Activity   `json:"hidden_activities,omitempty"`
}

Enhanced PresenceUpdateEvent represents presence updates (matching events/PRESENCE_UPDATE.json)

type PresencesReplaceEvent

type PresencesReplaceEvent []PresenceUpdateEvent

PresencesReplaceEvent is PRESENCES_REPLACE: a list of user presences.

type PreviewSKUPurchaseParams

type PreviewSKUPurchaseParams struct {
	PaymentSourceID    string
	SubscriptionPlanID string
	Currency           string
	TestMode           bool
	Gift               bool
}

PreviewSKUPurchaseParams are the options of PreviewSKUPurchase.

type PreviewSubscriptionUpdateParams

type PreviewSubscriptionUpdateParams struct {
	Items             []SubscriptionItemParams `json:"items,omitempty"`
	PaymentSourceID   *string                  `json:"payment_source_id,omitempty"`
	Currency          *string                  `json:"currency,omitempty"`
	ApplyEntitlements *bool                    `json:"apply_entitlements,omitempty"`
	Renewal           *bool                    `json:"renewal,omitempty"`
	UserDiscountOffer *string                  `json:"user_discount_offer_id,omitempty"`
}

PreviewSubscriptionUpdateParams is the body of PreviewSubscriptionUpdate.

type PreviewSubscriptionsUpdateParams

type PreviewSubscriptionsUpdateParams struct {
	PaymentSourceID   string
	TrialID           string
	ApplyEntitlements *bool
	Renewal           *bool
	Code              string
	Metadata          map[string]interface{}
}

PreviewSubscriptionsUpdateParams are the optional fields of PreviewSubscriptionsUpdate.

type PricingPromotion

type PricingPromotion struct {
	PlanID             string           `json:"plan_id"`
	CountryCode        string           `json:"country_code"`
	PaymentSourceTypes []int            `json:"payment_source_types"`
	Price              PromotionalPrice `json:"price"`
}

PricingPromotion mirrors the Discord pricing promotion object.

type PrimaryEntryPointCommandInteractionData

type PrimaryEntryPointCommandInteractionData struct {
	ID                 string                                    `json:"id"`
	Name               string                                    `json:"name"`
	Version            string                                    `json:"version"`
	GuildID            string                                    `json:"guild_id,omitempty"`
	ApplicationCommand ApplicationCommand                        `json:"application_command"`
	Attachments        []PartialAttachment                       `json:"attachments"`
	Options            []ApplicationCommandInteractionDataOption `json:"options"`
	Type               ApplicationCommandType                    `json:"type,omitempty"` // always 4
}

PrimaryEntryPointCommandInteractionData mirrors the Discord primary entry point command interaction data object.

type PrivacyLevel

type PrivacyLevel int

PrivacyLevel is the Discord privacy level enumeration.

const (
	PrivacyLevelPublic PrivacyLevel = 1
	PrivacyLevelClosed PrivacyLevel = 2
)

PrivacyLevel values.

type PrivateMember

type PrivateMember struct {
	Roles                      []string   `json:"roles"`
	JoinedAt                   *time.Time `json:"joined_at"`
	Deaf                       bool       `json:"deaf"`
	Mute                       bool       `json:"mute"`
	Flags                      int        `json:"flags"`
	Avatar                     *string    `json:"avatar,omitempty"`
	Nick                       string     `json:"nick,omitempty"`
	PremiumSince               *time.Time `json:"premium_since,omitempty"`
	Pending                    bool       `json:"pending,omitempty"`
	CommunicationDisabledUntil *time.Time `json:"communication_disabled_until,omitempty"`
	User                       *User      `json:"user"`
	Bio                        string     `json:"bio"`
}

PrivateMember mirrors the Discord private member object.

type PrivateSKU

type PrivateSKU struct {
	ID                             string                     `json:"id"`
	Type                           SKUType                    `json:"type"`
	Premium                        bool                       `json:"premium"`
	PreorderReleaseDate            *string                    `json:"preorder_release_date"`
	PreorderReleasedAt             *time.Time                 `json:"preorder_released_at,omitempty"`
	ProductLine                    *SKUProductLine            `json:"product_line"`
	Name                           json.RawMessage            `json:"name"`                   // string or locale-keyed map of strings
	Summary                        json.RawMessage            `json:"summary,omitempty"`      // string or locale-keyed map of strings
	LegalNotice                    json.RawMessage            `json:"legal_notice,omitempty"` // string or locale-keyed map of strings
	Slug                           string                     `json:"slug"`
	DependentSKUID                 *string                    `json:"dependent_sku_id"`
	ApplicationID                  string                     `json:"application_id"`
	Application                    *PartialApplication        `json:"application,omitempty"`
	Flags                          int                        `json:"flags"`
	AccessType                     SKUAccessLevel             `json:"access_type"`
	Features                       []int                      `json:"features"`
	Locales                        []string                   `json:"locales,omitempty"`
	Genres                         []int                      `json:"genres,omitempty"`
	AvailableRegions               []string                   `json:"available_regions,omitempty"`
	SystemRequirements             map[int]SystemRequirements `json:"system_requirements,omitempty"`
	ReleaseDate                    *string                    `json:"release_date"`
	PreorderApproximateReleaseDate *string                    `json:"preorder_approximate_release_date,omitempty"`
	ExternalPurchaseURL            string                     `json:"external_purchase_url,omitempty"`
	Restricted                     bool                       `json:"restricted,omitempty"`
	Exclusive                      bool                       `json:"exclusive,omitempty"`
	Deleted                        bool                       `json:"deleted,omitempty"`
	ShowAgeGate                    bool                       `json:"show_age_gate"`
	ManifestLabels                 []string                   `json:"manifest_labels"`
	BundledSKUs                    []PrivateSKU               `json:"bundled_skus,omitempty"`
	PriceTier                      int                        `json:"price_tier"`
	Price                          map[string]int             `json:"price"`
	SalePriceTier                  int                        `json:"sale_price_tier"`
	SalePrice                      map[string]int             `json:"sale_price"`
	ContentRatings                 map[int]ContentRating      `json:"content_ratings"`
}

PrivateSKU mirrors the Discord private sku object.

type PrivateStoreListing

type PrivateStoreListing struct {
	ID                   string          `json:"id"`
	Summary              json.RawMessage `json:"summary,omitempty"`     // string or locale-keyed map of strings
	Description          json.RawMessage `json:"description,omitempty"` // string or locale-keyed map of strings
	Tagline              json.RawMessage `json:"tagline,omitempty"`     // string or locale-keyed map of strings
	FlavorText           string          `json:"flavor_text,omitempty"`
	EntitlementBranchID  string          `json:"entitlement_branch_id,omitempty"`
	StaffNotes           *StoreNote      `json:"staff_notes,omitempty"`
	Assets               []StoreAsset    `json:"assets,omitempty"`
	CarouselItems        []CarouselItem  `json:"carousel_items,omitempty"`
	PreviewVideo         *StoreAsset     `json:"preview_video,omitempty"`
	HeaderBackground     *StoreAsset     `json:"header_background,omitempty"`
	HeroBackground       *StoreAsset     `json:"hero_background,omitempty"`
	HeroVideo            *StoreAsset     `json:"hero_video,omitempty"`
	BoxArt               *StoreAsset     `json:"box_art,omitempty"`
	Thumbnail            *StoreAsset     `json:"thumbnail,omitempty"`
	HeaderLogoLightTheme *StoreAsset     `json:"header_logo_light_theme,omitempty"`
	HeaderLogoDarkTheme  *StoreAsset     `json:"header_logo_dark_theme,omitempty"`
	SKU                  PublicSKU       `json:"sku"`
	ChildSKUs            []PublicSKU     `json:"child_skus,omitempty"`
	AlternativeSKUs      []PublicSKU     `json:"alternative_skus,omitempty"`
	PublishedAt          *time.Time      `json:"published_at,omitempty"`
	UnpublishedAt        *time.Time      `json:"unpublished_at,omitempty"`
	Published            bool            `json:"published"`
}

PrivateStoreListing mirrors the Discord private store listing object.

type PrivateVoiceState

type PrivateVoiceState struct {
	UserID     string  `json:"user_id"`
	SessionID  string  `json:"session_id"`
	Deaf       bool    `json:"deaf"`
	Mute       bool    `json:"mute"`
	SelfDeaf   bool    `json:"self_deaf"`
	SelfMute   bool    `json:"self_mute"`
	SelfVideo  bool    `json:"self_video"`
	Suppress   bool    `json:"suppress"`
	Member     *Member `json:"member,omitempty"`
	SelfStream bool    `json:"self_stream,omitempty"`
	ChannelID  *string `json:"channel_id"`
}

PrivateVoiceState mirrors the Discord private voice state object.

type ProfileApplication

type ProfileApplication struct {
	ID                           string                    `json:"id"`
	Verified                     bool                      `json:"verified"`
	StorefrontAvailable          bool                      `json:"storefront_available"`
	PopularApplicationCommandIDs []string                  `json:"popular_application_command_ids,omitempty"`
	PrimarySKUID                 string                    `json:"primary_sku_id,omitempty"`
	Flags                        int                       `json:"flags"`
	CustomInstallURL             string                    `json:"custom_install_url,omitempty"`
	InstallParams                *ApplicationInstallParams `json:"install_params,omitempty"`
}

ProfileApplication mirrors the Discord profile application object.

type ProfileBadge

type ProfileBadge struct {
	ID          string `json:"id"`
	Description string `json:"description"`
	Icon        string `json:"icon"`
	Link        string `json:"link,omitempty"`
}

ProfileBadge mirrors the Discord profile badge object.

type ProfileEffect

type ProfileEffect struct {
	ID        string `json:"id"`
	ExpiresAt *int   `json:"expires_at"`
}

ProfileEffect mirrors the Discord profile effect object.

type ProfileMetadata

type ProfileMetadata struct {
	GuildID                     string         `json:"guild_id,omitempty"`
	Bio                         string         `json:"bio,omitempty"`
	Banner                      *string        `json:"banner,omitempty"`
	AccentColor                 *int           `json:"accent_color,omitempty"`
	ThemeColors                 []int          `json:"theme_colors,omitempty"` // fixed-length array of 2
	Emoji                       *Emoji         `json:"emoji,omitempty"`
	PopoutAnimationParticleType *string        `json:"popout_animation_particle_type,omitempty"`
	ProfileEffect               *ProfileEffect `json:"profile_effect,omitempty"`
	Pronouns                    string         `json:"pronouns"`
}

ProfileMetadata mirrors the Discord profile metadata object.

type ProfileUser

type ProfileUser struct {
	ID                   string                `json:"id"`
	Username             string                `json:"username"`
	Discriminator        string                `json:"discriminator"`
	Avatar               *string               `json:"avatar"`
	AvatarDecorationData *AvatarDecorationData `json:"avatar_decoration_data,omitempty"`
	PublicFlags          int                   `json:"public_flags,omitempty"`
	Bot                  bool                  `json:"bot,omitempty"`
	System               bool                  `json:"system,omitempty"`
	GlobalName           *string               `json:"global_name"`
	PrimaryGuild         *UserPrimaryGuild     `json:"primary_guild,omitempty"`
	DisplayNameStyles    *DisplayNameStyles    `json:"display_name_styles,omitempty"`
	Collectibles         *UserCollectibles     `json:"collectibles,omitempty"`
	Banner               *string               `json:"banner"`
	AccentColor          *int                  `json:"accent_color"`
	Bio                  string                `json:"bio"`
}

ProfileUser mirrors the Discord profile user object.

type ProgressInfo

type ProgressInfo struct {
	CurrentCount   int `json:"current_count"`   // Messages fetched in the current batch
	TotalFetched   int `json:"total_fetched"`   // Total messages fetched so far
	EstimatedTotal int `json:"estimated_total"` // Estimated total messages in the channel
}

ProgressInfo contains progress information for GetAllMessages

type Promotion

type Promotion struct {
	ID                          string   `json:"id"`
	TrialID                     string   `json:"trial_id,omitempty"`
	StartDate                   string   `json:"start_date"`
	EndDate                     string   `json:"end_date"`
	PromotionType               int      `json:"promotion_type"`
	Flags                       int      `json:"flags"`
	OutboundTitle               string   `json:"outbound_title,omitempty"`
	OutboundRedemptionModalBody string   `json:"outbound_redemption_modal_body"`
	OutboundRedemptionPageLink  string   `json:"outbound_redemption_page_link,omitempty"`
	OutboundRedemptionURLFormat string   `json:"outbound_redemption_url_format,omitempty"`
	OutboundRedemptionEndDate   string   `json:"outbound_redemption_end_date,omitempty"`
	OutboundRestrictedCountries []string `json:"outbound_restricted_countries,omitempty"`
	OutboundTermsAndConditions  string   `json:"outbound_terms_and_conditions"`
	InboundHeaderText           string   `json:"inbound_header_text,omitempty"`
	InboundBodyText             string   `json:"inbound_body_text,omitempty"`
	InboundHelpCenterLink       string   `json:"inbound_help_center_link,omitempty"`
	InboundRestrictedCountries  []string `json:"inbound_restricted_countries,omitempty"`
}

Promotion mirrors the Discord promotion object.

type PromotionalPrice

type PromotionalPrice struct {
	Amount   int    `json:"amount"`
	Currency string `json:"currency"`
}

PromotionalPrice mirrors the Discord promotional price object.

type ProtoSettings

type ProtoSettings struct {
	Settings  string `json:"settings"`
	OutOfDate bool   `json:"out_of_date,omitempty"`
}

ProtoSettings mirrors the Discord proto settings object.

type ProtoSettingsType

type ProtoSettingsType int

ProtoSettingsType is the Discord proto settings type enumeration.

const (
	ProtoSettingsTypePreloaded            ProtoSettingsType = 1
	ProtoSettingsTypeFrecencyAndFavorites ProtoSettingsType = 2
	ProtoSettingsTypeTestSettings         ProtoSettingsType = 3
)

ProtoSettingsType values.

type PruneMembersParams

type PruneMembersParams struct {
	// ComputePruneCount asks for the number of pruned members in the answer
	// (PruneMembers only; the answer's Pruned is null otherwise).
	ComputePruneCount bool
	// IncludeRoles also prunes members that have these roles.
	IncludeRoles []string
}

PruneMembersParams are the optional parts of PruneMembers and EstimatePrunedMembers.

type PublicSKU

type PublicSKU struct {
	ID                             string                     `json:"id"`
	Type                           SKUType                    `json:"type"`
	Premium                        bool                       `json:"premium"`
	PreorderReleaseDate            *string                    `json:"preorder_release_date"`
	PreorderReleasedAt             *time.Time                 `json:"preorder_released_at,omitempty"`
	ProductLine                    *SKUProductLine            `json:"product_line"`
	Name                           json.RawMessage            `json:"name"`                   // string or locale-keyed map of strings
	Summary                        json.RawMessage            `json:"summary,omitempty"`      // string or locale-keyed map of strings
	LegalNotice                    json.RawMessage            `json:"legal_notice,omitempty"` // string or locale-keyed map of strings
	Slug                           string                     `json:"slug"`
	DependentSKUID                 *string                    `json:"dependent_sku_id"`
	ApplicationID                  string                     `json:"application_id"`
	Application                    *PartialApplication        `json:"application,omitempty"`
	Flags                          int                        `json:"flags"`
	AccessType                     SKUAccessLevel             `json:"access_type"`
	Features                       []int                      `json:"features"`
	Locales                        []string                   `json:"locales,omitempty"`
	Genres                         []int                      `json:"genres,omitempty"`
	AvailableRegions               []string                   `json:"available_regions,omitempty"`
	SystemRequirements             map[int]SystemRequirements `json:"system_requirements,omitempty"`
	ReleaseDate                    *string                    `json:"release_date"`
	PreorderApproximateReleaseDate *string                    `json:"preorder_approximate_release_date,omitempty"`
	ExternalPurchaseURL            string                     `json:"external_purchase_url,omitempty"`
	Restricted                     bool                       `json:"restricted,omitempty"`
	Exclusive                      bool                       `json:"exclusive,omitempty"`
	Deleted                        bool                       `json:"deleted,omitempty"`
	ShowAgeGate                    bool                       `json:"show_age_gate"`
	ManifestLabels                 []string                   `json:"manifest_labels"`
	BundledSKUs                    []PublicSKU                `json:"bundled_skus,omitempty"`
	Price                          SKUPrice                   `json:"price"`
	ContentRatingAgency            ContentRatingAgency        `json:"content_rating_agency,omitempty"`
	ContentRating                  *ContentRating             `json:"content_rating,omitempty"`
}

PublicSKU mirrors the Discord public sku object.

type PublicStoreListing

type PublicStoreListing struct {
	ID                   string          `json:"id"`
	Summary              json.RawMessage `json:"summary,omitempty"`     // string or locale-keyed map of strings
	Description          json.RawMessage `json:"description,omitempty"` // string or locale-keyed map of strings
	Tagline              json.RawMessage `json:"tagline,omitempty"`     // string or locale-keyed map of strings
	FlavorText           string          `json:"flavor_text,omitempty"`
	EntitlementBranchID  string          `json:"entitlement_branch_id,omitempty"`
	StaffNotes           *StoreNote      `json:"staff_notes,omitempty"`
	Assets               []StoreAsset    `json:"assets,omitempty"`
	CarouselItems        []CarouselItem  `json:"carousel_items,omitempty"`
	PreviewVideo         *StoreAsset     `json:"preview_video,omitempty"`
	HeaderBackground     *StoreAsset     `json:"header_background,omitempty"`
	HeroBackground       *StoreAsset     `json:"hero_background,omitempty"`
	HeroVideo            *StoreAsset     `json:"hero_video,omitempty"`
	BoxArt               *StoreAsset     `json:"box_art,omitempty"`
	Thumbnail            *StoreAsset     `json:"thumbnail,omitempty"`
	HeaderLogoLightTheme *StoreAsset     `json:"header_logo_light_theme,omitempty"`
	HeaderLogoDarkTheme  *StoreAsset     `json:"header_logo_dark_theme,omitempty"`
	SKU                  PublicSKU       `json:"sku"`
	ChildSKUs            []PublicSKU     `json:"child_skus,omitempty"`
	AlternativeSKUs      []PublicSKU     `json:"alternative_skus,omitempty"`
	PublishedAt          *time.Time      `json:"published_at,omitempty"`
	UnpublishedAt        *time.Time      `json:"unpublished_at,omitempty"`
	Guild                *PartialGuild   `json:"guild,omitempty"`
}

PublicStoreListing mirrors the Discord public store listing object.

type PurchaseNotificationResponse

type PurchaseNotificationResponse struct {
	Type                 PurchaseNotificationResponseType `json:"type"`
	GuildProductPurchase *GuildProductPurchase            `json:"guild_product_purchase"`
}

PurchaseNotificationResponse mirrors the Discord purchase notification response object.

type PurchaseNotificationResponseType

type PurchaseNotificationResponseType int

PurchaseNotificationResponseType is the Discord purchase notification response type enumeration.

const (
	PurchaseNotificationResponseTypeGuildProduct PurchaseNotificationResponseType = 0
)

PurchaseNotificationResponseType values.

type PurchaseSKUParams

type PurchaseSKUParams struct {
	PaymentSourceID        string
	PaymentSourceToken     string // sent with PaymentSourceID (null when empty)
	SubscriptionPlanID     string
	ExpectedAmount         *int
	ExpectedCurrency       string
	Gift                   bool
	GiftStyle              int
	TestMode               bool
	PurchaseToken          string
	ReturnURL              string
	GatewayCheckoutContext map[string]interface{}
}

PurchaseSKUParams are the options of PurchaseSKU.

type PutSavedMessageParams

type PutSavedMessageParams struct {
	DueAt  string `json:"due_at,omitempty"` // reminder time; omit for a plain bookmark
	Source string `json:"source,omitempty"`
}

PutSavedMessageParams are the options of PutSavedMessage.

type QOSHeartbeatPayload

type QOSHeartbeatPayload struct {
	Seq int64       `json:"seq"`
	QOS *QOSPayload `json:"qos"`
}

QOSHeartbeatPayload is the payload of op 40 QOS_HEARTBEAT.

type QOSPayload

type QOSPayload struct {
	Active  bool     `json:"active"`
	Ver     int      `json:"ver"`
	Reasons []string `json:"reasons"`
}

QOSPayload is the "qos" object of op 40 QOS_HEARTBEAT.

func DefaultQOS

func DefaultQOS() *QOSPayload

DefaultQOS is what a foregrounded client reports: the web client's shape and version, with discord.py-self's reasons.

type QuestActionParams

type QuestActionParams struct {
	Location              string                 // where the action was taken (the client's quest content location)
	MetadataSealed        string                 // metadata_sealed (null when empty)
	TrafficMetadataSealed string                 // traffic_metadata_sealed (null when empty)
	Extra                 map[string]interface{} // any further fields the client spreads into the body
}

QuestActionParams are the optional body fields of the quest enrol, claim and dismiss calls.

type QuestCreativeParams

type QuestCreativeParams struct {
	DecisionMetadataSealed string
	TrafficMetadataSealed  string
	ClientAdSessionID      string // claim only
	ClientHeartbeatSession string // claim only
	Placement              string // dismiss only
	AdCreativeType         int    // dismiss only; sent when non-zero
}

QuestCreativeParams are the optional fields of the quest creative calls.

type QuestHeartbeatParams

type QuestHeartbeatParams struct {
	Terminal              bool   // true on the last heartbeat of a play session
	ExecutablePath        string // null when empty
	ExecutableFingerprint string // null when empty
}

QuestHeartbeatParams are the optional fields of QuestHeartbeat.

type QuestPreviewUpdateEvent

type QuestPreviewUpdateEvent struct {
	QuestID string `json:"quest_id"`
}

QuestPreviewUpdateEvent is QUEST_PREVIEW_UPDATE (web).

type QuestsUserCompletionUpdateEvent

type QuestsUserCompletionUpdateEvent struct {
	QuestEnrollmentBlockedUntil *string `json:"quest_enrollment_blocked_until"`
}

QuestsUserCompletionUpdateEvent is QUESTS_USER_COMPLETION_UPDATE (web).

type QuestsUserStatusUpdateEvent

type QuestsUserStatusUpdateEvent struct {
	UserStatus json.RawMessage `json:"user_status"`
}

QuestsUserStatusUpdateEvent is QUESTS_USER_STATUS_UPDATE (web).

type RTCRegion

type RTCRegion struct {
	Region string   `json:"region"`
	IPs    []string `json:"ips"`
}

RTCRegion mirrors the Discord rtc region object.

type RadioGroupComponent

type RadioGroupComponent struct {
	Type     ComponentType `json:"type"`
	ID       int           `json:"id,omitempty"`
	CustomID string        `json:"custom_id"`
	Options  []OptionBase  `json:"options,omitempty"`
	Required bool          `json:"required,omitempty"`
}

RadioGroupComponent mirrors the Discord radio group component object.

type RateLimitResponse

type RateLimitResponse struct {
	Message    string  `json:"message"`
	RetryAfter float64 `json:"retry_after"`
	Global     bool    `json:"global"`
}

RateLimitResponse represents a Discord rate limit error response

type RateLimiter

type RateLimiter struct {
	// contains filtered or unexported fields
}

RateLimiter spaces requests by a minimum delay (Config.RateLimited). It is safe for concurrent use.

func NewRateLimiter

func NewRateLimiter() *RateLimiter

NewRateLimiter creates a new rate limiter

func (*RateLimiter) Wait

func (r *RateLimiter) Wait()

Wait waits for rate limit if needed

type ReactionCountDetails

type ReactionCountDetails struct {
	Burst  int `json:"burst"`
	Normal int `json:"normal"`
}

ReactionCountDetails mirrors the Discord reaction count details object.

type ReactionNotificationSentEvent

type ReactionNotificationSentEvent struct {
	Title         string          `json:"title"`
	Body          string          `json:"body"`
	Icon          *string         `json:"icon,omitempty"`
	ReactorUserID string          `json:"reactor_user_id"`
	Emoji         json.RawMessage `json:"emoji,omitempty"`
	Message       *Message        `json:"message,omitempty"`
	Route         json.RawMessage `json:"route,omitempty"`
	TrackingType  json.RawMessage `json:"tracking_type,omitempty"`
}

ReactionNotificationSentEvent is REACTION_NOTIFICATION_SENT (web).

type ReactionType

type ReactionType int

ReactionType is the Discord reaction type enumeration.

const (
	ReactionTypeNormal ReactionType = 0
	ReactionTypeBurst  ReactionType = 1
)

ReactionType values.

type ReactionUsersParams

type ReactionUsersParams struct {
	After string       // user ID to start after (pagination)
	Type  ReactionType // ReactionTypeNormal (default) or ReactionTypeBurst
}

ReactionUsersParams are the optional parameters of GetReactionUsers.

type ReadState

type ReadState struct {
	ID               string        `json:"id"`
	ReadStateType    ReadStateType `json:"read_state_type,omitempty"`
	LastMessageID    string        `json:"last_message_id,omitempty"`
	LastAckedID      string        `json:"last_acked_id,omitempty"`
	LastPinTimestamp *time.Time    `json:"last_pin_timestamp,omitempty"`
	MentionCount     int           `json:"mention_count,omitempty"`
	BadgeCount       int           `json:"badge_count,omitempty"`
	Flags            int           `json:"flags,omitempty"`
	LastViewed       *int          `json:"last_viewed,omitempty"`
}

ReadState mirrors the Discord read state object.

type ReadStateType

type ReadStateType int

ReadStateType is the Discord read state type enumeration.

const (
	ReadStateTypeChannel            ReadStateType = 0
	ReadStateTypeScheduledEvents    ReadStateType = 1
	ReadStateTypeNotificationCenter ReadStateType = 2
	ReadStateTypeGuildHome          ReadStateType = 3
	ReadStateTypeOnboarding         ReadStateType = 4
)

ReadStateType values.

type ReadyNotificationSettings

type ReadyNotificationSettings struct {
	Flags int `json:"flags"`
}

ReadyNotificationSettings is READY notification_settings.

type ReadyPayload

type ReadyPayload struct {
	Version          int                    `json:"v"`
	User             User                   `json:"user"`
	Guilds           []Guild                `json:"guilds"`
	SessionID        string                 `json:"session_id"`
	ResumeGatewayURL string                 `json:"resume_gateway_url"`
	Shard            []int                  `json:"shard,omitempty"`
	Application      map[string]interface{} `json:"application"`

	// GatewayGuilds holds the same guilds as Guilds, decoded with the full
	// gateway layout (client_state_v2 "properties", roles, channels, threads,
	// ...). Guilds' Name/Icon/Description/OwnerID are filled from properties
	// when the capability moved them there.
	GatewayGuilds []GatewayGuild `json:"-"`

	SessionType           string   `json:"session_type,omitempty"`
	Trace                 []string `json:"_trace,omitempty"`
	APICodeVersion        int      `json:"api_code_version,omitempty"`
	AnalyticsToken        string   `json:"analytics_token,omitempty"`
	AuthSessionIDHash     string   `json:"auth_session_id_hash,omitempty"`
	AuthToken             string   `json:"auth_token,omitempty"` // CapabilityAuthTokenRefresh: replace the token with this
	StaticClientSessionID string   `json:"static_client_session_id,omitempty"`
	CountryCode           string   `json:"country_code,omitempty"`
	RequiredAction        string   `json:"required_action,omitempty"`
	// QOSToken is DerivedQosData (base64 protobuf); it is echoed back in the
	// IDENTIFY qos_token of later connections.
	QOSToken string `json:"qos_token,omitempty"`

	// With CapabilityDedupeUserObjects, user objects referenced elsewhere live here.
	Users             []User         `json:"users,omitempty"`
	PrivateChannels   []Channel      `json:"private_channels,omitempty"`
	Relationships     []Relationship `json:"relationships,omitempty"`
	MergedMembers     MergedMembers  `json:"merged_members,omitempty"`
	Sessions          []Session      `json:"sessions,omitempty"`
	ConnectedAccounts []Connection   `json:"connected_accounts,omitempty"`
	GuildJoinRequests []JoinRequest  `json:"guild_join_requests,omitempty"`
	// With CapabilityVersionedReadStates / CapabilityVersionedUserGuildSettings.
	ReadState         VersionedReadStates        `json:"read_state"`
	UserGuildSettings VersionedUserGuildSettings `json:"user_guild_settings"`
	// UserSettingsProto is base64 PreloadedUserSettings (CapabilityUserSettingsProto).
	UserSettingsProto string `json:"user_settings_proto,omitempty"`

	Consents              *PartialConsentSettings `json:"consents,omitempty"`
	Tutorial              *ReadyTutorial          `json:"tutorial,omitempty"`
	GeoOrderedRTCRegions  []string                `json:"geo_ordered_rtc_regions,omitempty"`
	FriendSuggestionCount int                     `json:"friend_suggestion_count,omitempty"`
	PendingPayments       []Payment               `json:"pending_payments,omitempty"`
	ApexExperiments       *ApexExperimentResponse `json:"apex_experiments,omitempty"`
	// Experiments are positional arrays ([hash, revision, bucket, override, ...]).
	Experiments      []json.RawMessage `json:"experiments,omitempty"`
	GuildExperiments []json.RawMessage `json:"guild_experiments,omitempty"`

	NotificationSettings             *ReadyNotificationSettings `json:"notification_settings,omitempty"`
	ExplicitContentScanVersion       int                        `json:"explicit_content_scan_version,omitempty"`
	AdPersonalizationTogglesDisabled bool                       `json:"ad_personalization_toggles_disabled,omitempty"`
	BroadcasterUserIDs               []string                   `json:"broadcaster_user_ids,omitempty"`
	// Keys the web client reads whose shape is not established.
	Auth                  json.RawMessage `json:"auth,omitempty"`
	LinkedUsers           json.RawMessage `json:"linked_users,omitempty"`
	GameRelationships     json.RawMessage `json:"game_relationships,omitempty"`
	RegionalFeatureConfig json.RawMessage `json:"regional_feature_config,omitempty"`
}

ReadyPayload is the READY dispatch, the session's initial state. The field set follows discord.py-self's types/gateway.py ReadyEvent and the keys the web client's READY handler reads; layouts that depend on capabilities are noted.

func (*ReadyPayload) UnmarshalJSON

func (r *ReadyPayload) UnmarshalJSON(b []byte) error

UnmarshalJSON decodes READY, decoding guilds both into Guilds and GatewayGuilds.

type ReadySupplementalEvent

type ReadySupplementalEvent struct {
	Guilds              []SupplementalGuild `json:"guilds"`
	MergedMembers       MergedMembers       `json:"merged_members"`
	MergedPresences     MergedPresences     `json:"merged_presences"`
	LazyPrivateChannels []Channel           `json:"lazy_private_channels"`
	UserActivities      []Activity          `json:"user_activities"`
	GameInvites         []interface{}       `json:"game_invites"`
	Disclose            []string            `json:"disclose"`
}

ReadySupplementalEvent represents the READY_SUPPLEMENTAL event

type ReadyTutorial

type ReadyTutorial struct {
	IndicatorsSuppressed bool     `json:"indicators_suppressed"`
	IndicatorsConfirmed  []string `json:"indicators_confirmed"`
}

ReadyTutorial is READY tutorial.

type RecentMentionDeleteEvent

type RecentMentionDeleteEvent struct {
	MessageID string `json:"message_id"`
}

RecentMentionDeleteEvent is RECENT_MENTION_DELETE.

type RecentMentionsParams

type RecentMentionsParams struct {
	Limit    *int   // default 25
	Before   string // message ID cursor
	GuildID  string
	Roles    *bool // include role mentions; nil means true
	Everyone *bool // include @everyone mentions; nil means true
}

RecentMentionsParams are the options of GetRecentMentions.

type RedeemGiftParams

type RedeemGiftParams struct {
	PaymentSourceID        string
	ChannelID              string // channel the code was found in (null when empty)
	GatewayCheckoutContext map[string]interface{}
}

RedeemGiftParams are the options of RedeemGift.

type RefreshedAttachmentURL

type RefreshedAttachmentURL struct {
	Original  string `json:"original"`
	Refreshed string `json:"refreshed"`
}

RefreshedAttachmentURL maps an expired CDN URL to its refreshed one.

type RefreshedAttachmentURLs

type RefreshedAttachmentURLs struct {
	RefreshedURLs []RefreshedAttachmentURL `json:"refreshed_urls"`
}

RefreshedAttachmentURLs is the response of RefreshAttachmentURLs.

type Relationship

type Relationship struct {
	ID       string           `json:"id"`
	Type     RelationshipType `json:"type"`
	User     *User            `json:"user"`
	Nickname *string          `json:"nickname"`
	Since    *time.Time       `json:"since,omitempty"`
}

Relationship mirrors the Discord relationship object.

type RelationshipAction

type RelationshipAction string

RelationshipAction names the user-facing action behind a relationship request. discord.py-self derives the X-Context-Properties header from it (the web client sends the screen the action came from).

const (
	RelationshipActionUnfriend             RelationshipAction = "unfriend"
	RelationshipActionUnblock              RelationshipAction = "unblock"
	RelationshipActionDenyRequest          RelationshipAction = "deny_request"
	RelationshipActionRemovePendingRequest RelationshipAction = "remove_pending_request"
	RelationshipActionAcceptRequest        RelationshipAction = "accept_request"
	RelationshipActionBlock                RelationshipAction = "block"
	RelationshipActionSendFriendRequest    RelationshipAction = "send_friend_request"
	RelationshipActionFriendSuggestion     RelationshipAction = "friend_suggestion"
)

RelationshipAction values.

type RelationshipEvent

type RelationshipEvent struct {
	Relationship
	ShouldNotify        bool    `json:"should_notify,omitempty"`
	IsSpamRequest       bool    `json:"is_spam_request,omitempty"`
	IsStrangerRequest   bool    `json:"is_stranger_request,omitempty"`
	UserIgnored         bool    `json:"user_ignored,omitempty"`
	Note                *string `json:"note,omitempty"`
	OriginApplicationID *string `json:"origin_application_id,omitempty"`
}

RelationshipEvent is RELATIONSHIP_ADD, RELATIONSHIP_UPDATE and RELATIONSHIP_REMOVE (REMOVE carries only id, type and user_ignored). The extra fields are the ones the web client reads.

type RelationshipParams

type RelationshipParams struct {
	// Location overrides the X-Context-Properties location (see the ContextLocation constants).
	Location string
	// Type is the relationship type to create (RelationshipTypeFriend, RelationshipTypeBlocked); nil lets Discord choose.
	Type *RelationshipType
	// ConfirmStrangerRequest confirms a friend request to a user you share nothing with.
	ConfirmStrangerRequest bool
}

RelationshipParams are the optional parts of AddRelationship and RemoveRelationship.

type RelationshipType

type RelationshipType int

RelationshipType is the Discord relationship type enumeration.

const (
	RelationshipTypeNone            RelationshipType = 0
	RelationshipTypeFriend          RelationshipType = 1
	RelationshipTypeBlocked         RelationshipType = 2
	RelationshipTypeIncomingRequest RelationshipType = 3
	RelationshipTypeOutgoingRequest RelationshipType = 4
	RelationshipTypeImplicit        RelationshipType = 5
	RelationshipTypeSuggestion      RelationshipType = 6
)

RelationshipType values.

type ReportActivityParams

type ReportActivityParams struct {
	ApplicationID  string `json:"application_id"`
	Token          string `json:"token,omitempty"`
	Duration       int    `json:"duration"`
	ShareActivity  bool   `json:"share_activity"`
	Distributor    string `json:"distributor,omitempty"`
	Closed         bool   `json:"closed,omitempty"`
	ExePath        string `json:"exePath,omitempty"`
	VoiceChannelID string `json:"voice_channel_id,omitempty"`
	SessionID      string `json:"session_id,omitempty"`
	MediaSessionID string `json:"media_session_id,omitempty"`
}

ReportActivityParams is the body of ReportActivity.

type ReportUnverifiedApplicationParams

type ReportUnverifiedApplicationParams struct {
	Executable  string
	Publisher   string
	Distributor string // distributor_application.distributor
	SKU         string // distributor_application.sku (sent as "" when Distributor is set)
}

ReportUnverifiedApplicationParams are the optional fields of ReportUnverifiedApplication.

type RequestGuildMembersPayload

type RequestGuildMembersPayload struct {
	GuildIDs  []string `json:"guild_id"`
	Query     *string  `json:"query,omitempty"`
	Limit     *int     `json:"limit,omitempty"`
	UserIDs   []string `json:"user_ids,omitempty"`
	Presences bool     `json:"presences"`
	Nonce     string   `json:"nonce,omitempty"`
}

RequestGuildMembersPayload is the op 8 REQUEST_GUILD_MEMBERS payload. GuildIDs is sent as an array, as discord.py-self does; the web client sends a single ID or an array.

type RequestOptions

type RequestOptions struct {
	Query      url.Values        // appended as the query string
	Body       interface{}       // JSON-marshalled; []byte and json.RawMessage are sent as-is
	Files      []File            // non-empty => multipart/form-data: "payload_json" = Body (omitted when nil), parts "files[0]", … or File.Field
	Reason     string            // X-Audit-Log-Reason (URL-escaped)
	Context    interface{}       // X-Context-Properties = base64(JSON(Context))
	Headers    map[string]string // extra or overriding headers
	NoAuth     bool              // do not send Authorization
	APIVersion string            // "" => "v9"
}

RequestOptions are the optional parts of one REST call. A nil *RequestOptions is valid.

type RequiredActionUpdateEvent

type RequiredActionUpdateEvent struct {
	RequiredAction *string `json:"required_action"`
}

RequiredActionUpdateEvent is USER_REQUIRED_ACTION_UPDATE.

type ResolvedData

type ResolvedData struct {
	Users       map[string]*User             `json:"users,omitempty"`
	Members     map[string]*Member           `json:"members,omitempty"`
	Roles       map[string]Role              `json:"roles,omitempty"`
	Channels    map[string]*Channel          `json:"channels,omitempty"`
	Messages    map[string]*Message          `json:"messages,omitempty"`
	Attachments map[string]PartialAttachment `json:"attachments,omitempty"`
}

ResolvedData mirrors the Discord resolved data object.

type Response

type Response struct {
	StatusCode int
	Header     http.Header
	Body       []byte // decompressed
}

Response is a completed REST response.

type ResumePayload

type ResumePayload struct {
	Token     string `json:"token"`
	SessionID string `json:"session_id"`
	Sequence  int64  `json:"seq"`
}

ResumePayload is the RESUME payload.

type ResumedEvent

type ResumedEvent struct {
	Trace []string `json:"_trace,omitempty"`
}

ResumedEvent is RESUMED.

type Role

type Role struct {
	ID           string      `json:"id"`
	Name         string      `json:"name"`
	Color        int         `json:"color"`
	Colors       RoleColours `json:"colors"`
	Hoist        bool        `json:"hoist"`
	Position     int         `json:"position"`
	Permissions  string      `json:"permissions"`
	Managed      bool        `json:"managed"`
	Mentionable  bool        `json:"mentionable"`
	Flags        int         `json:"flags"`
	Icon         *string     `json:"icon,omitempty"`
	UnicodeEmoji *string     `json:"unicode_emoji,omitempty"`
	Tags         *RoleTags   `json:"tags,omitempty"`
}

Role mirrors the Discord role object.

type RoleColours

type RoleColours struct {
	PrimaryColor   int  `json:"primary_color"`
	SecondaryColor *int `json:"secondary_color"`
	TertiaryColor  *int `json:"tertiary_color"`
}

RoleColours mirrors the Discord role colours object.

type RoleColoursParams

type RoleColoursParams struct {
	PrimaryColor   *int               `json:"primary_color,omitempty"`
	SecondaryColor NullableField[int] `json:"secondary_color,omitzero"`
	TertiaryColor  NullableField[int] `json:"tertiary_color,omitzero"`
}

RoleColoursParams is the "colors" object of a role create or edit. Unset fields are left out; NullField clears the secondary or tertiary colour.

type RoleConnection

type RoleConnection struct {
	PlatformName        *string                  `json:"platform_name"`
	PlatformUsername    *string                  `json:"platform_username"`
	Metadata            map[string]string        `json:"metadata"`
	Application         BaseApplication          `json:"application"`
	ApplicationMetadata []RoleConnectionMetadata `json:"application_metadata"`
}

RoleConnection mirrors the Discord role connection object.

type RoleConnectionMetadata

type RoleConnectionMetadata struct {
	Type                     int               `json:"type"` // one of 1, 2, 3, 4, 5, 6, 7, 8
	Key                      string            `json:"key"`
	Name                     string            `json:"name"`
	Description              string            `json:"description"`
	NameLocalizations        map[string]string `json:"name_localizations,omitempty"`
	DescriptionLocalizations map[string]string `json:"description_localizations,omitempty"`
}

RoleConnectionMetadata mirrors the Discord role connection metadata object.

type RoleParams

type RoleParams struct {
	Name        *string            `json:"name,omitempty"`
	Permissions *string            `json:"permissions,omitempty"` // permission bit set as a decimal string
	Color       *int               `json:"color,omitempty"`
	Colors      *RoleColoursParams `json:"colors,omitempty"`
	Hoist       *bool              `json:"hoist,omitempty"`
	Mentionable *bool              `json:"mentionable,omitempty"`
	// Icon is a data URI (see ImageDataURI); NullField removes it.
	Icon NullableField[string] `json:"icon,omitzero"`
	// UnicodeEmoji is a unicode emoji shown as the role icon; NullField removes it.
	UnicodeEmoji NullableField[string]  `json:"unicode_emoji,omitzero"`
	Extra        map[string]interface{} `json:"-"`
}

RoleParams are the settable role fields, shared by CreateRole and EditRole. Nil pointers and unset NullableFields are left out of the request.

type RolePositionUpdate

type RolePositionUpdate struct {
	ID       string  `json:"id"`
	Position *string `json:"position,omitempty"`
}

RolePositionUpdate is the request body for updating a role position.

type RoleSelectComponent

type RoleSelectComponent struct {
	Type          ComponentType         `json:"type"`
	ID            int                   `json:"id,omitempty"`
	CustomID      string                `json:"custom_id"`
	Placeholder   string                `json:"placeholder,omitempty"`
	MinValues     int                   `json:"min_values,omitempty"`
	MaxValues     int                   `json:"max_values,omitempty"`
	Disabled      bool                  `json:"disabled,omitempty"`
	DefaultValues []SelectDefaultValues `json:"default_values,omitempty"`
}

RoleSelectComponent mirrors the Discord role select component object.

type RoleSubscriptionData

type RoleSubscriptionData struct {
	RoleSubscriptionListingID string `json:"role_subscription_listing_id"`
	TierName                  string `json:"tier_name"`
	TotalMonthsSubscribed     int    `json:"total_months_subscribed"`
	IsRenewal                 bool   `json:"is_renewal"`
}

RoleSubscriptionData mirrors the Discord role subscription data object.

type RoleTags

type RoleTags struct {
	BotID                 string          `json:"bot_id,omitempty"`
	IntegrationID         string          `json:"integration_id,omitempty"`
	SubscriptionListingID string          `json:"subscription_listing_id,omitempty"`
	PremiumSubscriber     json.RawMessage `json:"premium_subscriber,omitempty"`     // always null on the wire; presence marks the flag
	AvailableForPurchase  json.RawMessage `json:"available_for_purchase,omitempty"` // always null on the wire; presence marks the flag
	GuildConnections      json.RawMessage `json:"guild_connections,omitempty"`      // always null on the wire; presence marks the flag
}

RoleTags mirrors the Discord role tags object.

type SKU

type SKU struct {
	ID                             string                     `json:"id"`
	Type                           SKUType                    `json:"type"`
	Premium                        bool                       `json:"premium"`
	PreorderReleaseDate            *string                    `json:"preorder_release_date"`
	PreorderReleasedAt             *time.Time                 `json:"preorder_released_at,omitempty"`
	ProductLine                    *SKUProductLine            `json:"product_line"`
	Name                           json.RawMessage            `json:"name"`                   // string or locale-keyed map of strings
	Summary                        json.RawMessage            `json:"summary,omitempty"`      // string or locale-keyed map of strings
	LegalNotice                    json.RawMessage            `json:"legal_notice,omitempty"` // string or locale-keyed map of strings
	Slug                           string                     `json:"slug"`
	DependentSKUID                 *string                    `json:"dependent_sku_id"`
	ApplicationID                  string                     `json:"application_id"`
	Application                    *PartialApplication        `json:"application,omitempty"`
	Flags                          int                        `json:"flags"`
	AccessType                     SKUAccessLevel             `json:"access_type"`
	Features                       []int                      `json:"features"`
	Locales                        []string                   `json:"locales,omitempty"`
	Genres                         []int                      `json:"genres,omitempty"`
	AvailableRegions               []string                   `json:"available_regions,omitempty"`
	SystemRequirements             map[int]SystemRequirements `json:"system_requirements,omitempty"`
	ReleaseDate                    *string                    `json:"release_date"`
	PreorderApproximateReleaseDate *string                    `json:"preorder_approximate_release_date,omitempty"`
	ExternalPurchaseURL            string                     `json:"external_purchase_url,omitempty"`
	Restricted                     bool                       `json:"restricted,omitempty"`
	Exclusive                      bool                       `json:"exclusive,omitempty"`
	Deleted                        bool                       `json:"deleted,omitempty"`
	ShowAgeGate                    bool                       `json:"show_age_gate"`
	ManifestLabels                 []string                   `json:"manifest_labels"`
	BundledSKUs                    []SKU                      `json:"bundled_skus,omitempty"`
	Price                          json.RawMessage            `json:"price"` // SKUPrice on public SKUs, per-currency map on private SKUs
	ContentRatingAgency            ContentRatingAgency        `json:"content_rating_agency,omitempty"`
	ContentRating                  *ContentRating             `json:"content_rating,omitempty"`
	PriceTier                      int                        `json:"price_tier,omitempty"`
	SalePriceTier                  int                        `json:"sale_price_tier,omitempty"`
	SalePrice                      map[string]int             `json:"sale_price,omitempty"`
	ContentRatings                 map[int]ContentRating      `json:"content_ratings,omitempty"`
}

SKU is the flattened superset of PublicSKU, PrivateSKU; fields absent from a variant are omitted.

type SKUAccessLevel

type SKUAccessLevel int

SKUAccessLevel is the Discord sku access level enumeration.

const (
	SKUAccessLevelFull        SKUAccessLevel = 1
	SKUAccessLevelEarlyAccess SKUAccessLevel = 2
	SKUAccessLevelVipAccess   SKUAccessLevel = 3
)

SKUAccessLevel values.

type SKUPrice

type SKUPrice struct {
	Currency         string               `json:"currency"`
	CurrencyExponent int                  `json:"currency_exponent"`
	Amount           int                  `json:"amount"`
	SaleAmount       *int                 `json:"sale_amount,omitempty"`
	SalePercentage   int                  `json:"sale_percentage,omitempty"`
	Premium          map[int]PremiumPrice `json:"premium,omitempty"`
}

SKUPrice mirrors the Discord sku price object.

type SKUProductLine

type SKUProductLine int

SKUProductLine is the Discord sku product line enumeration.

const (
	SKUProductLinePremium      SKUProductLine = 1
	SKUProductLinePremiumGuild SKUProductLine = 2
	SKUProductLineIap          SKUProductLine = 3
	SKUProductLineGuildRole    SKUProductLine = 4
	SKUProductLineGuildProduct SKUProductLine = 5
	SKUProductLineApplication  SKUProductLine = 6
	SKUProductLineCollectible  SKUProductLine = 7
)

SKUProductLine values.

type SKUPurchase

type SKUPurchase struct {
	Entitlements        []Entitlement        `json:"entitlements"`
	LibraryApplications []LibraryApplication `json:"library_applications,omitempty"`
	GiftCode            string               `json:"gift_code,omitempty"`
}

SKUPurchase mirrors the Discord sku purchase object.

type SKUType

type SKUType int

SKUType is the Discord sku type enumeration.

const (
	SKUTypeDurablePrimary SKUType = 1
	SKUTypeDurable        SKUType = 2
	SKUTypeConsumable     SKUType = 3
	SKUTypeBundle         SKUType = 4
	SKUTypeSubscription   SKUType = 5
	SKUTypeGroup          SKUType = 6
)

SKUType values.

type ScheduledEventEntityMetadata

type ScheduledEventEntityMetadata struct {
	Location string `json:"location"`
}

ScheduledEventEntityMetadata mirrors the Discord scheduled event entity metadata object.

type ScheduledEventEntityType

type ScheduledEventEntityType int

ScheduledEventEntityType is the Discord scheduled event entity type enumeration.

const (
	ScheduledEventEntityTypeStageInstance ScheduledEventEntityType = 1
	ScheduledEventEntityTypeVoice         ScheduledEventEntityType = 2
	ScheduledEventEntityTypeExternal      ScheduledEventEntityType = 3
)

ScheduledEventEntityType values.

type ScheduledEventExceptionParams

type ScheduledEventExceptionParams struct {
	OriginalScheduledStartTime string  `json:"original_scheduled_start_time,omitempty"`
	ScheduledStartTime         *string `json:"scheduled_start_time,omitempty"`
	ScheduledEndTime           *string `json:"scheduled_end_time,omitempty"`
	IsCanceled                 *bool   `json:"is_canceled,omitempty"`
}

ScheduledEventExceptionParams are the fields of a recurring event exception: one occurrence that is moved or cancelled. Times are RFC 3339. OriginalScheduledStartTime is only sent on creation.

type ScheduledEventParams

type ScheduledEventParams struct {
	Name         *string               `json:"name,omitempty"`
	Description  NullableField[string] `json:"description,omitzero"`
	Image        NullableField[string] `json:"image,omitzero"` // data URI
	PrivacyLevel *PrivacyLevel         `json:"privacy_level,omitempty"`
	// ScheduledStartTime and ScheduledEndTime must be set for creation.
	ScheduledStartTime *time.Time                                  `json:"scheduled_start_time,omitempty"`
	ScheduledEndTime   NullableField[time.Time]                    `json:"scheduled_end_time,omitzero"`
	EntityType         *ScheduledEventEntityType                   `json:"entity_type,omitempty"`
	ChannelID          NullableField[string]                       `json:"channel_id,omitzero"`
	EntityMetadata     NullableField[ScheduledEventEntityMetadata] `json:"entity_metadata,omitzero"`
	Status             *ScheduledEventStatus                       `json:"status,omitempty"`
	RecurrenceRule     NullableField[GuildEventRecurrenceRule]     `json:"recurrence_rule,omitzero"`
	// BroadcastToDirectoryChannels also lists the event in linked directory channels.
	BroadcastToDirectoryChannels *bool                  `json:"broadcast_to_directory_channels,omitempty"`
	Extra                        map[string]interface{} `json:"-"`
}

ScheduledEventParams are the settable scheduled event fields, shared by CreateGuildScheduledEvent and EditScheduledEvent. Nil pointers and unset NullableFields are left out of the request; NullField sends null.

For a voice or stage event set ChannelID and EntityType; for an external event set EntityType to ScheduledEventEntityTypeExternal, EntityMetadata and ScheduledEndTime.

type ScheduledEventStatus

type ScheduledEventStatus int

ScheduledEventStatus is the Discord scheduled event status enumeration.

const (
	ScheduledEventStatusScheduled ScheduledEventStatus = 1
	ScheduledEventStatusActive    ScheduledEventStatus = 2
	ScheduledEventStatusCompleted ScheduledEventStatus = 3
	ScheduledEventStatusCanceled  ScheduledEventStatus = 4
)

ScheduledEventStatus values.

type ScheduledEventUserCounts

type ScheduledEventUserCounts struct {
	GuildScheduledEventCount           int            `json:"guild_scheduled_event_count"`
	GuildScheduledEventExceptionCounts map[string]int `json:"guild_scheduled_event_exception_counts"`
}

ScheduledEventUserCounts is the answer of GetScheduledEventUserCounts.

type ScheduledEventUserWithMember

type ScheduledEventUserWithMember struct {
	ID                   string                `json:"id"`
	Username             string                `json:"username"`
	Discriminator        string                `json:"discriminator"`
	Avatar               *string               `json:"avatar"`
	AvatarDecorationData *AvatarDecorationData `json:"avatar_decoration_data,omitempty"`
	PublicFlags          int                   `json:"public_flags,omitempty"`
	Bot                  bool                  `json:"bot,omitempty"`
	System               bool                  `json:"system,omitempty"`
	GlobalName           *string               `json:"global_name"`
	PrimaryGuild         *UserPrimaryGuild     `json:"primary_guild,omitempty"`
	DisplayNameStyles    *DisplayNameStyles    `json:"display_name_styles,omitempty"`
	Collectibles         *UserCollectibles     `json:"collectibles,omitempty"`
	Banner               *string               `json:"banner"`
	AccentColor          *int                  `json:"accent_color"`
	MFAEnabled           bool                  `json:"mfa_enabled,omitempty"`
	Locale               string                `json:"locale,omitempty"`
	Verified             bool                  `json:"verified,omitempty"`
	Email                *string               `json:"email,omitempty"`
	Flags                int                   `json:"flags,omitempty"`
	PurchasedFlags       int                   `json:"purchased_flags,omitempty"`
	PremiumUsageFlags    int                   `json:"premium_usage_flags,omitempty"`
	PremiumType          PremiumType           `json:"premium_type,omitempty"`
	Bio                  string                `json:"bio,omitempty"`
	AnalyticsToken       string                `json:"analytics_token,omitempty"`
	Phone                *string               `json:"phone,omitempty"`
	Token                string                `json:"token,omitempty"`
	NSFWAllowed          *bool                 `json:"nsfw_allowed,omitempty"`
	Desktop              bool                  `json:"desktop,omitempty"`
	Mobile               bool                  `json:"mobile,omitempty"`
	GuildMember          *Member               `json:"guild_member"`
}

ScheduledEventUserWithMember mirrors the Discord scheduled event user with member object.

type ScheduledEventUsers

type ScheduledEventUsers struct {
	Users []*User `json:"users"`
}

ScheduledEventUsers mirrors the Discord scheduled event users object.

type ScheduledEventUsersWithMember

type ScheduledEventUsersWithMember struct {
	Users []ScheduledEventUserWithMember `json:"users"`
}

ScheduledEventUsersWithMember mirrors the Discord scheduled event users with member object.

type SearchApplicationCommandsParams

type SearchApplicationCommandsParams struct {
	Query               string
	Limit               int      // sent when > 0
	IncludeApplications *bool    // include the application objects
	ApplicationID       string   // restrict to one application
	CommandIDs          []string // look up specific commands
	Cursor              string   // pagination cursor from the previous result
}

SearchApplicationCommandsParams are the options of SearchApplicationCommands.

type SearchGuildBansParams

type SearchGuildBansParams struct {
	// Query matches banned usernames.
	Query string
	// UserIDs restricts the search to these users.
	UserIDs []string
	// Limit is the page size (default 10, as the web client sends).
	Limit *int
}

SearchGuildBansParams are the optional parts of SearchGuildBans.

type SearchRecentMembersPayload

type SearchRecentMembersPayload struct {
	GuildID           string  `json:"guild_id"`
	Query             string  `json:"query"`
	ContinuationToken *string `json:"continuation_token"`
	Nonce             string  `json:"nonce,omitempty"` // discord.py-self only
}

SearchRecentMembersPayload is the op 35 SEARCH_RECENT_MEMBERS payload.

type SectionComponent

type SectionComponent struct {
	Type       ComponentType `json:"type"`
	ID         int           `json:"id,omitempty"`
	Components []Component   `json:"components"`
	Accessory  Component     `json:"accessory"`
}

SectionComponent mirrors the Discord section component object.

type SelectComponent

type SelectComponent struct {
	Type        ComponentType `json:"type"`
	ID          int           `json:"id,omitempty"`
	CustomID    string        `json:"custom_id"`
	Placeholder string        `json:"placeholder,omitempty"`
	MinValues   int           `json:"min_values,omitempty"`
	MaxValues   int           `json:"max_values,omitempty"`
	Disabled    bool          `json:"disabled,omitempty"`
}

SelectComponent mirrors the Discord select component object.

type SelectDefaultValues

type SelectDefaultValues struct {
	ID   int              `json:"id"`
	Type DefaultValueType `json:"type"`
}

SelectDefaultValues mirrors the Discord select default values object.

type SelectInteractionData

type SelectInteractionData struct {
	CustomID      string        `json:"custom_id"`
	ComponentType ComponentType `json:"component_type"`
	Values        []string      `json:"values"`
	Resolved      *ResolvedData `json:"resolved,omitempty"`
}

SelectInteractionData mirrors the Discord select interaction data object.

type SelectMenu

type SelectMenu struct {
	Type          ComponentType         `json:"type"`
	ID            int                   `json:"id,omitempty"`
	CustomID      string                `json:"custom_id"`
	Placeholder   string                `json:"placeholder,omitempty"`
	MinValues     int                   `json:"min_values,omitempty"`
	MaxValues     int                   `json:"max_values,omitempty"`
	Disabled      bool                  `json:"disabled,omitempty"`
	Required      bool                  `json:"required,omitempty"`
	Options       []SelectOption        `json:"options,omitempty"`
	ChannelTypes  []ChannelType         `json:"channel_types,omitempty"`
	DefaultValues []SelectDefaultValues `json:"default_values,omitempty"`
}

SelectMenu mirrors the Discord select menu object.

type SelectOption

type SelectOption struct {
	Label       string `json:"label"`
	Value       string `json:"value"`
	Default     bool   `json:"default,omitempty"`
	Description string `json:"description,omitempty"`
	Emoji       *Emoji `json:"emoji,omitempty"`
}

SelectOption mirrors the Discord select option object.

type SendGreetParams

type SendGreetParams struct {
	AllowedMentions  *AllowedMentions
	MessageReference *MessageReference
}

SendGreetParams are the optional parts of SendGreet.

type SendMessageParams

type SendMessageParams struct {
	Content string // message text; omitted when empty
	TTS     bool   // always sent, false by default (as the clients do)

	// Nonce is sent as "nonce". When empty a fresh snowflake nonce is
	// generated (discord.py-self does the same); set NoNonce to send none.
	Nonce   string
	NoNonce bool

	Embeds []Embed // omitted when nil

	// AllowedMentions is sent as "allowed_mentions"; nil slices inside it are
	// sent as empty lists.
	AllowedMentions *AllowedMentions

	// Reference makes the message a reply (Type 0) or a forward
	// (Type MessageReferenceTypeForward). Set ChannelID (and MessageID).
	Reference *MessageReference

	StickerIDs []string // sticker_ids; omitted when nil

	// Attachments is the "attachments" array. Use it for files uploaded through
	// the upload-URL flow (PartialAttachment{ID, Filename, UploadedFilename})
	// and, on edits, for existing attachments to keep. When Files is also set,
	// an entry {id: "<index>", filename, description} is appended for every
	// file; IDs of Attachments must not collide with the file indexes
	// "0".."len(Files)-1".
	Attachments []PartialAttachment

	// Files are uploaded as multipart/form-data ("payload_json" + "files[N]").
	// At most 10.
	Files []File

	Flags      *int        // e.g. MessageFlagSuppressEmbeds | MessageFlagSuppressNotifications
	Poll       *PollCreate // poll
	Components []Component // components

	// MobileNetworkType is sent as "mobile_network_type" (the web client sends "unknown").
	MobileNetworkType string

	// Null lists body keys to send as JSON null; Extra sets arbitrary body keys
	// (a nil value is sent as null). Both are applied last.
	Null  []string
	Extra map[string]interface{}

	// UploadClient is used by SendMessageCloudUpload for the PUT to the
	// upload URLs; nil means http.DefaultClient.
	UploadClient *http.Client
}

SendMessageParams are the optional parts of a message send. A nil *SendMessageParams is valid and sends an empty message body.

type SeparatorComponent

type SeparatorComponent struct {
	Type    ComponentType    `json:"type"`
	ID      int              `json:"id,omitempty"`
	Divider bool             `json:"divider,omitempty"`
	Spacing SeparatorSpacing `json:"spacing,omitempty"`
}

SeparatorComponent mirrors the Discord separator component object.

type SeparatorSpacing

type SeparatorSpacing int

SeparatorSpacing is the Discord separator spacing enumeration.

const (
	SeparatorSpacingSmall SeparatorSpacing = 1
	SeparatorSpacingLarge SeparatorSpacing = 2
)

SeparatorSpacing values.

type Session

type Session struct {
	SessionID        string     `json:"session_id"`
	Status           string     `json:"status"`
	Activities       []Activity `json:"activities"`
	ClientInfo       ClientInfo `json:"client_info"`
	Active           bool       `json:"active,omitempty"`
	HiddenActivities []Activity `json:"hidden_activities,omitempty"`
	ProcessedAt      int64      `json:"processed_at_timestamp,omitempty"`
}

Session represents a user session

type SessionsReplaceEvent

type SessionsReplaceEvent []Session

SessionsReplaceEvent represents the SESSIONS_REPLACE event

type SetGuildIdentityParams

type SetGuildIdentityParams struct {
	IdentityGuildID NullableField[string] `json:"identity_guild_id,omitzero"` // NullField clears the primary guild
	IdentityEnabled NullableField[bool]   `json:"identity_enabled,omitzero"`
}

SetGuildIdentityParams is the body of SetGuildIdentity.

type SettingsActivity

type SettingsActivity struct {
	Text      string     `json:"text,omitempty"`
	EmojiID   string     `json:"emoji_id,omitempty"`
	EmojiName string     `json:"emoji_name,omitempty"`
	ExpiresAt *time.Time `json:"expires_at,omitempty"`
}

SettingsActivity mirrors the Discord settings activity object.

type SignOrderParams

type SignOrderParams struct {
	ExpectedRevision       *int
	PurchaseToken          string
	GatewayCheckoutContext map[string]interface{}
	LoadID                 string // sent as X-Context-Properties {"load_id": ...}
}

SignOrderParams are the optional fields of SignOrder.

type SocialLayerSKUPurchaseEligibilityEvent

type SocialLayerSKUPurchaseEligibilityEvent struct {
	ApplicationID    string          `json:"application_id"`
	InteractionID    string          `json:"interaction_id"`
	RecipientID      string          `json:"recipient_id"`
	SKUID            string          `json:"sku_id"`
	Eligible         bool            `json:"eligible"`
	IneligibleReason json.RawMessage `json:"ineligible_reason,omitempty"`
}

SocialLayerSKUPurchaseEligibilityEvent is SOCIAL_LAYER_SKU_PURCHASE_ELIGIBILITY_RESPONSE (web).

type SoundboardSound

type SoundboardSound struct {
	SoundID   string  `json:"sound_id"`
	Name      string  `json:"name"`
	Volume    float64 `json:"volume"`
	EmojiID   *string `json:"emoji_id"`
	EmojiName *string `json:"emoji_name"`
	GuildID   string  `json:"guild_id,omitempty"`
	UserID    string  `json:"user_id,omitempty"`
	Available bool    `json:"available"`
	User      *User   `json:"user,omitempty"`
}

SoundboardSound is a guild soundboard sound (GUILD_SOUNDBOARD_SOUND_CREATE/UPDATE, SOUNDBOARD_SOUNDS, GUILD_SOUNDBOARD_SOUNDS_UPDATE; web).

type SoundboardSoundParams

type SoundboardSoundParams struct {
	Name *string `json:"name,omitempty"`
	// Sound is the audio as a data URI (create only).
	Sound     *string                `json:"sound,omitempty"`
	Volume    *float64               `json:"volume,omitempty"`
	EmojiID   NullableField[string]  `json:"emoji_id,omitzero"`
	EmojiName NullableField[string]  `json:"emoji_name,omitzero"`
	Extra     map[string]interface{} `json:"-"`
}

SoundboardSoundParams are the fields of CreateSoundboardSound and EditSoundboardSound. Nil pointers are left out; NullField clears the emoji.

type SoundboardSoundsEvent

type SoundboardSoundsEvent struct {
	GuildID          string            `json:"guild_id"`
	SoundboardSounds []SoundboardSound `json:"soundboard_sounds"`
}

SoundboardSoundsEvent is SOUNDBOARD_SOUNDS (the answer to op 31 REQUEST_SOUNDBOARD_SOUNDS, one per guild) and GUILD_SOUNDBOARD_SOUNDS_UPDATE (web).

type StageChannel

type StageChannel struct {
	ID                   string                 `json:"id"`
	GuildID              string                 `json:"guild_id"`
	Position             int                    `json:"position"`
	PermissionOverwrites []*PermissionOverwrite `json:"permission_overwrites"`
	ParentID             *string                `json:"parent_id"`
	Name                 string                 `json:"name"`
	Flags                int                    `json:"flags"`
	Type                 ChannelType            `json:"type"` // always 13
	Bitrate              int                    `json:"bitrate"`
	UserLimit            int                    `json:"user_limit"`
	RTCRegion            *string                `json:"rtc_region,omitempty"`
	Topic                string                 `json:"topic,omitempty"`
	NSFW                 bool                   `json:"nsfw"`
}

StageChannel mirrors the Discord stage channel object.

type StageInstance

type StageInstance struct {
	ID                    string       `json:"id"`
	GuildID               string       `json:"guild_id"`
	ChannelID             string       `json:"channel_id"`
	Topic                 string       `json:"topic"`
	PrivacyLevel          PrivacyLevel `json:"privacy_level"`
	DiscoverableDisabled  bool         `json:"discoverable_disabled"`
	InviteCode            *string      `json:"invite_code"`
	GuildScheduledEventID *string      `json:"guild_scheduled_event_id"`
}

StageInstance mirrors the Discord stage instance object.

type StageInstanceScheduledEvent

type StageInstanceScheduledEvent struct {
	ID                 string                   `json:"id"`
	GuildID            string                   `json:"guild_id"`
	EntityID           *string                  `json:"entity_id"`
	Name               string                   `json:"name"`
	ScheduledStartTime time.Time                `json:"scheduled_start_time"`
	PrivacyLevel       PrivacyLevel             `json:"privacy_level"`
	Status             ScheduledEventStatus     `json:"status"`
	CreatorID          *string                  `json:"creator_id,omitempty"`
	Description        *string                  `json:"description,omitempty"`
	Creator            *User                    `json:"creator,omitempty"`
	UserCount          int                      `json:"user_count,omitempty"`
	Image              *string                  `json:"image,omitempty"`
	SKUIDs             []string                 `json:"sku_ids"`
	ChannelID          string                   `json:"channel_id"`
	EntityMetadata     json.RawMessage          `json:"entity_metadata"`
	ScheduledEndTime   *time.Time               `json:"scheduled_end_time,omitempty"`
	EntityType         ScheduledEventEntityType `json:"entity_type"` // always 1
}

StageInstanceScheduledEvent mirrors the Discord stage instance scheduled event object.

type StandardSticker

type StandardSticker struct {
	ID          string            `json:"id"`
	Name        string            `json:"name"`
	Description string            `json:"description"`
	Tags        string            `json:"tags"`
	FormatType  StickerFormatType `json:"format_type"`
	Type        StickerType       `json:"type"` // always 1
	SortValue   int               `json:"sort_value"`
	PackID      string            `json:"pack_id"`
}

StandardSticker mirrors the Discord standard sticker object.

type StartForumThreadParams

type StartForumThreadParams struct {
	// AutoArchiveDuration nil leaves it to the channel default.
	AutoArchiveDuration *ThreadArchiveDuration
	RateLimitPerUser    *int
	AppliedTags         []string // tag IDs
	// Null / Extra: see SendMessageParams (applied to the thread-level body).
	Null  []string
	Extra map[string]interface{}
}

StartForumThreadParams are the thread-level options of StartThreadInForum.

type StartThreadParams

type StartThreadParams struct {
	RateLimitPerUser *int // slowmode in seconds
	// Location is the UI location reported to Discord. Empty picks "Message"
	// or "Reply Chain Nudge" at random, like discord.py-self.
	Location string
}

StartThreadParams are the optional parameters of StartThreadWithMessage.

type StartThreadWithoutMessageParams

type StartThreadWithoutMessageParams struct {
	Invitable        *bool // nil means true (as discord.py-self); only meaningful for private threads
	RateLimitPerUser *int
	// Location is the UI location reported to Discord. Empty picks "Plus Button"
	// or "Thread Browser Toolbar" at random, like discord.py-self.
	Location string
}

StartThreadWithoutMessageParams are the optional parameters of StartThreadWithoutMessage.

type StateUpdateEvent

type StateUpdateEvent struct {
	ApexExperiments *ApexExperimentResponse `json:"apex_experiments,omitempty"`
}

StateUpdateEvent is STATE_UPDATE (web).

type StatusDisplayType

type StatusDisplayType int

StatusDisplayType is the Discord status display type enumeration.

const (
	StatusDisplayTypeName    StatusDisplayType = 0
	StatusDisplayTypeState   StatusDisplayType = 1
	StatusDisplayTypeDetails StatusDisplayType = 2
)

StatusDisplayType values.

type StatusType

type StatusType string

StatusType is the Discord status type enumeration.

const (
	StatusTypeIdle    StatusType = "idle"
	StatusTypeDnd     StatusType = "dnd"
	StatusTypeOnline  StatusType = "online"
	StatusTypeOffline StatusType = "offline"
)

StatusType values.

type Sticker

type Sticker struct {
	ID          string            `json:"id"`
	Name        string            `json:"name"`
	Description string            `json:"description"`
	Tags        string            `json:"tags"`
	FormatType  StickerFormatType `json:"format_type"`
	Type        StickerType       `json:"type"`
	SortValue   int               `json:"sort_value,omitempty"`
	PackID      string            `json:"pack_id,omitempty"`
	Available   bool              `json:"available,omitempty"`
	GuildID     string            `json:"guild_id,omitempty"`
	User        *User             `json:"user,omitempty"`
}

Sticker is the flattened superset of StandardSticker, GuildSticker; fields absent from a variant are omitted.

type StickerFormatType

type StickerFormatType int

StickerFormatType is the Discord sticker format type enumeration.

const (
	StickerFormatTypePng    StickerFormatType = 1
	StickerFormatTypeApng   StickerFormatType = 2
	StickerFormatTypeLottie StickerFormatType = 3
	StickerFormatTypeGif    StickerFormatType = 4
)

StickerFormatType values.

type StickerItem

type StickerItem struct {
	ID         string `json:"id"`
	Name       string `json:"name"`
	FormatType int    `json:"format_type"` // 1=PNG, 2=APNG, 3=LOTTIE, 4=GIF
}

StickerItem represents a sticker in a message

type StickerPack

type StickerPack struct {
	ID             string            `json:"id"`
	Stickers       []StandardSticker `json:"stickers"`
	Name           string            `json:"name"`
	SKUID          string            `json:"sku_id"`
	CoverStickerID *string           `json:"cover_sticker_id"`
	Description    string            `json:"description"`
	BannerAssetID  *string           `json:"banner_asset_id"`
}

StickerPack mirrors the Discord sticker pack object.

type StickerType

type StickerType int

StickerType is the Discord sticker type enumeration.

const (
	StickerTypeStandard StickerType = 1
	StickerTypeGuild    StickerType = 2
)

StickerType values.

type StoreAsset

type StoreAsset struct {
	ID       string `json:"id"`
	Size     int    `json:"size"`
	Width    int    `json:"width"`
	Height   int    `json:"height"`
	MimeType string `json:"mime_type"`
}

StoreAsset mirrors the Discord store asset object.

type StoreListing

type StoreListing struct {
	ID                   string          `json:"id"`
	Summary              json.RawMessage `json:"summary,omitempty"`     // string or locale-keyed map of strings
	Description          json.RawMessage `json:"description,omitempty"` // string or locale-keyed map of strings
	Tagline              json.RawMessage `json:"tagline,omitempty"`     // string or locale-keyed map of strings
	FlavorText           string          `json:"flavor_text,omitempty"`
	EntitlementBranchID  string          `json:"entitlement_branch_id,omitempty"`
	StaffNotes           *StoreNote      `json:"staff_notes,omitempty"`
	Assets               []StoreAsset    `json:"assets,omitempty"`
	CarouselItems        []CarouselItem  `json:"carousel_items,omitempty"`
	PreviewVideo         *StoreAsset     `json:"preview_video,omitempty"`
	HeaderBackground     *StoreAsset     `json:"header_background,omitempty"`
	HeroBackground       *StoreAsset     `json:"hero_background,omitempty"`
	HeroVideo            *StoreAsset     `json:"hero_video,omitempty"`
	BoxArt               *StoreAsset     `json:"box_art,omitempty"`
	Thumbnail            *StoreAsset     `json:"thumbnail,omitempty"`
	HeaderLogoLightTheme *StoreAsset     `json:"header_logo_light_theme,omitempty"`
	HeaderLogoDarkTheme  *StoreAsset     `json:"header_logo_dark_theme,omitempty"`
	SKU                  PublicSKU       `json:"sku"`
	ChildSKUs            []PublicSKU     `json:"child_skus,omitempty"`
	AlternativeSKUs      []PublicSKU     `json:"alternative_skus,omitempty"`
	PublishedAt          *time.Time      `json:"published_at,omitempty"`
	UnpublishedAt        *time.Time      `json:"unpublished_at,omitempty"`
	Guild                *PartialGuild   `json:"guild,omitempty"`
	Published            bool            `json:"published,omitempty"`
}

StoreListing is the flattened superset of PublicStoreListing, PrivateStoreListing; fields absent from a variant are omitted.

type StoreLookupParams

type StoreLookupParams struct {
	CountryCode string
	Localize    *bool // nil or true: localised (default); false sends localize=false
}

StoreLookupParams are the options shared by the store read calls.

type StoreNote

type StoreNote struct {
	Content string `json:"content"`
	User    *User  `json:"user"`
}

StoreNote mirrors the Discord store note object.

type StreamCreateEvent

type StreamCreateEvent struct {
	StreamKey    string   `json:"stream_key"`
	Region       string   `json:"region,omitempty"`
	ViewerIDs    []string `json:"viewer_ids,omitempty"`
	Paused       bool     `json:"paused,omitempty"`
	RTCServerID  string   `json:"rtc_server_id"`
	RTCChannelID string   `json:"rtc_channel_id"`
}

StreamCreateEvent is STREAM_CREATE.

type StreamCreatePayload

type StreamCreatePayload struct {
	Type            string  `json:"type"` // "guild" or "call"
	GuildID         *string `json:"guild_id"`
	ChannelID       string  `json:"channel_id"`
	PreferredRegion *string `json:"preferred_region"`
}

StreamCreatePayload is the op 18 STREAM_CREATE payload.

type StreamDeleteEvent

type StreamDeleteEvent struct {
	StreamKey   string `json:"stream_key"`
	Reason      string `json:"reason"`
	Unavailable bool   `json:"unavailable,omitempty"`
}

StreamDeleteEvent is STREAM_DELETE.

type StreamEvent

type StreamEvent struct {
	StreamKey string   `json:"stream_key"`
	Region    string   `json:"region,omitempty"`
	ViewerIDs []string `json:"viewer_ids,omitempty"`
	Paused    bool     `json:"paused,omitempty"`
}

StreamEvent is STREAM_UPDATE.

type StreamIntegration

type StreamIntegration struct {
	ID                string                    `json:"id"`
	Type              IntegrationType           `json:"type"`
	Account           IntegrationAccount        `json:"account"`
	Guild             IntegrationGuild          `json:"guild"`
	Name              string                    `json:"name"`
	ApplicationID     string                    `json:"application_id,omitempty"`
	Enabled           bool                      `json:"enabled"`
	User              *User                     `json:"user,omitempty"`
	Scopes            []string                  `json:"scopes,omitempty"`
	RoleID            *string                   `json:"role_id"`
	EnableEmoticons   bool                      `json:"enable_emoticons"`
	SubscriberCount   int                       `json:"subscriber_count"`
	Revoked           bool                      `json:"revoked"`
	ExpireBehavior    IntegrationExpireBehavior `json:"expire_behavior"`
	ExpireGracePeriod int                       `json:"expire_grace_period"`
	Syncing           bool                      `json:"syncing"`
	SyncedAt          time.Time                 `json:"synced_at"`
}

StreamIntegration mirrors the Discord stream integration object.

type StreamPreview

type StreamPreview struct {
	URL string `json:"url"`
}

StreamPreview is the response of GetStreamPreview.

type StreamServerUpdateEvent

type StreamServerUpdateEvent struct {
	Token     string  `json:"token"`
	StreamKey string  `json:"stream_key"`
	Endpoint  *string `json:"endpoint"`
	GuildID   *string `json:"guild_id,omitempty"`
}

StreamServerUpdateEvent is STREAM_SERVER_UPDATE.

type StringSelectComponent

type StringSelectComponent struct {
	Type        ComponentType  `json:"type"`
	ID          int            `json:"id,omitempty"`
	CustomID    string         `json:"custom_id"`
	Placeholder string         `json:"placeholder,omitempty"`
	MinValues   int            `json:"min_values,omitempty"`
	MaxValues   int            `json:"max_values,omitempty"`
	Disabled    bool           `json:"disabled,omitempty"`
	Options     []SelectOption `json:"options,omitempty"`
}

StringSelectComponent mirrors the Discord string select component object.

type StripePaymentIntent

type StripePaymentIntent struct {
	ClientSecret      string `json:"stripe_payment_intent_client_secret"`
	PaymentMethodID   string `json:"stripe_payment_intent_payment_method_id,omitempty"`
	MerchantAccountID string `json:"payment_gateway_merchant_account_id,omitempty"`
}

StripePaymentIntent is the Stripe payment intent of a payment.

type SubscribedGuildScheduledEvent

type SubscribedGuildScheduledEvent struct {
	GuildScheduledEventID string `json:"guild_scheduled_event_id"`
	UserID                string `json:"user_id"`
}

SubscribedGuildScheduledEvent mirrors the Discord subscribed guild scheduled event object.

type Subscription

type Subscription struct {
	ID                           string                        `json:"id"`
	Type                         int                           `json:"type"` // one of 1, 2, 3
	PaymentGateway               *PaymentGateway               `json:"payment_gateway"`
	Currency                     string                        `json:"currency"`
	Items                        []SubscriptionItem            `json:"items"`
	PaymentGatewayPlanID         *string                       `json:"payment_gateway_plan_id"`
	PaymentGatewaySubscriptionID *string                       `json:"payment_gateway_subscription_id,omitempty"`
	CurrentPeriodStart           time.Time                     `json:"current_period_start"`
	CurrentPeriodEnd             time.Time                     `json:"current_period_end"`
	StreakStartedAt              *time.Time                    `json:"streak_started_at,omitempty"`
	Status                       int                           `json:"status"` // one of 0, 1, 2, 3, 4, 5, 6
	RenewalMutations             *SubscriptionRenewalMutations `json:"renewal_mutations,omitempty"`
	TrialID                      string                        `json:"trial_id,omitempty"`
	PaymentSourceID              *string                       `json:"payment_source_id"`
	CreatedAt                    time.Time                     `json:"created_at"`
	CanceledAt                   *time.Time                    `json:"canceled_at,omitempty"`
	CountryCode                  *string                       `json:"country_code"`
	TrialEndsAt                  *time.Time                    `json:"trial_ends_at,omitempty"`
	Metadata                     *SubscriptionMetadata         `json:"metadata,omitempty"`
	LatestInvoice                *SubscriptionInvoice          `json:"latest_invoice,omitempty"`
	UseStorekitResubscribe       bool                          `json:"use_storekit_resubscribe"`
	Price                        *int                          `json:"price"`
}

Subscription mirrors the Discord subscription object.

type SubscriptionCountryPrice

type SubscriptionCountryPrice struct {
	CountryCode string              `json:"country_code"`
	Prices      []SubscriptionPrice `json:"prices"`
}

SubscriptionCountryPrice mirrors the Discord subscription country price object.

type SubscriptionDiscount

type SubscriptionDiscount struct {
	Type   int `json:"type"` // one of 1, 2, 3, 4
	Amount int `json:"amount"`
}

SubscriptionDiscount mirrors the Discord subscription discount object.

type SubscriptionDiscountInfo

type SubscriptionDiscountInfo struct {
	ID                          string     `json:"id"`
	Amount                      int        `json:"amount"`
	StartsAt                    *time.Time `json:"starts_at"`
	EndsAt                      *time.Time `json:"ends_at"`
	Status                      int        `json:"status"`
	PlanIDs                     []string   `json:"plan_ids"`
	SKUGroupIDs                 []string   `json:"sku_group_ids"`
	SKUIDs                      []string   `json:"sku_ids"`
	UserUsageLimit              int        `json:"user_usage_limit"`
	UserUsageLimitInterval      int        `json:"user_usage_limit_interval"`
	UserUsageLimitIntervalCount int        `json:"user_usage_limit_interval_count"`
	CreatedAt                   time.Time  `json:"created_at"`
}

SubscriptionDiscountInfo mirrors the Discord subscription discount info object.

type SubscriptionInterval

type SubscriptionInterval int

SubscriptionInterval is the Discord subscription interval enumeration.

const (
	SubscriptionIntervalMonth SubscriptionInterval = 1
	SubscriptionIntervalYear  SubscriptionInterval = 2
	SubscriptionIntervalDay   SubscriptionInterval = 3
)

SubscriptionInterval values.

type SubscriptionInvoice

type SubscriptionInvoice struct {
	ID                      string                    `json:"id"`
	Status                  int                       `json:"status,omitempty"` // one of 1, 2, 3, 4
	Currency                string                    `json:"currency"`
	Subtotal                int                       `json:"subtotal"`
	Tax                     int                       `json:"tax"`
	Total                   int                       `json:"total"`
	TaxInclusive            bool                      `json:"tax_inclusive"`
	Items                   []SubscriptionInvoiceItem `json:"items"`
	SubscriptionPeriodStart *time.Time                `json:"subscription_period_start"`
	SubscriptionPeriodEnd   *time.Time                `json:"subscription_period_end"`
	AppliedDiscountIDs      []string                  `json:"applied_discount_ids,omitempty"`
	AppliedUserDiscounts    map[string]*string        `json:"applied_user_discounts,omitempty"`
}

SubscriptionInvoice mirrors the Discord subscription invoice object.

type SubscriptionInvoiceItem

type SubscriptionInvoiceItem struct {
	ID                    string                 `json:"id"`
	Quantity              int                    `json:"quantity"`
	Amount                int                    `json:"amount"`
	Proration             bool                   `json:"proration"`
	SubscriptionPlanID    *string                `json:"subscription_plan_id"`
	SubscriptionPlanPrice *int                   `json:"subscription_plan_price"`
	Discounts             []SubscriptionDiscount `json:"discounts"`
	SKUID                 *string                `json:"sku_id"`
	UnitPrice             *SubscriptionPrice     `json:"unit_price"`
	TenantMetadata        map[string]any         `json:"tenant_metadata,omitempty"`
}

SubscriptionInvoiceItem mirrors the Discord subscription invoice item object.

type SubscriptionItem

type SubscriptionItem struct {
	ID       string `json:"id"`
	Quantity int    `json:"quantity"`
	PlanID   string `json:"plan_id"`
}

SubscriptionItem mirrors the Discord subscription item object.

type SubscriptionItemParams

type SubscriptionItemParams struct {
	ID       string `json:"id,omitempty"` // existing item ID, when editing
	PlanID   string `json:"plan_id"`
	Quantity int    `json:"quantity,omitempty"`
}

SubscriptionItemParams is one item of a subscription request.

type SubscriptionLocationParams

type SubscriptionLocationParams struct {
	Location      []string
	LocationStack []string
}

SubscriptionLocationParams carry the "location" and "location_stack" query parameters Discord uses for analytics on subscription changes.

type SubscriptionMetadata

type SubscriptionMetadata struct {
	IsEgs                          bool       `json:"is_egs,omitempty"`
	IsHolidayPromotion2021         bool       `json:"is_holiday_promotion_2021,omitempty"`
	EndedAt                        *time.Time `json:"ended_at,omitempty"`
	GuildID                        string     `json:"guild_id,omitempty"`
	ApplicationSubscriptionGuildID string     `json:"application_subscription_guild_id,omitempty"`
	GracePeriodExpiresDate         string     `json:"grace_period_expires_date,omitempty"`
	AppleGracePeriodExpiresDate    string     `json:"apple_grace_period_expires_date,omitempty"`
	GoogleGracePeriodExpiresDate   string     `json:"google_grace_period_expires_date,omitempty"`
	GoogleOriginalExpiresDate      string     `json:"google_original_expires_date,omitempty"`
	UserTrialOfferID               string     `json:"user_trial_offer_id,omitempty"`
	UserDiscountOfferID            string     `json:"user_discount_offer_id,omitempty"` // guess
	ActiveDiscountID               string     `json:"active_discount_id,omitempty"`
	ActiveDiscountExpiresAt        *time.Time `json:"active_discount_expires_at,omitempty"`
}

SubscriptionMetadata mirrors the Discord subscription metadata object.

type SubscriptionPlan

type SubscriptionPlan struct {
	ID               string                     `json:"id"`
	Name             string                     `json:"name"`
	SKUID            string                     `json:"sku_id"`
	Interval         SubscriptionInterval       `json:"interval"`
	IntervalCount    int                        `json:"interval_count"`
	TaxInclusive     bool                       `json:"tax_inclusive"`
	Prices           map[int]SubscriptionPrices `json:"prices"`
	PriceTier        json.RawMessage            `json:"price_tier"`
	Currency         string                     `json:"currency"`
	Price            int                        `json:"price"`
	FallbackCurrency string                     `json:"fallback_currency,omitempty"`
	FallbackPrice    int                        `json:"fallback_price,omitempty"`
}

SubscriptionPlan mirrors the Discord subscription plan object.

type SubscriptionPlanLookupParams

type SubscriptionPlanLookupParams struct {
	CountryCode        string
	PaymentSourceID    string
	IncludeUnpublished bool
	RevenueSurface     int // sent when non-zero
}

SubscriptionPlanLookupParams are the options of the subscription plan lookups.

type SubscriptionPrice

type SubscriptionPrice struct {
	Currency string `json:"currency"`
	Amount   int    `json:"amount"`
	Exponent int    `json:"exponent"`
}

SubscriptionPrice mirrors the Discord subscription price object.

type SubscriptionPrices

type SubscriptionPrices struct {
	CountryPrices       SubscriptionCountryPrice       `json:"country_prices"`
	PaymentSourcePrices map[string][]SubscriptionPrice `json:"payment_source_prices"`
}

SubscriptionPrices mirrors the Discord subscription prices object.

type SubscriptionRenewalMutations

type SubscriptionRenewalMutations struct {
	PaymentGatewayPlanID *string            `json:"payment_gateway_plan_id,omitempty"`
	Items                []SubscriptionItem `json:"items,omitempty"`
}

SubscriptionRenewalMutations mirrors the Discord subscription renewal mutations object.

type SubscriptionTrial

type SubscriptionTrial struct {
	ID            string               `json:"id"`
	Interval      SubscriptionInterval `json:"interval"`
	IntervalCount int                  `json:"interval_count"`
	SKUID         string               `json:"sku_id"`
}

SubscriptionTrial mirrors the Discord subscription trial object.

type SuperProperties

type SuperProperties struct {
	OS                     string  `json:"os"`
	Browser                string  `json:"browser"`
	Device                 string  `json:"device"`
	SystemLocale           string  `json:"system_locale"`
	BrowserVersion         string  `json:"browser_version"`
	OSVersion              string  `json:"os_version"`
	Referrer               string  `json:"referrer"`
	ReferringDomain        string  `json:"referring_domain"`
	ReferrerCurrent        string  `json:"referrer_current"`
	ReferringDomainCurrent string  `json:"referring_domain_current"`
	ReleaseChannel         string  `json:"release_channel"`
	ClientBuildNumber      int     `json:"client_build_number"`
	ClientEventSource      *string `json:"client_event_source"`

	HasClientMods            bool   `json:"has_client_mods"`
	BrowserUserAgent         string `json:"browser_user_agent,omitempty"`
	ClientLaunchID           string `json:"client_launch_id,omitempty"`
	LaunchSignature          string `json:"launch_signature,omitempty"`
	ClientHeartbeatSessionID string `json:"client_heartbeat_session_id,omitempty"`
	ClientAppState           string `json:"client_app_state,omitempty"`

	// Desktop only.
	ClientVersion string `json:"client_version,omitempty"`
	OSSDKVersion  string `json:"os_sdk_version,omitempty"`
	OSArch        string `json:"os_arch,omitempty"`
	AppArch       string `json:"app_arch,omitempty"`

	// Linux desktop only.
	WindowManager      string `json:"window_manager,omitempty"`
	Distro             string `json:"distro,omitempty"`
	RuntimeEnvironment string `json:"runtime_environment,omitempty"`
	DisplayServer      string `json:"display_server,omitempty"`
	// contains filtered or unexported fields
}

SuperProperties contains Discord client fingerprint properties used for the X-Super-Properties header and the WebSocket IDENTIFY. The JSON field set and order follow the real client for the client type the value was built for (see ClientProperties.SuperProperties).

func BuildSuperProperties

func BuildSuperProperties(locale string) *SuperProperties

BuildSuperProperties creates a SuperProperties value for the given locale from the most recently resolved client properties (see ClientProperties), or from the built-in defaults when no client has been initialised yet.

func (SuperProperties) MarshalJSON

func (sp SuperProperties) MarshalJSON() ([]byte, error)

MarshalJSON emits the fields in the order the real client does.

func (*SuperProperties) ToBase64

func (sp *SuperProperties) ToBase64() string

ToBase64 encodes the SuperProperties as base64 JSON for X-Super-Properties header

func (*SuperProperties) ToMap

func (sp *SuperProperties) ToMap() map[string]interface{}

ToMap converts SuperProperties to map[string]interface{} for WebSocket IDENTIFY

type SupplementalGuild

type SupplementalGuild struct {
	ID                 string       `json:"id"`
	VoiceStates        []VoiceState `json:"voice_states"`
	EmbeddedActivities []Activity   `json:"embedded_activities"`
	ActivityInstances  []Activity   `json:"activity_instances"`
	Unavailable        bool         `json:"unavailable,omitempty"`
}

SupplementalGuild represents supplemental guild data

type SystemRequirement

type SystemRequirement struct {
	Ram                    int             `json:"ram,omitempty"`
	Disk                   int             `json:"disk,omitempty"`
	OperatingSystemVersion json.RawMessage `json:"operating_system_version,omitempty"` // string or locale-keyed map of strings
	CPU                    json.RawMessage `json:"cpu,omitempty"`                      // string or locale-keyed map of strings
	GPU                    json.RawMessage `json:"gpu,omitempty"`                      // string or locale-keyed map of strings
	SoundCard              json.RawMessage `json:"sound_card,omitempty"`               // string or locale-keyed map of strings
	DirectX                json.RawMessage `json:"directx,omitempty"`                  // string or locale-keyed map of strings
	Network                json.RawMessage `json:"network,omitempty"`                  // string or locale-keyed map of strings
	Notes                  json.RawMessage `json:"notes,omitempty"`                    // string or locale-keyed map of strings
}

SystemRequirement mirrors the Discord system requirement object.

type SystemRequirements

type SystemRequirements struct {
	Minimum     *SystemRequirement `json:"minimum,omitempty"`
	Recommended *SystemRequirement `json:"recommended,omitempty"`
}

SystemRequirements mirrors the Discord system requirements object.

type TLSClient

type TLSClient struct {
	// contains filtered or unexported fields
}

TLSClient implements DiscordClient using TLS client with enhanced WebSocket

func NewTLSClient

func NewTLSClient(config Config) *TLSClient

NewTLSClient creates a new TLS-based Discord client

func (*TLSClient) API

func (c *TLSClient) API() *API

API returns the shared REST surface. It can send requests once Initialize has returned.

func (*TLSClient) AddReaction

func (c *TLSClient) AddReaction(ctx context.Context, channelID, messageID string, emoji interface{}) error

AddReaction adds a reaction to a message. The emoji parameter can be:

  • A string: Unicode emoji (e.g., "👍") or custom emoji in "name:id" format (e.g., "smile:123456789")
  • An *Emoji object: Custom emoji from GetGuildEmojis()
  • An EmojiReaction object: Emoji from reaction events

Examples:

  • client.AddReaction(ctx, channelID, messageID, "👍")
  • client.AddReaction(ctx, channelID, messageID, "smile:123456789")
  • emojis, _ := client.GetGuildEmojis(ctx, guildID) client.AddReaction(ctx, channelID, messageID, emojis[0])

func (*TLSClient) BulkSubscribeToGuilds

func (c *TLSClient) BulkSubscribeToGuilds(subscriptions map[string]GuildSubscribeOptions) error

BulkSubscribeToGuilds subscribes to multiple guilds at once

func (*TLSClient) ClientProperties

func (c *TLSClient) ClientProperties() *ClientProperties

ClientProperties returns the client properties this client presents.

func (*TLSClient) Close

func (c *TLSClient) Close() error

Close closes the TLS client and WebSocket connection

func (*TLSClient) ConnectWebSocket

func (c *TLSClient) ConnectWebSocket(ctx context.Context) error

ConnectWebSocket connects the gateway session. The session then keeps itself connected: it RESUMEs after drops and keeps its handlers, so it is created only once (or again after it has ended, see DiscordWebSocket.Done).

func (*TLSClient) DownloadCDN

func (c *TLSClient) DownloadCDN(ctx context.Context, assetURL string) ([]byte, string, error)

DownloadCDN downloads a resource from a Discord CDN URL and returns bytes and content type

func (*TLSClient) Gateway

func (c *TLSClient) Gateway() *DiscordWebSocket

Gateway returns the gateway session, creating it (not yet connected) if needed, so handlers can be registered before ConnectWebSocket and see READY. Call it after Initialize: the session takes the resolved client properties when it is created.

func (*TLSClient) GetActiveThreads

func (c *TLSClient) GetActiveThreads(ctx context.Context, guildID string) (*ThreadListResponse, error)

GetActiveThreads returns all active threads in a guild

func (*TLSClient) GetAllMessages

func (c *TLSClient) GetAllMessages(ctx context.Context, channelID string, opts *GetAllMessagesOptions) ([]*Message, error)

GetAllMessages fetches all messages from a channel with pagination. It mirrors discord.py-self's history() behavior:

  • When After is set and OldestFirst is nil, messages are returned oldest->newest
  • When Before is set (or neither), messages are returned newest->oldest
  • OldestFirst can be explicitly set to override the default ordering

func (*TLSClient) GetChannel

func (c *TLSClient) GetChannel(ctx context.Context, channelID string) (*Channel, error)

GetChannel gets channel information

func (*TLSClient) GetChannelMessageCount

func (c *TLSClient) GetChannelMessageCount(ctx context.Context, guildID, channelID string, options *MessageSearchOptions) (int, error)

GetChannelMessageCount returns the total number of messages in a channel. If guildID is empty, it will be resolved from the channel. If options is nil, defaults are used (no query filter).

func (*TLSClient) GetCurrentUser

func (c *TLSClient) GetCurrentUser(ctx context.Context) (*User, error)

GetCurrentUser gets the current user info

func (*TLSClient) GetGuild

func (c *TLSClient) GetGuild(ctx context.Context, guildID string) (*Guild, error)

GetGuild gets guild information

func (*TLSClient) GetGuildChannels

func (c *TLSClient) GetGuildChannels(ctx context.Context, guildID string) ([]*Channel, error)

GetGuildChannels gets all channels in a guild

func (*TLSClient) GetGuildEmojis

func (c *TLSClient) GetGuildEmojis(ctx context.Context, guildID string) ([]*Emoji, error)

GetGuildEmojis gets all emojis in a guild

func (*TLSClient) GetGuildMemberCount

func (c *TLSClient) GetGuildMemberCount(ctx context.Context, guildID string) (int, error)

GetGuildMemberCount gets the number of members in a guild

func (*TLSClient) GetGuildMembers

func (c *TLSClient) GetGuildMembers(ctx context.Context, guildID string, limit int) ([]*GuildMember, error)

GetGuildMembers gets members in a guild

func (*TLSClient) GetGuilds

func (c *TLSClient) GetGuilds(ctx context.Context) ([]*Guild, error)

GetGuilds gets user's guilds with pagination support

func (*TLSClient) GetJoinedPrivateArchivedThreads

func (c *TLSClient) GetJoinedPrivateArchivedThreads(ctx context.Context, channelID string, opts *ArchivedThreadsOptions) (*ThreadListResponse, error)

GetJoinedPrivateArchivedThreads returns archived private threads the user has joined

func (*TLSClient) GetLatestAttachmentData

func (c *TLSClient) GetLatestAttachmentData(ctx context.Context, channelID string) ([]byte, string, string, error)

GetLatestAttachmentData downloads the latest attachment's raw data, returning bytes, filename, and content type

func (*TLSClient) GetLatestAttachmentURL

func (c *TLSClient) GetLatestAttachmentURL(ctx context.Context, channelID string) (string, error)

GetLatestAttachmentURL returns the CDN URL of the most recent attachment in a channel

func (*TLSClient) GetMessage

func (c *TLSClient) GetMessage(ctx context.Context, channelID, messageID string) (*Message, error)

GetMessage fetches a single message by ID from a channel

func (*TLSClient) GetMessageThread

func (c *TLSClient) GetMessageThread(ctx context.Context, channelID, messageID string) (*Thread, error)

GetMessageThread fetches the thread attached to a message (if any). Returns the thread if found, nil if no thread exists, or an error.

func (*TLSClient) GetMessages

func (c *TLSClient) GetMessages(ctx context.Context, channelID string, opts *GetMessagesOptions) ([]*Message, error)

GetMessages gets messages from a channel

func (*TLSClient) GetPrivateArchivedThreads

func (c *TLSClient) GetPrivateArchivedThreads(ctx context.Context, channelID string, opts *ArchivedThreadsOptions) (*ThreadListResponse, error)

GetPrivateArchivedThreads returns archived private threads in a channel

func (*TLSClient) GetPublicArchivedThreads

func (c *TLSClient) GetPublicArchivedThreads(ctx context.Context, channelID string, opts *ArchivedThreadsOptions) (*ThreadListResponse, error)

GetPublicArchivedThreads returns archived public threads in a channel

func (*TLSClient) GetWebSocket

func (c *TLSClient) GetWebSocket() *DiscordWebSocket

GetWebSocket returns the gateway session, for typed handlers (On, the AddXHandler methods) and the gateway send methods. It is nil until ConnectWebSocket or Gateway has created it.

func (*TLSClient) GuildName

func (c *TLSClient) GuildName(guildID string) string

GuildName returns the cached guild name for the given ID, or the ID itself if not found.

func (*TLSClient) Initialize

func (c *TLSClient) Initialize(ctx context.Context) error

Initialize initializes the TLS client

func (*TLSClient) IsConnected

func (c *TLSClient) IsConnected() bool

IsConnected checks if the WebSocket connection is active

func (*TLSClient) JoinGuild

func (c *TLSClient) JoinGuild(ctx context.Context, inviteCode string) error

JoinGuild joins a guild using an invite code

func (*TLSClient) ListenForEvents

func (c *TLSClient) ListenForEvents(ctx context.Context, eventHandler EventHandler) error

ListenForEvents delivers every dispatch to eventHandler until ctx is done or the gateway session ends for good (then it returns the session's error). Reconnecting and resuming are handled by the session itself.

func (*TLSClient) SearchMessages

func (c *TLSClient) SearchMessages(ctx context.Context, guildID, channelID string, options *MessageSearchOptions) (*MessageSearchResponse, error)

SearchMessages searches messages in a channel within a guild. If guildID is empty, it will be resolved from the channel.

func (*TLSClient) SendMessage

func (c *TLSClient) SendMessage(ctx context.Context, channelID string, content string) (*Message, error)

SendMessage sends a message to a channel

func (*TLSClient) SetGuildName

func (c *TLSClient) SetGuildName(guildID, name string)

SetGuildName stores a guild name in the WebSocket cache for debug log resolution.

func (*TLSClient) SubscribeToAllGuildFeatures

func (c *TLSClient) SubscribeToAllGuildFeatures(guildID string) error

SubscribeToAllGuildFeatures subscribes to all available features for a guild

func (*TLSClient) SubscribeToGuild

func (c *TLSClient) SubscribeToGuild(guildID string, options GuildSubscribeOptions) error

SubscribeToGuild subscribes to a single guild with specified features

func (*TLSClient) SubscribeToGuildChannels

func (c *TLSClient) SubscribeToGuildChannels(guildID string, channels map[string][][]int) error

SubscribeToGuildChannels subscribes to specific channels with message ranges

func (*TLSClient) SubscribeToGuildMembers

func (c *TLSClient) SubscribeToGuildMembers(guildID string, memberIDs []string) error

SubscribeToGuildMembers subscribes to specific members in a guild

func (*TLSClient) SubscribeToGuildThreads

func (c *TLSClient) SubscribeToGuildThreads(guildID string, threadIDs []string) error

SubscribeToGuildThreads subscribes to threads in a guild

func (*TLSClient) UnsubscribeFromGuild

func (c *TLSClient) UnsubscribeFromGuild(guildID string) error

UnsubscribeFromGuild unsubscribes from a guild by setting all features to false

func (*TLSClient) UpdateStatus

func (c *TLSClient) UpdateStatus(ctx context.Context, status string, game *Game, afk bool, since int64) error

UpdateStatus updates the user's status using the enhanced WebSocket

type Team

type Team struct {
	ID                     string       `json:"id"`
	Name                   string       `json:"name"`
	OwnerUserID            string       `json:"owner_user_id"`
	Icon                   *string      `json:"icon"`
	PayoutAccountStatus    *int         `json:"payout_account_status,omitempty"` // one of 1, 2, 3, 4, 5, 6
	StripeConnectAccountID *string      `json:"stripe_connect_account_id,omitempty"`
	Members                []TeamMember `json:"members,omitempty"`
}

Team mirrors the Discord team object.

type TeamMember

type TeamMember struct {
	User            *User    `json:"user"`
	MembershipState int      `json:"membership_state"`
	Permissions     []string `json:"permissions"`
	TeamID          string   `json:"team_id"`
}

TeamMember mirrors the Discord team member object.

type TeamPayout

type TeamPayout struct {
	ID                              string         `json:"id"`
	UserID                          string         `json:"user_id"`
	Amount                          int            `json:"amount"`
	Status                          int            `json:"status"` // one of 1, 2, 3, 4, 5
	PeriodStart                     time.Time      `json:"period_start"`
	PeriodEnd                       *time.Time     `json:"period_end"`
	PayoutDate                      *string        `json:"payout_date"`
	LatestTipaltiSubmissionResponse map[string]any `json:"latest_tipalti_submission_response,omitempty"`
}

TeamPayout mirrors the Discord team payout object.

type TestEvent

type TestEvent struct {
	Type      string                 `json:"type,omitempty"`
	Timestamp string                 `json:"timestamp,omitempty"`
	Data      map[string]interface{} `json:"data,omitempty"`
}

TestEvent represents a generic test event

type TextChannel

type TextChannel struct {
	ID                            string                 `json:"id"`
	GuildID                       string                 `json:"guild_id"`
	Position                      int                    `json:"position"`
	PermissionOverwrites          []*PermissionOverwrite `json:"permission_overwrites"`
	ParentID                      *string                `json:"parent_id"`
	Name                          string                 `json:"name"`
	Flags                         int                    `json:"flags"`
	Topic                         string                 `json:"topic,omitempty"`
	LastMessageID                 *string                `json:"last_message_id,omitempty"`
	LastPinTimestamp              *time.Time             `json:"last_pin_timestamp,omitempty"`
	RateLimitPerUser              int                    `json:"rate_limit_per_user,omitempty"`
	DefaultThreadRateLimitPerUser int                    `json:"default_thread_rate_limit_per_user,omitempty"`
	DefaultAutoArchiveDuration    ThreadArchiveDuration  `json:"default_auto_archive_duration,omitempty"`
	NSFW                          bool                   `json:"nsfw,omitempty"`
	Type                          ChannelType            `json:"type"` // always 0
}

TextChannel mirrors the Discord text channel object.

type TextComponent

type TextComponent struct {
	Type    ComponentType `json:"type"`
	ID      int           `json:"id,omitempty"`
	Content string        `json:"content"`
}

TextComponent mirrors the Discord text component object.

type TextInput

type TextInput struct {
	Type        ComponentType `json:"type"`
	ID          int           `json:"id,omitempty"`
	CustomID    string        `json:"custom_id"`
	Style       TextStyle     `json:"style"`
	Label       *string       `json:"label"`
	Placeholder string        `json:"placeholder,omitempty"`
	Value       string        `json:"value,omitempty"`
	Required    bool          `json:"required,omitempty"`
	MinLength   int           `json:"min_length,omitempty"`
	MaxLength   int           `json:"max_length,omitempty"`
}

TextInput mirrors the Discord text input object.

type TextInputInteractionData

type TextInputInteractionData struct {
	Type     ComponentType `json:"type"` // always 4
	ID       int           `json:"id,omitempty"`
	CustomID string        `json:"custom_id"`
	Value    string        `json:"value"`
}

TextInputInteractionData mirrors the Discord text input interaction data object.

type TextStyle

type TextStyle int

TextStyle is the Discord text style enumeration.

const (
	TextStyleShort     TextStyle = 1
	TextStyleParagraph TextStyle = 2
)

TextStyle values.

type ThirdPartySKU

type ThirdPartySKU struct {
	Distributor string  `json:"distributor"` // one of 'discord', 'steam', 'twitch', 'uplay', 'battlenet', 'origin', 'gog', 'epic', 'google_play'
	ID          *string `json:"id"`
	SKUID       *string `json:"sku_id"`
}

ThirdPartySKU mirrors the Discord third party sku object.

type Thread

type Thread struct {
	ID               string          `json:"id"`
	GuildID          string          `json:"guild_id"`
	ParentID         string          `json:"parent_id"`
	OwnerID          string          `json:"owner_id"`
	Name             string          `json:"name"`
	Type             int             `json:"type"`
	LastMessageID    *string         `json:"last_message_id"`
	MessageCount     int             `json:"message_count"`
	MemberCount      int             `json:"member_count"`
	RateLimitPerUser int             `json:"rate_limit_per_user"`
	Flags            int             `json:"flags"`
	TotalMessageSent int             `json:"total_message_sent"`
	AppliedTags      []string        `json:"applied_tags"`
	MemberIDsPreview []string        `json:"member_ids_preview"`
	ThreadMetadata   *ThreadMetadata `json:"thread_metadata"`
	Member           *ThreadMember   `json:"member,omitempty"`
	LastPinTimestamp *time.Time      `json:"last_pin_timestamp,omitempty"`
	NewlyCreated     bool            `json:"newly_created,omitempty"` // set on the CHANNEL_CREATE / thread-create response
}

Thread represents a Discord thread channel

type ThreadArchiveDuration

type ThreadArchiveDuration int

ThreadArchiveDuration is the Discord thread archive duration enumeration.

const (
	ThreadArchiveDurationOneHour   ThreadArchiveDuration = 60
	ThreadArchiveDurationOneDay    ThreadArchiveDuration = 1440
	ThreadArchiveDurationThreeDays ThreadArchiveDuration = 4320
	ThreadArchiveDurationOneWeek   ThreadArchiveDuration = 10080
)

ThreadArchiveDuration values.

type ThreadChannel

type ThreadChannel struct {
	ID               string          `json:"id"`
	Type             ChannelType     `json:"type"`
	GuildID          string          `json:"guild_id"`
	ParentID         string          `json:"parent_id"`
	OwnerID          string          `json:"owner_id,omitempty"`
	NSFW             bool            `json:"nsfw"`
	LastMessageID    *string         `json:"last_message_id,omitempty"`
	RateLimitPerUser int             `json:"rate_limit_per_user,omitempty"`
	MessageCount     int             `json:"message_count"`
	MemberCount      int             `json:"member_count"`
	TotalMessageSent int             `json:"total_message_sent"`
	ThreadMetadata   *ThreadMetadata `json:"thread_metadata"`
	Member           *ThreadMember   `json:"member,omitempty"`
	LastPinTimestamp *time.Time      `json:"last_pin_timestamp,omitempty"`
	AppliedTags      []string        `json:"applied_tags,omitempty"`
	Flags            int             `json:"flags"`
}

ThreadChannel mirrors the Discord thread channel object.

type ThreadDeleteEvent

type ThreadDeleteEvent struct {
	ID       string `json:"id"`
	GuildID  string `json:"guild_id"`
	ParentID string `json:"parent_id"`
	Type     int    `json:"type"`
}

ThreadDeleteEvent represents a thread deletion

type ThreadEvent

type ThreadEvent struct {
	ID               string         `json:"id"`
	Type             int            `json:"type"`
	GuildID          string         `json:"guild_id"`
	ParentID         string         `json:"parent_id"`
	OwnerID          string         `json:"owner_id"`
	Name             string         `json:"name"`
	LastMessageID    *string        `json:"last_message_id"`
	ThreadMetadata   ThreadMetadata `json:"thread_metadata"`
	MessageCount     int            `json:"message_count"`
	MemberCount      int            `json:"member_count"`
	RateLimitPerUser int            `json:"rate_limit_per_user"`
	Flags            int            `json:"flags"`
	TotalMessageSent int            `json:"total_message_sent,omitempty"`
	AppliedTags      []string       `json:"applied_tags,omitempty"`
	NewlyCreated     bool           `json:"newly_created,omitempty"`
	MemberIDsPreview []string       `json:"member_ids_preview,omitempty"`

	LastPinTimestamp *string        `json:"last_pin_timestamp,omitempty"`
	Member           *ThreadMember  `json:"member,omitempty"`
	Members          []ThreadMember `json:"members,omitempty"` // THREAD_CREATE
	Nsfw             bool           `json:"nsfw,omitempty"`
}

GuildMemberEvent represents guild member related events

type ThreadListResponse

type ThreadListResponse struct {
	Threads []Thread       `json:"threads"`
	Members []ThreadMember `json:"members"`
	HasMore bool           `json:"has_more"`
}

ThreadListResponse represents the response from thread list endpoints

type ThreadListSyncEvent

type ThreadListSyncEvent struct {
	GuildID            string         `json:"guild_id"`
	ChannelIDs         []string       `json:"channel_ids,omitempty"`
	Threads            []ThreadEvent  `json:"threads"`
	Members            []ThreadMember `json:"members,omitempty"`
	MostRecentMessages []Message      `json:"most_recent_messages"`
}

ThreadListSyncEvent represents thread list synchronization

type ThreadLocationParams

type ThreadLocationParams struct {
	// Location is sent as ?location=. Empty picks a random value like
	// discord.py-self ("Banner", "Toolbar Overflow", "Sidebar Overflow" or
	// "Context Menu" for joins; the last three for leaves).
	Location string
}

ThreadLocationParams carry the optional UI location of join/leave requests.

type ThreadMember

type ThreadMember struct {
	ID            string  `json:"id,omitempty"`
	UserID        string  `json:"user_id"`
	JoinTimestamp string  `json:"join_timestamp"`
	Flags         int     `json:"flags"`
	Member        *Member `json:"member,omitempty"`

	Presence   *BasePresenceUpdate `json:"presence,omitempty"`
	Muted      bool                `json:"muted,omitempty"`
	MuteConfig *MuteConfig         `json:"mute_config,omitempty"`
}

ThreadMember represents a thread member

type ThreadMemberListUpdateEvent

type ThreadMemberListUpdateEvent struct {
	ThreadID    string             `json:"thread_id"`
	GuildID     string             `json:"guild_id"`
	Members     []GuildMemberEvent `json:"members"`
	MemberCount int                `json:"member_count"`
	// Presences of the listed members, read by the web client.
	Presences []PresenceUpdateEvent `json:"presences,omitempty"`
}

ThreadMemberListUpdateEvent represents a THREAD_MEMBER_LIST_UPDATE event Sent after subscribing to a thread member list

type ThreadMemberUpdateEvent

type ThreadMemberUpdateEvent struct {
	ID            string `json:"id"`
	UserID        string `json:"user_id"`
	JoinTimestamp string `json:"join_timestamp"`
	Flags         int    `json:"flags"`
	GuildID       string `json:"guild_id"`

	Muted      bool                `json:"muted,omitempty"`
	MuteConfig *MuteConfig         `json:"mute_config,omitempty"`
	Member     *Member             `json:"member,omitempty"`
	Presence   *BasePresenceUpdate `json:"presence,omitempty"`
}

ThreadMemberUpdateEvent represents a THREAD_MEMBER_UPDATE event Sent when the current user's thread member object is updated

type ThreadMembersUpdateEvent

type ThreadMembersUpdateEvent struct {
	ID               string         `json:"id"`
	GuildID          string         `json:"guild_id"`
	MemberCount      int            `json:"member_count"`
	AddedMembers     []ThreadMember `json:"added_members,omitempty"`
	RemovedMemberIDs []string       `json:"removed_member_ids,omitempty"`
	MemberIDsPreview []string       `json:"member_ids_preview,omitempty"`
}

ThreadMembersUpdateEvent represents a THREAD_MEMBERS_UPDATE event Sent when members are added or removed from a thread

type ThreadMetadata

type ThreadMetadata struct {
	Archived            bool   `json:"archived"`
	AutoArchiveDuration int    `json:"auto_archive_duration"`
	ArchiveTimestamp    string `json:"archive_timestamp"`
	Locked              bool   `json:"locked"`
	Invitable           bool   `json:"invitable,omitempty"`
	CreateTimestamp     string `json:"create_timestamp,omitempty"`
	ArchiverID          string `json:"archiver_id,omitempty"`
}

ThreadMetadata represents thread metadata

type ThreadPaginationPayload

type ThreadPaginationPayload struct {
	Threads []*Thread       `json:"threads"`
	Members []*ThreadMember `json:"members"`
	HasMore bool            `json:"has_more"`
}

ThreadPaginationPayload mirrors the Discord thread pagination payload object.

type ThreadSearchParams

type ThreadSearchParams struct {
	Name       string
	Archived   *bool
	SortBy     string // e.g. "last_message_time", "creation_time"
	SortOrder  string // "asc" or "desc"
	Limit      int
	Offset     int
	Tags       []string // tag IDs, sent comma-joined as "tag"
	TagSetting string   // "match_some" or "match_all"
}

ThreadSearchParams are the filters of SearchThreads.

type ThreadSearchResult

type ThreadSearchResult struct {
	Threads            []*Thread       `json:"threads"`
	Members            []*ThreadMember `json:"members"`
	HasMore            bool            `json:"has_more"`
	FirstMessages      []*Message      `json:"first_messages,omitempty"`
	MostRecentMessages []*Message      `json:"most_recent_messages,omitempty"`
}

ThreadSearchResult is the response of SearchThreads.

type ThreadType

type ThreadType int

ThreadType is the Discord thread type enumeration.

const (
	ThreadTypeAnnouncementThread ThreadType = 10
	ThreadTypePublicThread       ThreadType = 11
	ThreadTypePrivateThread      ThreadType = 12
)

ThreadType values.

type ThumbnailComponent

type ThumbnailComponent struct {
	Type        ComponentType     `json:"type"`
	ID          int               `json:"id,omitempty"`
	Media       UnfurledMediaItem `json:"media"`
	Description *string           `json:"description,omitempty"`
	Spoiler     bool              `json:"spoiler,omitempty"`
}

ThumbnailComponent mirrors the Discord thumbnail component object.

type TopEmoji

type TopEmoji struct {
	EmojiID   string `json:"emoji_id"`
	EmojiRank int    `json:"emoji_rank"`
}

TopEmoji mirrors the Discord top emoji object.

type TopEmojis

type TopEmojis struct {
	Items []TopEmoji `json:"items"`
}

TopEmojis mirrors the Discord top emojis object.

type TopSoundboardSound

type TopSoundboardSound struct {
	SoundID   string `json:"sound_id"`
	SoundRank int    `json:"sound_rank"`
}

TopSoundboardSound is one entry of GetTopSoundboardSounds.

type TopSoundboardSounds

type TopSoundboardSounds struct {
	Items []TopSoundboardSound `json:"items"`
}

TopSoundboardSounds is the answer of GetTopSoundboardSounds.

type TransportEncryptionModes

type TransportEncryptionModes string

TransportEncryptionModes is the Discord transport encryption modes enumeration.

const (
	TransportEncryptionModesAeadAes256GcmRtpsize         TransportEncryptionModes = "aead_aes256_gcm_rtpsize"
	TransportEncryptionModesAeadXchacha20Poly1305Rtpsize TransportEncryptionModes = "aead_xchacha20_poly1305_rtpsize"
	TransportEncryptionModesXSalsa20Poly1305LiteRtpsize  TransportEncryptionModes = "xsalsa20_poly1305_lite_rtpsize"
	TransportEncryptionModesAeadAes256Gcm                TransportEncryptionModes = "aead_aes256_gcm"
	TransportEncryptionModesXSalsa20Poly1305             TransportEncryptionModes = "xsalsa20_poly1305"
	TransportEncryptionModesXSalsa20Poly1305Suffix       TransportEncryptionModes = "xsalsa20_poly1305_suffix"
	TransportEncryptionModesXSalsa20Poly1305Lite         TransportEncryptionModes = "xsalsa20_poly1305_lite"
)

TransportEncryptionModes values.

type TrialOffer

type TrialOffer struct {
	ID                string            `json:"id"`
	ExpiresAt         *time.Time        `json:"expires_at"`
	TrialID           string            `json:"trial_id"`
	SubscriptionTrial SubscriptionTrial `json:"subscription_trial"`
	UserID            string            `json:"user_id"`
}

TrialOffer mirrors the Discord trial offer object.

type TypingResponse

type TypingResponse struct {
	MessageSendCooldownMs  int `json:"message_send_cooldown_ms"`
	ThreadCreateCooldownMs int `json:"thread_create_cooldown_ms"`
}

TypingResponse mirrors the Discord typing response object.

type TypingStartEvent

type TypingStartEvent struct {
	ChannelID string  `json:"channel_id"`
	GuildID   string  `json:"guild_id,omitempty"`
	UserID    string  `json:"user_id"`
	Timestamp int64   `json:"timestamp"`
	Member    *Member `json:"member,omitempty"`
	// Custom typing indicator, read by the web client (shape not established).
	TypingIndicatorStyle json.RawMessage `json:"typing_indicator_style,omitempty"`
}

TypingStartEvent represents a typing start event

type UnavailableGuild

type UnavailableGuild struct {
	ID          string `json:"id"`
	Unavailable bool   `json:"unavailable,omitempty"`
}

UnavailableGuild mirrors the Discord unavailable guild object.

type UnfurledMediaItem

type UnfurledMediaItem struct {
	URL          string                `json:"url"`
	ProxyURL     string                `json:"proxy_url,omitempty"`
	Height       *int                  `json:"height,omitempty"`
	Width        *int                  `json:"width,omitempty"`
	ContentType  string                `json:"content_type,omitempty"`
	Placeholder  string                `json:"placeholder,omitempty"`
	LoadingState MediaItemLoadingState `json:"loading_state,omitempty"`
	AttachmentID int                   `json:"attachment_id,omitempty"`
	Flags        int                   `json:"flags,omitempty"`
}

UnfurledMediaItem mirrors the Discord unfurled media item object.

type UnverifiedApplication

type UnverifiedApplication struct {
	Name        string   `json:"name"`
	Hash        string   `json:"hash"`
	MissingData []string `json:"missing_data"`
}

UnverifiedApplication mirrors the Discord unverified application object.

type UpdateTimeSpentSessionIDPayload

type UpdateTimeSpentSessionIDPayload struct {
	InitializationTimestamp int64  `json:"initialization_timestamp"` // ms since epoch
	SessionID               string `json:"session_id"`               // client_heartbeat_session_id
	ClientLaunchID          string `json:"client_launch_id"`
}

UpdateTimeSpentSessionIDPayload is the payload of op 41 UPDATE_TIME_SPENT_SESSION_ID (web client handleUpdateTimeSpentSessionId and discord.py-self get_time_spent_payload agree on it).

type UploadedAttachment

type UploadedAttachment struct {
	ID       string `json:"id,omitempty"`
	Filename string `json:"filename"`
	FileSize int    `json:"file_size"`
	IsClip   *bool  `json:"is_clip,omitempty"`
}

UploadedAttachment is a request body sent to the API (uploaded attachment).

type User

type User struct {
	ID                   string                `json:"id"`
	Username             string                `json:"username"`
	GlobalName           string                `json:"global_name"`
	DisplayName          string                `json:"display_name,omitempty"`
	Discriminator        string                `json:"discriminator"`
	Avatar               string                `json:"avatar"`
	Bot                  bool                  `json:"bot"`
	System               bool                  `json:"system"`
	Email                string                `json:"email,omitempty"`
	Verified             bool                  `json:"verified,omitempty"`
	Phone                string                `json:"phone,omitempty"`
	PublicFlags          int                   `json:"public_flags,omitempty"`
	PrimaryGuild         *UserPrimaryGuild     `json:"primary_guild,omitempty"`
	Clan                 *UserPrimaryGuild     `json:"clan,omitempty"`
	DisplayNameStyles    *DisplayNameStyles    `json:"display_name_styles,omitempty"`
	Collectibles         interface{}           `json:"collectibles,omitempty"`
	AvatarDecorationData *AvatarDecorationData `json:"avatar_decoration_data,omitempty"`

	// Profile and account fields returned by /users/@me and /users/{id}
	// (the account token is deliberately not part of this struct; see UserWithToken).
	AccentColor        *int        `json:"accent_color,omitempty"`
	AnalyticsToken     string      `json:"analytics_token,omitempty"`
	Banner             *string     `json:"banner,omitempty"`
	BannerColor        *string     `json:"banner_color,omitempty"`
	Bio                string      `json:"bio,omitempty"`
	Desktop            bool        `json:"desktop,omitempty"`
	Flags              int         `json:"flags,omitempty"`
	Locale             string      `json:"locale,omitempty"`
	MFAEnabled         bool        `json:"mfa_enabled,omitempty"`
	Mobile             bool        `json:"mobile,omitempty"`
	NSFWAllowed        *bool       `json:"nsfw_allowed,omitempty"`
	PremiumType        PremiumType `json:"premium_type,omitempty"`
	PremiumUsageFlags  int         `json:"premium_usage_flags,omitempty"`
	PurchasedFlags     int         `json:"purchased_flags,omitempty"`
	Pronouns           string      `json:"pronouns,omitempty"`
	AuthenticatorTypes []int       `json:"authenticator_types,omitempty"`
	LegacyUsername     *string     `json:"legacy_username,omitempty"`
	HasBouncedEmail    bool        `json:"has_bounced_email,omitempty"`
}

User represents a Discord user

type UserActivityStatistics

type UserActivityStatistics struct {
	TotalDuration           int        `json:"total_duration"`
	LastPlayedAt            time.Time  `json:"last_played_at"`
	ApplicationID           string     `json:"application_id"`
	TotalDiscordSKUDuration int        `json:"total_discord_sku_duration,omitempty"`
	FirstPlayedAt           *time.Time `json:"first_played_at"`
}

UserActivityStatistics mirrors the Discord user activity statistics object.

type UserAffinities

type UserAffinities struct {
	UserAffinities        []UserAffinity `json:"user_affinities"`
	InverseUserAffinities []UserAffinity `json:"inverse_user_affinities"`
}

UserAffinities mirrors the Discord user affinities object.

type UserAffinity

type UserAffinity struct {
	UserID   string  `json:"user_id"`
	Affinity float64 `json:"affinity"`
}

UserAffinity mirrors the Discord user affinity object.

type UserApplicationEvent

type UserApplicationEvent struct {
	ApplicationID string `json:"application_id"`
}

UserApplicationEvent is USER_APPLICATION_UPDATE/REMOVE (web).

type UserApplicationIdentityEvent

type UserApplicationIdentityEvent struct {
	ApplicationID string          `json:"application_id"`
	UserID        string          `json:"user_id"`
	Username      string          `json:"username,omitempty"`
	AvatarHash    *string         `json:"avatar_hash,omitempty"`
	Metadata      json.RawMessage `json:"metadata,omitempty"`
}

UserApplicationIdentityEvent is USER_APPLICATION_IDENTITY_UPDATE/REMOVE (web).

type UserAvatar

type UserAvatar struct {
	ID          string  `json:"id"`
	StorageHash string  `json:"storage_hash"`
	Description *string `json:"description"`
}

UserAvatar mirrors the Discord user avatar object.

type UserAvatars

type UserAvatars struct {
	Avatars []UserAvatar `json:"avatars"`
}

UserAvatars mirrors the Discord user avatars object.

type UserBadgeStateUpdateEvent

type UserBadgeStateUpdateEvent struct {
	BadgeID json.RawMessage `json:"badge_id"`
}

UserBadgeStateUpdateEvent is USER_BADGE_STATE_UPDATE (web).

type UserCollectible

type UserCollectible struct {
	Asset     string     `json:"asset"`
	SKUID     string     `json:"sku_id"`
	Label     string     `json:"label"`
	ExpiresAt *time.Time `json:"expires_at"`
}

UserCollectible mirrors the Discord user collectible object.

type UserCollectibles

type UserCollectibles struct {
	Nameplate NameplateCollectible `json:"nameplate"`
}

UserCollectibles mirrors the Discord user collectibles object.

type UserCommandInteractionData

type UserCommandInteractionData struct {
	ID                 string                                    `json:"id"`
	Name               string                                    `json:"name"`
	Version            string                                    `json:"version"`
	GuildID            string                                    `json:"guild_id,omitempty"`
	ApplicationCommand ApplicationCommand                        `json:"application_command"`
	Attachments        []PartialAttachment                       `json:"attachments"`
	Options            []ApplicationCommandInteractionDataOption `json:"options"`
	TargetID           string                                    `json:"target_id"`
	Type               ApplicationCommandType                    `json:"type"` // always 2
}

UserCommandInteractionData mirrors the Discord user command interaction data object.

type UserConnectionsUpdateEvent

type UserConnectionsUpdateEvent struct {
	Connection
	UserID string `json:"user_id,omitempty"`
}

UserConnectionsUpdateEvent is USER_CONNECTIONS_UPDATE: either a connection, or only {user_id} when the connections must be refetched.

type UserGuild

type UserGuild struct {
	ID                       string   `json:"id"`
	Name                     string   `json:"name"`
	Icon                     *string  `json:"icon"`
	Features                 []string `json:"features"`
	Owner                    bool     `json:"owner"`
	Permissions              string   `json:"permissions"`
	ApproximateMemberCount   int      `json:"approximate_member_count,omitempty"`
	ApproximatePresenceCount int      `json:"approximate_presence_count,omitempty"`
}

UserGuild mirrors the Discord user guild object.

type UserGuildSettings

type UserGuildSettings struct {
	GuildID              *string                  `json:"guild_id"`
	ChannelOverrides     []ChannelOverride        `json:"channel_overrides"`
	Flags                int                      `json:"flags"`
	MessageNotifications MessageNotificationLevel `json:"message_notifications"`
	NotifyHighlights     HighlightLevel           `json:"notify_highlights"`
	HideMutedChannels    bool                     `json:"hide_muted_channels"`
	MobilePush           bool                     `json:"mobile_push"`
	Muted                bool                     `json:"muted"`
	MuteConfig           *MuteConfig              `json:"mute_config"`
	MuteScheduledEvents  bool                     `json:"mute_scheduled_events"`
	SuppressEveryone     bool                     `json:"suppress_everyone"`
	SuppressRoles        bool                     `json:"suppress_roles"`
	Version              int                      `json:"version"`
}

UserGuildSettings mirrors the Discord user guild settings object.

type UserNote

type UserNote struct {
	Note       string `json:"note"`
	UserID     string `json:"user_id"`
	NoteUserID string `json:"note_user_id"`
}

UserNote mirrors the Discord user note object.

type UserNoteUpdateEvent

type UserNoteUpdateEvent struct {
	ID   string `json:"id"`
	Note string `json:"note"`
}

UserNoteUpdateEvent represents user note updates

type UserOffer

type UserOffer struct {
	UserTrialOffer    *TrialOffer    `json:"user_trial_offer"`
	UserDiscountOffer *DiscountOffer `json:"user_discount_offer,omitempty"`
	UserDiscount      *DiscountOffer `json:"user_discount,omitempty"`
}

UserOffer mirrors the Discord user offer object.

type UserPresenceUpdate

type UserPresenceUpdate struct {
	Status               StatusType      `json:"status"`
	Activities           []*Activity     `json:"activities"`
	HiddenActivities     []*Activity     `json:"hidden_activities,omitempty"`
	ClientStatus         *ClientStatus   `json:"client_status"`
	ProcessedAtTimestamp json.RawMessage `json:"processed_at_timestamp"` // union of primitive types on the wire
	User                 *User           `json:"user"`
}

UserPresenceUpdate is the request body for updating a user presence.

type UserPrimaryGuild

type UserPrimaryGuild struct {
	Tag             *string `json:"tag"`
	IdentityGuildID *string `json:"identity_guild_id"`
	IdentityEnabled bool    `json:"identity_enabled"`
	Badge           *string `json:"badge"`
}

UserPrimaryGuild represents a user's primary/identity guild (clan)

type UserProfile

type UserProfile struct {
	User                       ProfileUser         `json:"user"`
	UserProfile                *ProfileMetadata    `json:"user_profile"`
	Badges                     []ProfileBadge      `json:"badges"`
	GuildMember                *PrivateMember      `json:"guild_member,omitempty"`
	GuildMemberProfile         *ProfileMetadata    `json:"guild_member_profile,omitempty"`
	GuildBadges                []ProfileBadge      `json:"guild_badges"`
	MutualGuilds               []MutualGuild       `json:"mutual_guilds,omitempty"`
	MutualFriends              []*User             `json:"mutual_friends,omitempty"`
	MutualFriendsCount         int                 `json:"mutual_friends_count,omitempty"`
	ConnectedAccounts          []PartialConnection `json:"connected_accounts"`
	ApplicationRoleConnections []RoleConnection    `json:"application_role_connections,omitempty"`
	PremiumType                *PremiumType        `json:"premium_type"`
	PremiumSince               *time.Time          `json:"premium_since"`
	PremiumGuildSince          *time.Time          `json:"premium_guild_since"`
	LegacyUsername             *string             `json:"legacy_username"`
	Application                *ProfileApplication `json:"application,omitempty"`
}

UserProfile mirrors the Discord user profile object.

type UserReport

type UserReport struct {
	ReportID string `json:"report_id"`
}

UserReport mirrors the Discord user report object.

type UserSelectComponent

type UserSelectComponent struct {
	Type          ComponentType         `json:"type"`
	ID            int                   `json:"id,omitempty"`
	CustomID      string                `json:"custom_id"`
	Placeholder   string                `json:"placeholder,omitempty"`
	MinValues     int                   `json:"min_values,omitempty"`
	MaxValues     int                   `json:"max_values,omitempty"`
	Disabled      bool                  `json:"disabled,omitempty"`
	DefaultValues []SelectDefaultValues `json:"default_values,omitempty"`
}

UserSelectComponent mirrors the Discord user select component object.

type UserSettingsProtoUpdateEvent

type UserSettingsProtoUpdateEvent struct {
	Settings GatewayProtoSettings `json:"settings"`
	Partial  bool                 `json:"partial"`
}

UserSettingsProtoUpdateEvent is USER_SETTINGS_PROTO_UPDATE.

type UserWithMember

type UserWithMember struct {
	ID                   string                  `json:"id"`
	Username             string                  `json:"username"`
	Discriminator        string                  `json:"discriminator"`
	Avatar               *string                 `json:"avatar"`
	AvatarDecorationData *AvatarDecorationData   `json:"avatar_decoration_data,omitempty"`
	PublicFlags          int                     `json:"public_flags,omitempty"`
	Bot                  bool                    `json:"bot,omitempty"`
	System               bool                    `json:"system,omitempty"`
	GlobalName           *string                 `json:"global_name"`
	PrimaryGuild         *UserPrimaryGuild       `json:"primary_guild,omitempty"`
	DisplayNameStyles    *DisplayNameStyles      `json:"display_name_styles,omitempty"`
	Collectibles         *UserCollectibles       `json:"collectibles,omitempty"`
	Member               *MemberWithOptionalUser `json:"member,omitempty"`
}

UserWithMember mirrors the Discord user with member object.

type UserWithToken

type UserWithToken struct {
	ID                   string                `json:"id"`
	Username             string                `json:"username"`
	Discriminator        string                `json:"discriminator"`
	Avatar               *string               `json:"avatar"`
	AvatarDecorationData *AvatarDecorationData `json:"avatar_decoration_data,omitempty"`
	PublicFlags          int                   `json:"public_flags,omitempty"`
	Bot                  bool                  `json:"bot,omitempty"`
	System               bool                  `json:"system,omitempty"`
	GlobalName           *string               `json:"global_name"`
	PrimaryGuild         *UserPrimaryGuild     `json:"primary_guild,omitempty"`
	DisplayNameStyles    *DisplayNameStyles    `json:"display_name_styles,omitempty"`
	Collectibles         *UserCollectibles     `json:"collectibles,omitempty"`
	Banner               *string               `json:"banner"`
	AccentColor          *int                  `json:"accent_color"`
	MFAEnabled           bool                  `json:"mfa_enabled,omitempty"`
	Locale               string                `json:"locale,omitempty"`
	Verified             bool                  `json:"verified,omitempty"`
	Email                *string               `json:"email,omitempty"`
	Flags                int                   `json:"flags,omitempty"`
	PurchasedFlags       int                   `json:"purchased_flags,omitempty"`
	PremiumUsageFlags    int                   `json:"premium_usage_flags,omitempty"`
	PremiumType          PremiumType           `json:"premium_type,omitempty"`
	Bio                  string                `json:"bio,omitempty"`
	AnalyticsToken       string                `json:"analytics_token,omitempty"`
	Phone                *string               `json:"phone,omitempty"`
	Token                string                `json:"token"`
	NSFWAllowed          *bool                 `json:"nsfw_allowed,omitempty"`
	Desktop              bool                  `json:"desktop,omitempty"`
	Mobile               bool                  `json:"mobile,omitempty"`
}

UserWithToken mirrors the Discord user with token object.

type VanityInvite

type VanityInvite struct {
	Code *string `json:"code"`
	Uses int     `json:"uses"`
}

VanityInvite mirrors the Discord vanity invite object.

type VerificationLevel

type VerificationLevel int

VerificationLevel is the Discord verification level enumeration.

const (
	VerificationLevelNone    VerificationLevel = 0
	VerificationLevelLow     VerificationLevel = 1
	VerificationLevelMedium  VerificationLevel = 2
	VerificationLevelHigh    VerificationLevel = 3
	VerificationLevelHighest VerificationLevel = 4
)

VerificationLevel values.

type VersionedReadStates

type VersionedReadStates struct {
	Entries []ReadState `json:"entries"`
	Version int         `json:"version"`
	Partial bool        `json:"partial"`
}

VersionedReadStates is READY read_state with CapabilityVersionedReadStates. Snowflake fields sent as JSON numbers (the gateway does this for some non-channel read states) are accepted.

func (*VersionedReadStates) UnmarshalJSON

func (v *VersionedReadStates) UnmarshalJSON(b []byte) error

UnmarshalJSON accepts numeric snowflakes in the entries.

type VersionedUserGuildSettings

type VersionedUserGuildSettings struct {
	Entries []UserGuildSettings `json:"entries"`
	Version int                 `json:"version"`
	Partial bool                `json:"partial"`
}

VersionedUserGuildSettings is READY user_guild_settings with CapabilityVersionedUserGuildSettings.

func (*VersionedUserGuildSettings) UnmarshalJSON

func (v *VersionedUserGuildSettings) UnmarshalJSON(b []byte) error

UnmarshalJSON also accepts the bare array sent without the capability.

type VideoQualityMode

type VideoQualityMode int

VideoQualityMode is the Discord video quality mode enumeration.

const (
	VideoQualityModeAuto VideoQualityMode = 1
	VideoQualityModeFull VideoQualityMode = 2
)

VideoQualityMode values.

type VirtualCurrencyBalanceUpdateEvent

type VirtualCurrencyBalanceUpdateEvent struct {
	Balance       json.RawMessage `json:"balance,omitempty"`
	TotalRedeemed json.RawMessage `json:"total_redeemed,omitempty"`
}

VirtualCurrencyBalanceUpdateEvent is VIRTUAL_CURRENCY_BALANCE_UPDATE (web).

type VoiceChannel

type VoiceChannel struct {
	ID                            string                 `json:"id"`
	GuildID                       string                 `json:"guild_id"`
	Position                      int                    `json:"position"`
	PermissionOverwrites          []*PermissionOverwrite `json:"permission_overwrites"`
	ParentID                      *string                `json:"parent_id"`
	Name                          string                 `json:"name"`
	Flags                         int                    `json:"flags"`
	Topic                         string                 `json:"topic,omitempty"`
	LastMessageID                 *string                `json:"last_message_id,omitempty"`
	LastPinTimestamp              *time.Time             `json:"last_pin_timestamp,omitempty"`
	RateLimitPerUser              int                    `json:"rate_limit_per_user,omitempty"`
	DefaultThreadRateLimitPerUser int                    `json:"default_thread_rate_limit_per_user,omitempty"`
	DefaultAutoArchiveDuration    ThreadArchiveDuration  `json:"default_auto_archive_duration,omitempty"`
	NSFW                          bool                   `json:"nsfw,omitempty"`
	Type                          ChannelType            `json:"type"` // always 2
	Bitrate                       int                    `json:"bitrate"`
	UserLimit                     int                    `json:"user_limit"`
	RTCRegion                     *string                `json:"rtc_region,omitempty"`
	VideoQualityMode              VideoQualityMode       `json:"video_quality_mode,omitempty"`
}

VoiceChannel mirrors the Discord voice channel object.

type VoiceChannelEffectSendEvent

type VoiceChannelEffectSendEvent struct {
	ChannelID     string          `json:"channel_id"`
	GuildID       string          `json:"guild_id,omitempty"`
	UserID        string          `json:"user_id"`
	Emoji         *EmojiReaction  `json:"emoji,omitempty"`
	AnimationType *int            `json:"animation_type,omitempty"`
	AnimationID   *int            `json:"animation_id,omitempty"`
	SoundID       json.RawMessage `json:"sound_id,omitempty"` // snowflake or integer
	SoundVolume   *float64        `json:"sound_volume,omitempty"`
	Name          string          `json:"name,omitempty"` // sound name
	SourceGuildID string          `json:"source_guild_id,omitempty"`
	IsEcho        bool            `json:"is_echo,omitempty"`
	AuthorID      string          `json:"author_id,omitempty"`
}

VoiceChannelEffectSendEvent is VOICE_CHANNEL_EFFECT_SEND (web).

type VoiceChannelStartTimeUpdateEvent

type VoiceChannelStartTimeUpdateEvent struct {
	ID             string          `json:"id"`
	GuildID        string          `json:"guild_id"`
	VoiceStartTime json.RawMessage `json:"voice_start_time,omitempty"`
}

VoiceChannelStartTimeUpdateEvent is VOICE_CHANNEL_START_TIME_UPDATE (web).

type VoiceChannelStatusUpdateEvent

type VoiceChannelStatusUpdateEvent struct {
	ID      string  `json:"id"`
	GuildID string  `json:"guild_id"`
	Status  *string `json:"status"`
}

VoiceChannelStatusUpdateEvent is VOICE_CHANNEL_STATUS_UPDATE (web).

type VoiceCodec

type VoiceCodec struct {
	Name           string `json:"name"`
	Type           string `json:"type"` // one of 'audio', 'video'
	Priority       int    `json:"priority"`
	PayloadType    int    `json:"payload_type"`
	RtxPayloadType int    `json:"rtx_payload_type,omitempty"`
	Encode         bool   `json:"encode,omitempty"`
	Decode         bool   `json:"decode,omitempty"`
}

VoiceCodec mirrors the Discord voice codec object.

type VoiceIdentify

type VoiceIdentify struct {
	ServerID  string `json:"server_id"`
	UserID    string `json:"user_id"`
	SessionID string `json:"session_id"`
	Token     string `json:"token"`
}

VoiceIdentify mirrors the Discord voice identify object.

type VoiceReady

type VoiceReady struct {
	SSRC              int                        `json:"ssrc"`
	IP                string                     `json:"ip"`
	Port              int                        `json:"port"`
	Modes             []TransportEncryptionModes `json:"modes"`
	HeartbeatInterval int                        `json:"heartbeat_interval"`
}

VoiceReady mirrors the Discord voice ready object.

type VoiceRegion

type VoiceRegion struct {
	ID         string `json:"id"`
	Name       string `json:"name"`
	Vip        bool   `json:"vip"`
	Optimal    bool   `json:"optimal"`
	Deprecated bool   `json:"deprecated"`
	Custom     bool   `json:"custom"`
}

VoiceRegion mirrors the Discord voice region object.

type VoiceScheduledEvent

type VoiceScheduledEvent struct {
	ID                 string                   `json:"id"`
	GuildID            string                   `json:"guild_id"`
	EntityID           *string                  `json:"entity_id"`
	Name               string                   `json:"name"`
	ScheduledStartTime time.Time                `json:"scheduled_start_time"`
	PrivacyLevel       PrivacyLevel             `json:"privacy_level"`
	Status             ScheduledEventStatus     `json:"status"`
	CreatorID          *string                  `json:"creator_id,omitempty"`
	Description        *string                  `json:"description,omitempty"`
	Creator            *User                    `json:"creator,omitempty"`
	UserCount          int                      `json:"user_count,omitempty"`
	Image              *string                  `json:"image,omitempty"`
	SKUIDs             []string                 `json:"sku_ids"`
	ChannelID          string                   `json:"channel_id"`
	EntityMetadata     json.RawMessage          `json:"entity_metadata"`
	ScheduledEndTime   *time.Time               `json:"scheduled_end_time,omitempty"`
	EntityType         ScheduledEventEntityType `json:"entity_type"` // always 2
}

VoiceScheduledEvent mirrors the Discord voice scheduled event object.

type VoiceServerUpdate

type VoiceServerUpdate struct {
	Token     string  `json:"token"`
	GuildID   *string `json:"guild_id"`
	ChannelID string  `json:"channel_id,omitempty"`
	Endpoint  *string `json:"endpoint"`
}

VoiceServerUpdate is the request body for updating a voice server.

type VoiceState

type VoiceState struct {
	GuildID                 *string `json:"guild_id,omitempty"`
	ChannelID               *string `json:"channel_id"`
	UserID                  string  `json:"user_id"`
	Member                  *Member `json:"member,omitempty"`
	SessionID               string  `json:"session_id"`
	Deaf                    bool    `json:"deaf"`
	Mute                    bool    `json:"mute"`
	SelfDeaf                bool    `json:"self_deaf"`
	SelfMute                bool    `json:"self_mute"`
	SelfStream              bool    `json:"self_stream"`
	SelfVideo               bool    `json:"self_video"`
	Suppress                bool    `json:"suppress"`
	RequestToSpeakTimestamp *string `json:"request_to_speak_timestamp"`
	Discoverable            bool    `json:"discoverable,omitempty"`
}

VoiceState represents voice state information

type VoiceStateEvent

type VoiceStateEvent struct {
	GuildID                 string  `json:"guild_id,omitempty"`
	ChannelID               string  `json:"channel_id"`
	UserID                  string  `json:"user_id"`
	Member                  *Member `json:"member,omitempty"`
	SessionID               string  `json:"session_id"`
	Deaf                    bool    `json:"deaf"`
	Mute                    bool    `json:"mute"`
	SelfDeaf                bool    `json:"self_deaf"`
	SelfMute                bool    `json:"self_mute"`
	SelfStream              bool    `json:"self_stream"`
	SelfVideo               bool    `json:"self_video"`
	Suppress                bool    `json:"suppress"`
	RequestToSpeakTimestamp *string `json:"request_to_speak_timestamp"`
	Discoverable            bool    `json:"discoverable,omitempty"`
}

VoiceStateEvent represents voice state updates from the gateway

type VoiceStateUpdateBatchEvent

type VoiceStateUpdateBatchEvent struct {
	VoiceStates []VoiceState `json:"voice_states"`
}

VoiceStateUpdateBatchEvent is VOICE_STATE_UPDATE_BATCH (web).

type VoiceStateUpdatePayload

type VoiceStateUpdatePayload struct {
	GuildID          *string            `json:"guild_id"`
	ChannelID        *string            `json:"channel_id"`
	SelfMute         bool               `json:"self_mute"`
	SelfDeaf         bool               `json:"self_deaf"`
	SelfVideo        bool               `json:"self_video"`
	Flags            int                `json:"flags"`
	PreferredRegion  *string            `json:"preferred_region,omitempty"`  // only with a channel
	PreferredRegions []string           `json:"preferred_regions,omitempty"` // only with a channel
	Tracks           []VoiceStreamTrack `json:"tracks,omitempty"`
}

VoiceStateUpdatePayload is the op 4 VOICE_STATE_UPDATE payload. A nil GuildID is a DM call; a nil ChannelID leaves voice.

type VoiceStream

type VoiceStream struct {
	Type          string                 `json:"type"` // one of 'video', 'screen'
	Rid           string                 `json:"rid"`
	Quality       int                    `json:"quality,omitempty"`
	Active        bool                   `json:"active,omitempty"`
	MaxBitrate    int                    `json:"max_bitrate,omitempty"`
	MaxFramerate  int                    `json:"max_framerate,omitempty"`
	MaxResolution *VoiceStreamResolution `json:"max_resolution,omitempty"`
	SSRC          int                    `json:"ssrc,omitempty"`
	RtxSSRC       int                    `json:"rtx_ssrc,omitempty"`
}

VoiceStream mirrors the Discord voice stream object.

type VoiceStreamResolution

type VoiceStreamResolution struct {
	Type   string `json:"type"` // one of 'source', 'fixed'
	Width  int    `json:"width"`
	Height int    `json:"height"`
}

VoiceStreamResolution mirrors the Discord voice stream resolution object.

type VoiceStreamTrack

type VoiceStreamTrack struct {
	Type    string `json:"type"`
	RID     string `json:"rid"`
	Quality int    `json:"quality"`
}

VoiceStreamTrack is one video stream parameter of op 4 (web).

type WalletBalanceUpdateEvent

type WalletBalanceUpdateEvent struct {
	PaymentSourceID string          `json:"payment_source_id"`
	Currency        string          `json:"currency"`
	Balance         json.RawMessage `json:"balance,omitempty"`
}

WalletBalanceUpdateEvent is WALLET_BALANCE_UPDATE (web).

type WebAuthnChallenge

type WebAuthnChallenge struct {
	Challenge string `json:"challenge"`
	Ticket    string `json:"ticket"`
}

WebAuthnChallenge is the response of the WebAuthn start calls.

type WebAuthnCredential

type WebAuthnCredential struct {
	ID       string     `json:"id"`
	Name     string     `json:"name"`
	LastUsed *time.Time `json:"last_used,omitempty"`
}

WebAuthnCredential is a registered security key or passkey.

type WebAuthnRegistration

type WebAuthnRegistration struct {
	WebAuthnCredential
	BackupCodes []json.RawMessage `json:"backup_codes,omitempty"`
}

WebAuthnRegistration is the result of FinishWebAuthnRegistration.

type WebAuthnRegistrationChallenge

type WebAuthnRegistrationChallenge struct {
	Ticket    string `json:"ticket"`
	Challenge string `json:"challenge"`
}

WebAuthnRegistrationChallenge is returned by StartWebAuthnRegistration.

type WebSocketEvent

type WebSocketEvent struct {
	Op   int             `json:"op"`
	Data json.RawMessage `json:"d"`
	Type string          `json:"t"`
}

WebSocketEvent represents a Discord WebSocket event

type WebSocketMessageEvent

type WebSocketMessageEvent struct {
	Message Message `json:"message"`
}

WebSocketMessageEvent is kept for backward compatibility. For new code, unmarshal directly into Message.

type WebSocketRateLimiter

type WebSocketRateLimiter struct {
	// contains filtered or unexported fields
}

WebSocketRateLimiter limits outgoing gateway messages (110 per 60 seconds, as discord.py-self does). Heartbeats are not counted.

func NewWebSocketRateLimiter

func NewWebSocketRateLimiter() *WebSocketRateLimiter

NewWebSocketRateLimiter creates a rate limiter for WebSocket messages (110/60s as per discord.py-self)

func (*WebSocketRateLimiter) TakeToken

func (rl *WebSocketRateLimiter) TakeToken() bool

TakeToken attempts to take a token for rate limiting

type WebSocketReactionEvent

type WebSocketReactionEvent = MessageReactionEvent

WebSocketReactionEvent is an alias for MessageReactionEvent (the canonical type). Deprecated: Use MessageReactionEvent directly for new code.

type WebSocketReadyEvent

type WebSocketReadyEvent = ReadyPayload

WebSocketReadyEvent is an alias for ReadyPayload (the canonical type). Deprecated: Use ReadyPayload directly for new code.

type WebSocketRelationshipEvent

type WebSocketRelationshipEvent struct {
	ID   string `json:"id"`
	Type int    `json:"type"`
}

WebSocketRelationshipEvent represents a relationship event. This is kept as-is since there is no canonical RelationshipEvent type yet.

type WebSocketTypingEvent

type WebSocketTypingEvent = TypingStartEvent

WebSocketTypingEvent is an alias for TypingStartEvent (the canonical type). Deprecated: Use TypingStartEvent directly for new code.

type WebSocketVoiceStateEvent

type WebSocketVoiceStateEvent = VoiceStateEvent

WebSocketVoiceStateEvent is an alias for VoiceStateEvent (the canonical type). Deprecated: Use VoiceStateEvent directly for new code.

type Webhook

type Webhook struct {
	ID            string      `json:"id"`
	Type          WebhookType `json:"type"`
	GuildID       string      `json:"guild_id,omitempty"`
	User          *User       `json:"user,omitempty"`
	Token         string      `json:"token,omitempty"`
	Name          *string     `json:"name,omitempty"`
	Avatar        *string     `json:"avatar,omitempty"`
	ChannelID     string      `json:"channel_id,omitempty"`
	ApplicationID *string     `json:"application_id,omitempty"`
}

Webhook mirrors the Discord webhook object.

type WebhookChannel

type WebhookChannel struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

WebhookChannel mirrors the Discord webhook channel object.

type WebhookSourceChannel

type WebhookSourceChannel struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

WebhookSourceChannel mirrors the Discord webhook source channel object.

type WebhookSourceGuild

type WebhookSourceGuild struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
	Icon string `json:"icon"`
}

WebhookSourceGuild mirrors the Discord webhook source guild object.

type WebhookType

type WebhookType int

WebhookType is the Discord webhook type enumeration.

const (
	WebhookTypeIncoming        WebhookType = 1
	WebhookTypeChannelFollower WebhookType = 2
	WebhookTypeApplication     WebhookType = 3
)

WebhookType values.

type WebhooksUpdateEvent

type WebhooksUpdateEvent struct {
	GuildID   string `json:"guild_id"`
	ChannelID string `json:"channel_id"`
}

WebhooksUpdateEvent is WEBHOOKS_UPDATE.

type WelcomeScreen

type WelcomeScreen struct {
	Description     string                 `json:"description"`
	WelcomeChannels []WelcomeScreenChannel `json:"welcome_channels"`
}

WelcomeScreen mirrors the Discord welcome screen object.

type WelcomeScreenChannel

type WelcomeScreenChannel struct {
	ChannelID   string  `json:"channel_id"`
	Description string  `json:"description"`
	EmojiID     *string `json:"emoji_id"`
	EmojiName   *string `json:"emoji_name"`
}

WelcomeScreenChannel mirrors the Discord welcome screen channel object.

type WhitelistedUser

type WhitelistedUser struct {
	User  *User `json:"user"`
	State int   `json:"state"` // one of 1, 2
}

WhitelistedUser mirrors the Discord whitelisted user object.

type WidgetConfigs

type WidgetConfigs struct {
	Applications json.RawMessage `json:"applications"`
	Configs      json.RawMessage `json:"configs"`
}

WidgetConfigs is the answer of the widget config routes.

type WidgetUploadURL

type WidgetUploadURL struct {
	UploadURL      string `json:"upload_url"`
	UploadFilename string `json:"upload_filename"`
}

WidgetUploadURL is a pre-signed upload slot for a profile widget asset or clip.

type WishlistItemPurchasedEvent

type WishlistItemPurchasedEvent struct {
	RecipientID string `json:"recipient_id"`
	SKUID       string `json:"sku_id"`
}

WishlistItemPurchasedEvent is WISHLIST_ITEM_PURCHASED (web).

type WishlistParams

type WishlistParams struct {
	Extra map[string]interface{}
}

WishlistParams carry the extra context keys the web client adds to wishlist requests.

type WrappedPricingPromotion

type WrappedPricingPromotion struct {
	CountryCode           string            `json:"country_code"`
	LocalizedPricingPromo *PricingPromotion `json:"localized_pricing_promo"`
}

WrappedPricingPromotion mirrors the Discord wrapped pricing promotion object.

Source Files

Directories

Path Synopsis
_examples
enhanced command
websocket command
internal
endpointgen command
Command endpointgen generates endpoints_gen.go, the typed catalog of Discord client REST and CDN routes, from the JSON inventories extracted from the web client, the Android client and discord.py-self.
Command endpointgen generates endpoints_gen.go, the typed catalog of Discord client REST and CDN routes, from the JSON inventories extracted from the web client, the Android client and discord.py-self.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL