1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039 |
- package discordgo
- import (
- "encoding/json"
- "fmt"
- "net/http"
- "strings"
- "sync"
- "time"
- "github.com/gorilla/websocket"
- )
- type Session struct {
- sync.RWMutex
-
-
- Token string
- MFA bool
-
- Debug bool
- LogLevel int
-
- ShouldReconnectOnError bool
-
- Compress bool
-
- ShardID int
- ShardCount int
-
-
-
- StateEnabled bool
-
-
- SyncEvents bool
-
-
- DataReady bool
-
- MaxRestRetries int
-
-
- status int32
-
- VoiceReady bool
-
- UDPReady bool
-
- VoiceConnections map[string]*VoiceConnection
-
-
- State *State
-
- Client *http.Client
-
- UserAgent string
-
- LastHeartbeatAck time.Time
-
- LastHeartbeatSent time.Time
-
- Ratelimiter *RateLimiter
-
- handlersMu sync.RWMutex
- handlers map[string][]*eventHandlerInstance
- onceHandlers map[string][]*eventHandlerInstance
-
- wsConn *websocket.Conn
-
- listening chan interface{}
-
- sequence *int64
-
- gateway string
-
- sessionID string
-
- wsMutex sync.Mutex
- }
- type UserConnection struct {
- ID string `json:"id"`
- Name string `json:"name"`
- Type string `json:"type"`
- Revoked bool `json:"revoked"`
- Integrations []*Integration `json:"integrations"`
- }
- type Integration struct {
- ID string `json:"id"`
- Name string `json:"name"`
- Type string `json:"type"`
- Enabled bool `json:"enabled"`
- Syncing bool `json:"syncing"`
- RoleID string `json:"role_id"`
- ExpireBehavior int `json:"expire_behavior"`
- ExpireGracePeriod int `json:"expire_grace_period"`
- User *User `json:"user"`
- Account IntegrationAccount `json:"account"`
- SyncedAt Timestamp `json:"synced_at"`
- }
- type IntegrationAccount struct {
- ID string `json:"id"`
- Name string `json:"name"`
- }
- type VoiceRegion struct {
- ID string `json:"id"`
- Name string `json:"name"`
- Hostname string `json:"sample_hostname"`
- Port int `json:"sample_port"`
- }
- type VoiceICE struct {
- TTL string `json:"ttl"`
- Servers []*ICEServer `json:"servers"`
- }
- type ICEServer struct {
- URL string `json:"url"`
- Username string `json:"username"`
- Credential string `json:"credential"`
- }
- type Invite struct {
- Guild *Guild `json:"guild"`
- Channel *Channel `json:"channel"`
- Inviter *User `json:"inviter"`
- Code string `json:"code"`
- CreatedAt Timestamp `json:"created_at"`
- MaxAge int `json:"max_age"`
- Uses int `json:"uses"`
- MaxUses int `json:"max_uses"`
- Revoked bool `json:"revoked"`
- Temporary bool `json:"temporary"`
- Unique bool `json:"unique"`
-
- ApproximatePresenceCount int `json:"approximate_presence_count"`
- ApproximateMemberCount int `json:"approximate_member_count"`
- }
- type ChannelType int
- const (
- ChannelTypeGuildText ChannelType = iota
- ChannelTypeDM
- ChannelTypeGuildVoice
- ChannelTypeGroupDM
- ChannelTypeGuildCategory
- ChannelTypeGuildNews
- ChannelTypeGuildStore
- )
- type Channel struct {
-
- ID string `json:"id"`
-
-
- GuildID string `json:"guild_id"`
-
- Name string `json:"name"`
-
- Topic string `json:"topic"`
-
- Type ChannelType `json:"type"`
-
-
- LastMessageID string `json:"last_message_id"`
-
-
- LastPinTimestamp Timestamp `json:"last_pin_timestamp"`
-
- NSFW bool `json:"nsfw"`
-
- Icon string `json:"icon"`
-
- Position int `json:"position"`
-
- Bitrate int `json:"bitrate"`
-
- Recipients []*User `json:"recipients"`
-
-
- Messages []*Message `json:"-"`
-
- PermissionOverwrites []*PermissionOverwrite `json:"permission_overwrites"`
-
- UserLimit int `json:"user_limit"`
-
- ParentID string `json:"parent_id"`
-
-
- RateLimitPerUser int `json:"rate_limit_per_user"`
- }
- func (c *Channel) Mention() string {
- return fmt.Sprintf("<#%s>", c.ID)
- }
- type ChannelEdit struct {
- Name string `json:"name,omitempty"`
- Topic string `json:"topic,omitempty"`
- NSFW bool `json:"nsfw,omitempty"`
- Position int `json:"position"`
- Bitrate int `json:"bitrate,omitempty"`
- UserLimit int `json:"user_limit,omitempty"`
- PermissionOverwrites []*PermissionOverwrite `json:"permission_overwrites,omitempty"`
- ParentID string `json:"parent_id,omitempty"`
- RateLimitPerUser int `json:"rate_limit_per_user,omitempty"`
- }
- type PermissionOverwrite struct {
- ID string `json:"id"`
- Type string `json:"type"`
- Deny int `json:"deny"`
- Allow int `json:"allow"`
- }
- type Emoji struct {
- ID string `json:"id"`
- Name string `json:"name"`
- Roles []string `json:"roles"`
- Managed bool `json:"managed"`
- RequireColons bool `json:"require_colons"`
- Animated bool `json:"animated"`
- Available bool `json:"available"`
- }
- func (e *Emoji) MessageFormat() string {
- if e.ID != "" && e.Name != "" {
- if e.Animated {
- return "<a:" + e.APIName() + ">"
- }
- return "<:" + e.APIName() + ">"
- }
- return e.APIName()
- }
- func (e *Emoji) APIName() string {
- if e.ID != "" && e.Name != "" {
- return e.Name + ":" + e.ID
- }
- if e.Name != "" {
- return e.Name
- }
- return e.ID
- }
- type VerificationLevel int
- const (
- VerificationLevelNone VerificationLevel = iota
- VerificationLevelLow
- VerificationLevelMedium
- VerificationLevelHigh
- VerificationLevelVeryHigh
- )
- type ExplicitContentFilterLevel int
- const (
- ExplicitContentFilterDisabled ExplicitContentFilterLevel = iota
- ExplicitContentFilterMembersWithoutRoles
- ExplicitContentFilterAllMembers
- )
- type MfaLevel int
- const (
- MfaLevelNone MfaLevel = iota
- MfaLevelElevated
- )
- type PremiumTier int
- const (
- PremiumTierNone PremiumTier = iota
- PremiumTier1
- PremiumTier2
- PremiumTier3
- )
- type Guild struct {
-
- ID string `json:"id"`
-
- Name string `json:"name"`
-
-
- Icon string `json:"icon"`
-
- Region string `json:"region"`
-
- AfkChannelID string `json:"afk_channel_id"`
-
- EmbedChannelID string `json:"embed_channel_id"`
-
- OwnerID string `json:"owner_id"`
-
-
-
- JoinedAt Timestamp `json:"joined_at"`
-
- Splash string `json:"splash"`
-
- AfkTimeout int `json:"afk_timeout"`
-
-
-
- MemberCount int `json:"member_count"`
-
- VerificationLevel VerificationLevel `json:"verification_level"`
-
- EmbedEnabled bool `json:"embed_enabled"`
-
-
-
- Large bool `json:"large"`
-
-
- DefaultMessageNotifications int `json:"default_message_notifications"`
-
- Roles []*Role `json:"roles"`
-
- Emojis []*Emoji `json:"emojis"`
-
-
-
- Members []*Member `json:"members"`
-
-
-
- Presences []*Presence `json:"presences"`
-
-
-
- Channels []*Channel `json:"channels"`
-
-
-
- VoiceStates []*VoiceState `json:"voice_states"`
-
-
-
- Unavailable bool `json:"unavailable"`
-
- ExplicitContentFilter ExplicitContentFilterLevel `json:"explicit_content_filter"`
-
- Features []string `json:"features"`
-
- MfaLevel MfaLevel `json:"mfa_level"`
-
- WidgetEnabled bool `json:"widget_enabled"`
-
- WidgetChannelID string `json:"widget_channel_id"`
-
- SystemChannelID string `json:"system_channel_id"`
-
- VanityURLCode string `json:"vanity_url_code"`
-
- Description string `json:"description"`
-
- Banner string `json:"banner"`
-
- PremiumTier PremiumTier `json:"premium_tier"`
-
- PremiumSubscriptionCount int `json:"premium_subscription_count"`
- }
- func (g *Guild) IconURL() string {
- if g.Icon == "" {
- return ""
- }
- if strings.HasPrefix(g.Icon, "a_") {
- return EndpointGuildIconAnimated(g.ID, g.Icon)
- }
- return EndpointGuildIcon(g.ID, g.Icon)
- }
- type UserGuild struct {
- ID string `json:"id"`
- Name string `json:"name"`
- Icon string `json:"icon"`
- Owner bool `json:"owner"`
- Permissions int `json:"permissions"`
- }
- type GuildParams struct {
- Name string `json:"name,omitempty"`
- Region string `json:"region,omitempty"`
- VerificationLevel *VerificationLevel `json:"verification_level,omitempty"`
- DefaultMessageNotifications int `json:"default_message_notifications,omitempty"`
- AfkChannelID string `json:"afk_channel_id,omitempty"`
- AfkTimeout int `json:"afk_timeout,omitempty"`
- Icon string `json:"icon,omitempty"`
- OwnerID string `json:"owner_id,omitempty"`
- Splash string `json:"splash,omitempty"`
- }
- type Role struct {
-
- ID string `json:"id"`
-
- Name string `json:"name"`
-
-
- Managed bool `json:"managed"`
-
- Mentionable bool `json:"mentionable"`
-
- Hoist bool `json:"hoist"`
-
- Color int `json:"color"`
-
- Position int `json:"position"`
-
-
-
- Permissions int `json:"permissions"`
- }
- func (r *Role) Mention() string {
- return fmt.Sprintf("<@&%s>", r.ID)
- }
- type Roles []*Role
- func (r Roles) Len() int {
- return len(r)
- }
- func (r Roles) Less(i, j int) bool {
- return r[i].Position > r[j].Position
- }
- func (r Roles) Swap(i, j int) {
- r[i], r[j] = r[j], r[i]
- }
- type VoiceState struct {
- UserID string `json:"user_id"`
- SessionID string `json:"session_id"`
- ChannelID string `json:"channel_id"`
- GuildID string `json:"guild_id"`
- Suppress bool `json:"suppress"`
- SelfMute bool `json:"self_mute"`
- SelfDeaf bool `json:"self_deaf"`
- Mute bool `json:"mute"`
- Deaf bool `json:"deaf"`
- }
- type Presence struct {
- User *User `json:"user"`
- Status Status `json:"status"`
- Game *Game `json:"game"`
- Nick string `json:"nick"`
- Roles []string `json:"roles"`
- Since *int `json:"since"`
- }
- type GameType int
- const (
- GameTypeGame GameType = iota
- GameTypeStreaming
- GameTypeListening
- GameTypeWatching
- )
- type Game struct {
- Name string `json:"name"`
- Type GameType `json:"type"`
- URL string `json:"url,omitempty"`
- Details string `json:"details,omitempty"`
- State string `json:"state,omitempty"`
- TimeStamps TimeStamps `json:"timestamps,omitempty"`
- Assets Assets `json:"assets,omitempty"`
- ApplicationID string `json:"application_id,omitempty"`
- Instance int8 `json:"instance,omitempty"`
-
- }
- type TimeStamps struct {
- EndTimestamp int64 `json:"end,omitempty"`
- StartTimestamp int64 `json:"start,omitempty"`
- }
- func (t *TimeStamps) UnmarshalJSON(b []byte) error {
- temp := struct {
- End float64 `json:"end,omitempty"`
- Start float64 `json:"start,omitempty"`
- }{}
- err := json.Unmarshal(b, &temp)
- if err != nil {
- return err
- }
- t.EndTimestamp = int64(temp.End)
- t.StartTimestamp = int64(temp.Start)
- return nil
- }
- type Assets struct {
- LargeImageID string `json:"large_image,omitempty"`
- SmallImageID string `json:"small_image,omitempty"`
- LargeText string `json:"large_text,omitempty"`
- SmallText string `json:"small_text,omitempty"`
- }
- type Member struct {
-
- GuildID string `json:"guild_id"`
-
- JoinedAt Timestamp `json:"joined_at"`
-
- Nick string `json:"nick"`
-
- Deaf bool `json:"deaf"`
-
- Mute bool `json:"mute"`
-
- User *User `json:"user"`
-
- Roles []string `json:"roles"`
-
- PremiumSince Timestamp `json:"premium_since"`
- }
- func (m *Member) Mention() string {
- return "<@!" + m.User.ID + ">"
- }
- type Settings struct {
- RenderEmbeds bool `json:"render_embeds"`
- InlineEmbedMedia bool `json:"inline_embed_media"`
- InlineAttachmentMedia bool `json:"inline_attachment_media"`
- EnableTTSCommand bool `json:"enable_tts_command"`
- MessageDisplayCompact bool `json:"message_display_compact"`
- ShowCurrentGame bool `json:"show_current_game"`
- ConvertEmoticons bool `json:"convert_emoticons"`
- Locale string `json:"locale"`
- Theme string `json:"theme"`
- GuildPositions []string `json:"guild_positions"`
- RestrictedGuilds []string `json:"restricted_guilds"`
- FriendSourceFlags *FriendSourceFlags `json:"friend_source_flags"`
- Status Status `json:"status"`
- DetectPlatformAccounts bool `json:"detect_platform_accounts"`
- DeveloperMode bool `json:"developer_mode"`
- }
- type Status string
- const (
- StatusOnline Status = "online"
- StatusIdle Status = "idle"
- StatusDoNotDisturb Status = "dnd"
- StatusInvisible Status = "invisible"
- StatusOffline Status = "offline"
- )
- type FriendSourceFlags struct {
- All bool `json:"all"`
- MutualGuilds bool `json:"mutual_guilds"`
- MutualFriends bool `json:"mutual_friends"`
- }
- type Relationship struct {
- User *User `json:"user"`
- Type int `json:"type"`
- ID string `json:"id"`
- }
- type TooManyRequests struct {
- Bucket string `json:"bucket"`
- Message string `json:"message"`
- RetryAfter time.Duration `json:"retry_after"`
- }
- type ReadState struct {
- MentionCount int `json:"mention_count"`
- LastMessageID string `json:"last_message_id"`
- ID string `json:"id"`
- }
- type Ack struct {
- Token string `json:"token"`
- }
- type GuildRole struct {
- Role *Role `json:"role"`
- GuildID string `json:"guild_id"`
- }
- type GuildBan struct {
- Reason string `json:"reason"`
- User *User `json:"user"`
- }
- type GuildEmbed struct {
- Enabled bool `json:"enabled"`
- ChannelID string `json:"channel_id"`
- }
- type GuildAuditLog struct {
- Webhooks []struct {
- ChannelID string `json:"channel_id"`
- GuildID string `json:"guild_id"`
- ID string `json:"id"`
- Avatar string `json:"avatar"`
- Name string `json:"name"`
- } `json:"webhooks,omitempty"`
- Users []struct {
- Username string `json:"username"`
- Discriminator string `json:"discriminator"`
- Bot bool `json:"bot"`
- ID string `json:"id"`
- Avatar string `json:"avatar"`
- } `json:"users,omitempty"`
- AuditLogEntries []struct {
- TargetID string `json:"target_id"`
- Changes []struct {
- NewValue interface{} `json:"new_value"`
- OldValue interface{} `json:"old_value"`
- Key string `json:"key"`
- } `json:"changes,omitempty"`
- UserID string `json:"user_id"`
- ID string `json:"id"`
- ActionType int `json:"action_type"`
- Options struct {
- DeleteMembersDay string `json:"delete_member_days"`
- MembersRemoved string `json:"members_removed"`
- ChannelID string `json:"channel_id"`
- Count string `json:"count"`
- ID string `json:"id"`
- Type string `json:"type"`
- RoleName string `json:"role_name"`
- } `json:"options,omitempty"`
- Reason string `json:"reason"`
- } `json:"audit_log_entries"`
- }
- const (
- AuditLogActionGuildUpdate = 1
- AuditLogActionChannelCreate = 10
- AuditLogActionChannelUpdate = 11
- AuditLogActionChannelDelete = 12
- AuditLogActionChannelOverwriteCreate = 13
- AuditLogActionChannelOverwriteUpdate = 14
- AuditLogActionChannelOverwriteDelete = 15
- AuditLogActionMemberKick = 20
- AuditLogActionMemberPrune = 21
- AuditLogActionMemberBanAdd = 22
- AuditLogActionMemberBanRemove = 23
- AuditLogActionMemberUpdate = 24
- AuditLogActionMemberRoleUpdate = 25
- AuditLogActionRoleCreate = 30
- AuditLogActionRoleUpdate = 31
- AuditLogActionRoleDelete = 32
- AuditLogActionInviteCreate = 40
- AuditLogActionInviteUpdate = 41
- AuditLogActionInviteDelete = 42
- AuditLogActionWebhookCreate = 50
- AuditLogActionWebhookUpdate = 51
- AuditLogActionWebhookDelete = 52
- AuditLogActionEmojiCreate = 60
- AuditLogActionEmojiUpdate = 61
- AuditLogActionEmojiDelete = 62
- AuditLogActionMessageDelete = 72
- )
- type UserGuildSettingsChannelOverride struct {
- Muted bool `json:"muted"`
- MessageNotifications int `json:"message_notifications"`
- ChannelID string `json:"channel_id"`
- }
- type UserGuildSettings struct {
- SupressEveryone bool `json:"suppress_everyone"`
- Muted bool `json:"muted"`
- MobilePush bool `json:"mobile_push"`
- MessageNotifications int `json:"message_notifications"`
- GuildID string `json:"guild_id"`
- ChannelOverrides []*UserGuildSettingsChannelOverride `json:"channel_overrides"`
- }
- type UserGuildSettingsEdit struct {
- SupressEveryone bool `json:"suppress_everyone"`
- Muted bool `json:"muted"`
- MobilePush bool `json:"mobile_push"`
- MessageNotifications int `json:"message_notifications"`
- ChannelOverrides map[string]*UserGuildSettingsChannelOverride `json:"channel_overrides"`
- }
- type APIErrorMessage struct {
- Code int `json:"code"`
- Message string `json:"message"`
- }
- type Webhook struct {
- ID string `json:"id"`
- GuildID string `json:"guild_id"`
- ChannelID string `json:"channel_id"`
- User *User `json:"user"`
- Name string `json:"name"`
- Avatar string `json:"avatar"`
- Token string `json:"token"`
- }
- type WebhookParams struct {
- Content string `json:"content,omitempty"`
- Username string `json:"username,omitempty"`
- AvatarURL string `json:"avatar_url,omitempty"`
- TTS bool `json:"tts,omitempty"`
- File string `json:"file,omitempty"`
- Embeds []*MessageEmbed `json:"embeds,omitempty"`
- }
- type MessageReaction struct {
- UserID string `json:"user_id"`
- MessageID string `json:"message_id"`
- Emoji Emoji `json:"emoji"`
- ChannelID string `json:"channel_id"`
- GuildID string `json:"guild_id,omitempty"`
- }
- type GatewayBotResponse struct {
- URL string `json:"url"`
- Shards int `json:"shards"`
- }
- const (
- PermissionReadMessages = 1 << (iota + 10)
- PermissionSendMessages
- PermissionSendTTSMessages
- PermissionManageMessages
- PermissionEmbedLinks
- PermissionAttachFiles
- PermissionReadMessageHistory
- PermissionMentionEveryone
- PermissionUseExternalEmojis
- )
- const (
- PermissionVoiceConnect = 1 << (iota + 20)
- PermissionVoiceSpeak
- PermissionVoiceMuteMembers
- PermissionVoiceDeafenMembers
- PermissionVoiceMoveMembers
- PermissionVoiceUseVAD
- PermissionVoicePrioritySpeaker = 1 << (iota + 2)
- )
- const (
- PermissionChangeNickname = 1 << (iota + 26)
- PermissionManageNicknames
- PermissionManageRoles
- PermissionManageWebhooks
- PermissionManageEmojis
- )
- const (
- PermissionCreateInstantInvite = 1 << iota
- PermissionKickMembers
- PermissionBanMembers
- PermissionAdministrator
- PermissionManageChannels
- PermissionManageServer
- PermissionAddReactions
- PermissionViewAuditLogs
- PermissionAllText = PermissionReadMessages |
- PermissionSendMessages |
- PermissionSendTTSMessages |
- PermissionManageMessages |
- PermissionEmbedLinks |
- PermissionAttachFiles |
- PermissionReadMessageHistory |
- PermissionMentionEveryone
- PermissionAllVoice = PermissionVoiceConnect |
- PermissionVoiceSpeak |
- PermissionVoiceMuteMembers |
- PermissionVoiceDeafenMembers |
- PermissionVoiceMoveMembers |
- PermissionVoiceUseVAD |
- PermissionVoicePrioritySpeaker
- PermissionAllChannel = PermissionAllText |
- PermissionAllVoice |
- PermissionCreateInstantInvite |
- PermissionManageRoles |
- PermissionManageChannels |
- PermissionAddReactions |
- PermissionViewAuditLogs
- PermissionAll = PermissionAllChannel |
- PermissionKickMembers |
- PermissionBanMembers |
- PermissionManageServer |
- PermissionAdministrator |
- PermissionManageWebhooks |
- PermissionManageEmojis
- )
- const (
- ErrCodeUnknownAccount = 10001
- ErrCodeUnknownApplication = 10002
- ErrCodeUnknownChannel = 10003
- ErrCodeUnknownGuild = 10004
- ErrCodeUnknownIntegration = 10005
- ErrCodeUnknownInvite = 10006
- ErrCodeUnknownMember = 10007
- ErrCodeUnknownMessage = 10008
- ErrCodeUnknownOverwrite = 10009
- ErrCodeUnknownProvider = 10010
- ErrCodeUnknownRole = 10011
- ErrCodeUnknownToken = 10012
- ErrCodeUnknownUser = 10013
- ErrCodeUnknownEmoji = 10014
- ErrCodeUnknownWebhook = 10015
- ErrCodeBotsCannotUseEndpoint = 20001
- ErrCodeOnlyBotsCanUseEndpoint = 20002
- ErrCodeMaximumGuildsReached = 30001
- ErrCodeMaximumFriendsReached = 30002
- ErrCodeMaximumPinsReached = 30003
- ErrCodeMaximumGuildRolesReached = 30005
- ErrCodeTooManyReactions = 30010
- ErrCodeUnauthorized = 40001
- ErrCodeMissingAccess = 50001
- ErrCodeInvalidAccountType = 50002
- ErrCodeCannotExecuteActionOnDMChannel = 50003
- ErrCodeEmbedDisabled = 50004
- ErrCodeCannotEditFromAnotherUser = 50005
- ErrCodeCannotSendEmptyMessage = 50006
- ErrCodeCannotSendMessagesToThisUser = 50007
- ErrCodeCannotSendMessagesInVoiceChannel = 50008
- ErrCodeChannelVerificationLevelTooHigh = 50009
- ErrCodeOAuth2ApplicationDoesNotHaveBot = 50010
- ErrCodeOAuth2ApplicationLimitReached = 50011
- ErrCodeInvalidOAuthState = 50012
- ErrCodeMissingPermissions = 50013
- ErrCodeInvalidAuthenticationToken = 50014
- ErrCodeNoteTooLong = 50015
- ErrCodeTooFewOrTooManyMessagesToDelete = 50016
- ErrCodeCanOnlyPinMessageToOriginatingChannel = 50019
- ErrCodeCannotExecuteActionOnSystemMessage = 50021
- ErrCodeMessageProvidedTooOldForBulkDelete = 50034
- ErrCodeInvalidFormBody = 50035
- ErrCodeInviteAcceptedToGuildApplicationsBotNotIn = 50036
- ErrCodeReactionBlocked = 90001
- )
|