errors

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2023 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GeneralError                                               ErrorCode = 0
	UnknownAccount                                                       = 10001
	UnknownApplication                                                   = 10002
	UnknownChannel                                                       = 10003
	UnknownGuild                                                         = 10004
	UnknownIntegration                                                   = 10005
	UnknownInvite                                                        = 10006
	UnknownMember                                                        = 10007
	UnknownMessage                                                       = 10008
	UnknownPermissionOverwrite                                           = 10009
	UnknownProvider                                                      = 10010
	UnknownRole                                                          = 10011
	UnknownToken                                                         = 10012
	UnknownUser                                                          = 10013
	UnknownEmoji                                                         = 10014
	UnknownWebhook                                                       = 10015
	UnknownWebhookService                                                = 10016
	UnknownSession                                                       = 10020
	UnknownBan                                                           = 10026
	UnknownSKU                                                           = 10027
	UnknownStoreListing                                                  = 10028
	UnknownEntitlement                                                   = 10029
	UnknownBuild                                                         = 10030
	UnknownLobby                                                         = 10031
	UnknownBranch                                                        = 10032
	UnknownStoreDirectoryLayout                                          = 10033
	UnknownRedistributable                                               = 10036
	UnknownGiftCode                                                      = 10038
	UnknownStream                                                        = 10049
	UnknownPremiumServerSubscribeCooldown                                = 10050
	UnknownGuildTemplate                                                 = 10057
	UnknownDiscoverableServerCategory                                    = 10059
	UnknownSticker                                                       = 10060
	UnknownInteraction                                                   = 10062
	UnknownApplicationCommand                                            = 10063
	UnknownVoiceState                                                    = 10065
	UnknownApplicationCommandPermissions                                 = 10066
	UnknownStageInstance                                                 = 10067
	UnknownGuildMemberVerificationForm                                   = 10068
	UnknownGuildWelcomeScreen                                            = 10069
	UnknownGuildScheduledEvent                                           = 10070
	UnknownGuildScheduledEventUser                                       = 10071
	UnknownTag                                                           = 10087
	BotsCannotUseThisEndpoint                                            = 20001
	OnlyBotsCanUseThisEndpoint                                           = 20002
	ExplicitContentCannotBeSent                                          = 20009
	NotAuthorizedToPerformAction                                         = 20012
	ActionCannotBePerformedSlowmodeRateLimit                             = 20016
	OnlyAccountOwnerCanPerformAction                                     = 20018
	MessageCannotBeEditedAnnouncementRateLimits                          = 20022
	UnderMinimumAge                                                      = 20024
	ChannelWriteRateLimitHit                                             = 20028
	ServerWriteRateLimitHit                                              = 20029
	DisallowedWordsInContent                                             = 20031
	GuildPremiumSubscriptionLevelTooLow                                  = 20035
	MaximumNumberOfGuildsReached                                         = 30001
	MaximumNumberOfFriendsReached                                        = 30002
	MaximumNumberOfPinsReached                                           = 30003
	MaximumNumberOfRecipientsReached                                     = 30004
	MaximumNumberOfGuildRolesReached                                     = 30005
	MaximumNumberOfWebhooksReached                                       = 30007
	MaximumNumberOfEmojisReached                                         = 30008
	MaximumNumberOfReactionsReached                                      = 30010
	MaximumNumberOfGroupDMsReached                                       = 30011
	MaximumNumberOfGuildChannelsReached                                  = 30013
	MaximumNumberOfAttachmentsReached                                    = 30015
	MaximumNumberOfInvitesReached                                        = 30016
	MaximumNumberOfAnimatedEmojisReached                                 = 30018
	MaximumNumberOfServerMembersReached                                  = 30019
	MaximumNumberOfServerCategoriesReached                               = 30030
	GuildAlreadyHasTemplate                                              = 30031
	MaximumNumberOfApplicationCommandsReached                            = 30032
	MaximumNumberOfThreadParticipantsReached                             = 30033
	MaximumNumberOfDailyApplicationCommandCreatesReached                 = 30034
	MaximumNumberOfBansForNonGuildMembersExceeded                        = 30035
	MaximumNumberOfBansFetchesReached                                    = 30037
	MaximumNumberOfUncompletedGuildScheduledEventsReached                = 30038
	MaximumNumberOfStickersReached                                       = 30039
	MaximumNumberOfPruneRequestsReached                                  = 30040
	MaximumNumberOfGuildWidgetSettingsUpdatesReached                     = 30042
	MaximumNumberOfEditsToMessagesOlderThan1HourReached                  = 30046
	MaximumNumberOfPinnedThreadsInForumChannelReached                    = 30047
	MaximumNumberOfTagsInForumChannelReached                             = 30048
	BitrateTooHighForChannelOfType                                       = 30052
	MaximumNumberOfPremiumEmojisReached                                  = 30056
	MaximumNumberOfWebhooksPerGuildReached                               = 30058
	MaximumNumberOfChannelPermissionOverwritesReached                    = 30060
	ChannelsForGuildAreTooLarge                                          = 30061
	UnauthorizedRequest                                                  = 40001
	AccountNeedsVerificationToPerformAction                              = 40002
	OpeningDirectMessagesTooFast                                         = 40003
	SendingMessagesTemporarilyDisabled                                   = 40004
	RequestEntityTooLarge                                                = 40005
	FeatureTemporarilyDisabledServerSide                                 = 40006
	UserIsBannedFromGuild                                                = 40007
	ConnectionRevoked                                                    = 40012
	TargetUserNotConnectedToVoice                                        = 40032
	MessageAlreadyCrossposted                                            = 40033
	ApplicationCommandWithNameAlreadyExists                              = 40041
	ApplicationInteractionFailedToSend                                   = 40043
	CannotSendMessageInForumChannel                                      = 40058
	InteractionAlreadyAcknowledged                                       = 40060
	TagNamesMustBeUnique                                                 = 40061
	ServiceResourceIsBeingRateLimited                                    = 40062
	TagsNotAvailableToBeSetByNonModerators                               = 40066
	TagIsRequiredToCreateForumPostInChannel                              = 40067
	MissingAccess                                                        = 50001
	InvalidAccountType                                                   = 50002
	CannotExecuteActionOnDMChannel                                       = 50003
	GuildWidgetDisabled                                                  = 50004
	CannotEditMessageAuthoredByAnotherUser                               = 50005
	CannotSendEmptyMessage                                               = 50006
	CannotSendMessageToUser                                              = 50007
	CannotSendMessageInNonTextChannel                                    = 50008
	ChannelVerificationLevelTooHigh                                      = 50009
	OAuth2ApplicationDoesNotHaveBot                                      = 50010
	OAuth2ApplicationLimitReached                                        = 50011
	InvalidOAuth2State                                                   = 50012
	PermissionsLackToPerformAction                                       = 50013
	InvalidAuthenticationTokenProvided                                   = 50014
	NoteWasTooLong                                                       = 50015
	InvalidNumberOfMessagesToDeleteProvided                              = 50016
	InvalidMFALevel                                                      = 50017
	MessageCanOnlyBePinnedInChannelItWasSentIn                           = 50019
	InvalidInviteCode                                                    = 50020
	CannotExecuteActionOnSystemMessage                                   = 50021
	CannotExecuteActionOnThisChannelType                                 = 50024
	InvalidOAuth2AccessTokenProvided                                     = 50025
	MissingRequiredOAuth2Scope                                           = 50026
	InvalidWebhookTokenProvided                                          = 50027
	InvalidRole                                                          = 50028
	InvalidRecipients                                                    = 50033
	MessageTooOldToBulkDelete                                            = 50034
	InvalidFormBody                                                      = 50035
	InviteAcceptedToGuildBotNotIn                                        = 50036
	InvalidActivityAction                                                = 50039
	InvalidAPIVersionProvided                                            = 50041
	FileUploadedExceedsMaximumSize                                       = 50045
	InvalidUploadedFile                                                  = 50046
	CannotSelfRedeemThisGift                                             = 50054
	InvalidGuild                                                         = 50055
	InvalidRequestOrigin                                                 = 50067
	InvalidMessageType                                                   = 50068
	PaymentSourceRequiredToRedeemGift                                    = 50070
	CannotModifySystemWebhook                                            = 50073
	CannotDeleteChannelRequiredForCommunityGuilds                        = 50074
	CannotEditStickersWithinMessage                                      = 50080
	InvalidStickerSent                                                   = 50081
	CannotPerformOperationOnArchivedThread                               = 50083
	InvalidThreadNotificationSettings                                    = 50084
	BeforeValueEarlierThanThreadCreationDate                             = 50085
	CommunityServerChannelsMustBeTextChannels                            = 50086
	EventEntityTypeDifferentFromEntityToStartFor                         = 50091
	ServerNotAvailableInYourLocation                                     = 50095
	ServerNeedsMonetizationEnabled                                       = 50097
	ServerNeedsMoreBoosts                                                = 50101
	InvalidJSONRequestBody                                               = 50109
	OwnershipCannotBeTransferredToBotUser                                = 50132
	FailedToResizeAssetBelowMaximumSize                                  = 50138
	CannotMixSubscriptionAndNonSubscriptionRolesForEmoji                 = 50144
	CannotConvertBetweenPremiumAndNormalEmoji                            = 50145
	UploadedFileNotFound                                                 = 50146
	CannotDeleteGuildSubscriptionIntegration                             = 50163
	PermissionToUseStickerNotGranted                                     = 50600
	TwoFactorAuthenticationRequired                                      = 60003
	NoUsersWithDiscordTagExist                                           = 80004
	ReactionBlocked                                                      = 90001
	ApplicationNotYetAvailable                                           = 110001
	APIResourceOverloaded                                                = 130000
	StageAlreadyOpen                                                     = 150006
	CannotReplyWithoutPermissionToReadMessageHistory                     = 160002
	ThreadAlreadyCreatedForMessage                                       = 160004
	ThreadLocked                                                         = 160005
	MaximumNumberOfActiveThreadsReached                                  = 160006
	MaximumNumberOfActiveAnnouncementThreadsReached                      = 160007
	InvalidJSONForUploadedLottieFile                                     = 170001
	UploadedLottiesCannotContainRasterizedImages                         = 170002
	StickerMaximumFramerateExceeded                                      = 170003
	StickerFrameCountExceedsMaximum                                      = 170004
	LottieAnimationMaximumDimensionsExceeded                             = 170005
	StickerFrameRateTooSmallOrTooLarge                                   = 170006
	StickerAnimationDurationExceedsMaximum                               = 170007
	CannotUpdateFinishedEvent                                            = 180000
	FailedToCreateStageForStageEvent                                     = 180002
	MessageBlockedByAutomaticModeration                                  = 200000
	TitleBlockedByAutomaticModeration                                    = 200001
	WebhooksPostedToForumChannelsMustHaveThreadNameOrID                  = 220001
	WebhooksPostedToForumChannelsCannotHaveBothThreadNameAndID           = 220002
	WebhooksCanOnlyCreateThreadsInForumChannels                          = 220003
	WebhookServicesCannotBeUsedInForumChannels                           = 220004
	MessageBlockedByHarmfulLinksFilter                                   = 240000
)
View Source
const (
	BadRequest StatusErrorCode = iota + 400
	Unauthorized
	Forbidden          = 403
	NotFound           = 404
	MethodNotAllowed   = 405
	TooManyRequests    = 429
	GatewayUnavailable = 502
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DiscordError

type DiscordError struct {
	Code     ErrorCode
	Response *http.Response
}

func (*DiscordError) Error

func (e *DiscordError) Error() string

type ErrorCode

type ErrorCode int

func (ErrorCode) GetEnglishError

func (err ErrorCode) GetEnglishError() string

type StatusError

type StatusError struct {
	Code     StatusErrorCode
	Response *http.Response
}

func (StatusError) Error

func (s StatusError) Error() string

type StatusErrorCode

type StatusErrorCode int

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL