Skip to main content

djs_model/rest/
error_code.rs

1//! [JSON error codes](https://docs.discord.com/developers/topics/opcodes-and-status-codes#json-json-error-codes)
2//! of REST API error responses.
3//!
4//! Generated from the docs' table, with names from discord-api-types (D-097, D-098); the
5//! descriptions are the library's own.
6
7use crate::macros::int_enum;
8
9int_enum! {
10    /// The [JSON error code](https://docs.discord.com/developers/topics/opcodes-and-status-codes#json-json-error-codes)
11    /// of an error response: what went wrong, in more detail than the HTTP status (D-097).
12    ///
13    /// Variants are named like discord-api-types' `RESTJSONErrorCodes` (D-098), with acronyms
14    /// written as words (`UnknownSku`); rustdoc search also finds them by their original name
15    /// and by their number. Codes added by Discord later decode as
16    /// [`Unknown`](Self::Unknown).
17    ///
18    /// discord.js counterpart: `RESTJSONErrorCodes`.
19    ///
20    /// # Examples
21    ///
22    /// ```
23    /// use djs_model::rest::ErrorCode;
24    ///
25    /// let code: ErrorCode = serde_json::from_str("50013").unwrap();
26    /// assert_eq!(code, ErrorCode::MissingPermissions);
27    /// assert_eq!(code.value(), 50013);
28    /// assert_eq!(ErrorCode::from(10008), ErrorCode::UnknownMessage);
29    /// assert!(ErrorCode::from(1).is_unknown());
30    /// ```
31    #[doc(alias = "RESTJSONErrorCodes")]
32    pub enum ErrorCode: u32 {
33        /// `0`: A general error, e.g. a malformed request body.
34        #[doc(alias = "0")]
35        GeneralError = 0,
36        /// `10001`: The account was not found.
37        #[doc(alias = "10001")]
38        UnknownAccount = 10_001,
39        /// `10002`: The application was not found.
40        #[doc(alias = "10002")]
41        UnknownApplication = 10_002,
42        /// `10003`: The channel was not found.
43        #[doc(alias = "10003")]
44        UnknownChannel = 10_003,
45        /// `10004`: The guild was not found.
46        #[doc(alias = "10004")]
47        UnknownGuild = 10_004,
48        /// `10005`: The integration was not found.
49        #[doc(alias = "10005")]
50        UnknownIntegration = 10_005,
51        /// `10006`: The invite was not found.
52        #[doc(alias = "10006")]
53        UnknownInvite = 10_006,
54        /// `10007`: The guild member was not found.
55        #[doc(alias = "10007")]
56        UnknownMember = 10_007,
57        /// `10008`: The message was not found.
58        #[doc(alias = "10008")]
59        UnknownMessage = 10_008,
60        /// `10009`: The permission overwrite was not found.
61        #[doc(alias = "10009")]
62        UnknownPermissionOverwrite = 10_009,
63        /// `10010`: The provider was not found.
64        #[doc(alias = "10010")]
65        UnknownProvider = 10_010,
66        /// `10011`: The role was not found.
67        #[doc(alias = "10011")]
68        UnknownRole = 10_011,
69        /// `10012`: The token was not found.
70        #[doc(alias = "10012")]
71        UnknownToken = 10_012,
72        /// `10013`: The user was not found.
73        #[doc(alias = "10013")]
74        UnknownUser = 10_013,
75        /// `10014`: The emoji was not found.
76        #[doc(alias = "10014")]
77        UnknownEmoji = 10_014,
78        /// `10015`: The webhook was not found.
79        #[doc(alias = "10015")]
80        UnknownWebhook = 10_015,
81        /// `10016`: The webhook service was not found.
82        #[doc(alias = "10016")]
83        UnknownWebhookService = 10_016,
84        /// `10020`: The session was not found.
85        #[doc(alias = "10020")]
86        UnknownSession = 10_020,
87        /// `10021`: The asset was not found.
88        #[doc(alias = "10021")]
89        UnknownAsset = 10_021,
90        /// `10026`: The ban was not found.
91        #[doc(alias = "10026")]
92        UnknownBan = 10_026,
93        /// `10027`: The SKU was not found.
94        #[doc(alias = "UnknownSKU")]
95        #[doc(alias = "10027")]
96        UnknownSku = 10_027,
97        /// `10028`: The store listing was not found.
98        #[doc(alias = "10028")]
99        UnknownStoreListing = 10_028,
100        /// `10029`: The entitlement was not found.
101        #[doc(alias = "10029")]
102        UnknownEntitlement = 10_029,
103        /// `10030`: The build was not found.
104        #[doc(alias = "10030")]
105        UnknownBuild = 10_030,
106        /// `10031`: The lobby was not found.
107        #[doc(alias = "10031")]
108        UnknownLobby = 10_031,
109        /// `10032`: The branch was not found.
110        #[doc(alias = "10032")]
111        UnknownBranch = 10_032,
112        /// `10033`: The store directory layout was not found.
113        #[doc(alias = "10033")]
114        UnknownStoreDirectoryLayout = 10_033,
115        /// `10036`: The redistributable was not found.
116        #[doc(alias = "10036")]
117        UnknownRedistributable = 10_036,
118        /// `10038`: The gift code was not found.
119        #[doc(alias = "10038")]
120        UnknownGiftCode = 10_038,
121        /// `10049`: The stream was not found.
122        #[doc(alias = "10049")]
123        UnknownStream = 10_049,
124        /// `10050`: The premium server subscription cooldown was not found.
125        #[doc(alias = "10050")]
126        UnknownPremiumServerSubscribeCooldown = 10_050,
127        /// `10057`: The guild template was not found.
128        #[doc(alias = "10057")]
129        UnknownGuildTemplate = 10_057,
130        /// `10059`: The discoverable server category was not found.
131        #[doc(alias = "10059")]
132        UnknownDiscoverableServerCategory = 10_059,
133        /// `10060`: The sticker was not found.
134        #[doc(alias = "10060")]
135        UnknownSticker = 10_060,
136        /// `10061`: The sticker pack was not found.
137        #[doc(alias = "10061")]
138        UnknownStickerPack = 10_061,
139        /// `10062`: The interaction was not found.
140        #[doc(alias = "10062")]
141        UnknownInteraction = 10_062,
142        /// `10063`: The application command was not found.
143        #[doc(alias = "10063")]
144        UnknownApplicationCommand = 10_063,
145        /// `10065`: The voice state was not found.
146        #[doc(alias = "10065")]
147        UnknownVoiceState = 10_065,
148        /// `10066`: The application command permissions was not found.
149        #[doc(alias = "10066")]
150        UnknownApplicationCommandPermissions = 10_066,
151        /// `10067`: The stage instance was not found.
152        #[doc(alias = "10067")]
153        UnknownStageInstance = 10_067,
154        /// `10068`: The member verification form was not found.
155        #[doc(alias = "10068")]
156        UnknownGuildMemberVerificationForm = 10_068,
157        /// `10069`: The welcome screen was not found.
158        #[doc(alias = "10069")]
159        UnknownGuildWelcomeScreen = 10_069,
160        /// `10070`: The scheduled event was not found.
161        #[doc(alias = "10070")]
162        UnknownGuildScheduledEvent = 10_070,
163        /// `10071`: The scheduled event user was not found.
164        #[doc(alias = "10071")]
165        UnknownGuildScheduledEventUser = 10_071,
166        /// `10087`: The forum tag was not found.
167        #[doc(alias = "10087")]
168        UnknownTag = 10_087,
169        /// `10097`: The soundboard sound was not found.
170        #[doc(alias = "10097")]
171        UnknownSound = 10_097,
172        /// `10124`: The invite exists but no job for its target users was found.
173        #[doc(alias = "10124")]
174        UnknownInviteTargetUsersJob = 10_124,
175        /// `10129`: The invite exists but has no target users.
176        #[doc(alias = "10129")]
177        UnknownInviteTargetUsers = 10_129,
178        /// `20001`: This endpoint is not available to bots.
179        #[doc(alias = "20001")]
180        BotsCannotUseThisEndpoint = 20_001,
181        /// `20002`: This endpoint is only available to bots.
182        #[doc(alias = "20002")]
183        OnlyBotsCanUseThisEndpoint = 20_002,
184        /// `20009`: Explicit content cannot be sent to the recipient(s).
185        #[doc(alias = "20009")]
186        ExplicitContentCannotBeSentToTheDesiredRecipient = 20_009,
187        /// `20012`: The current user may not perform this action on the application.
188        #[doc(alias = "20012")]
189        NotAuthorizedToPerformThisActionOnThisApplication = 20_012,
190        /// `20015`: The action needs a premium subscription.
191        #[doc(alias = "20015")]
192        ThisActionRequiresAPremiumSubscription = 20_015,
193        /// `20016`: The channel's slowmode does not allow the action yet.
194        #[doc(alias = "20016")]
195        ActionCannotBePerformedDueToSlowmodeRateLimit = 20_016,
196        /// `20018`: Only the account's owner can perform this action.
197        #[doc(alias = "20018")]
198        OnlyTheOwnerOfThisAccountCanPerformThisAction = 20_018,
199        /// `20022`: The message cannot be edited because of the announcement rate limits.
200        #[doc(alias = "20022")]
201        AnnouncementEditLimitExceeded = 20_022,
202        /// `20024`: The user is below the minimum age.
203        #[doc(alias = "20024")]
204        UnderMinimumAge = 20_024,
205        /// `20028`: The channel's write rate limit was hit.
206        #[doc(alias = "20028")]
207        ChannelWriteRateLimit = 20_028,
208        /// `20029`: The server's write rate limit was hit.
209        #[doc(alias = "20029")]
210        ServerWriteRateLimit = 20_029,
211        /// `20031`: The Stage topic, server name, server description or a channel name contains
212        /// disallowed words.
213        #[doc(alias = "20031")]
214        StageTopicServerNameServerDescriptionOrChannelNamesContainDisallowedWords = 20_031,
215        /// `20035`: The guild's boost level is too low.
216        #[doc(alias = "20035")]
217        GuildPremiumSubscriptionLevelTooLow = 20_035,
218        /// `30001`: The limit of guilds the user is in (100) was reached.
219        #[doc(alias = "30001")]
220        MaximumNumberOfGuildsReached = 30_001,
221        /// `30002`: The limit of friends (1000) was reached.
222        #[doc(alias = "30002")]
223        MaximumNumberOfFriendsReached = 30_002,
224        /// `30003`: The limit of pinned messages in the channel (250) was reached.
225        #[doc(alias = "30003")]
226        MaximumNumberOfPinsReachedForTheChannel = 30_003,
227        /// `30004`: The limit of group DM recipients (10) was reached.
228        #[doc(alias = "30004")]
229        MaximumNumberOfRecipientsReached = 30_004,
230        /// `30005`: The limit of roles in the guild (250) was reached.
231        #[doc(alias = "30005")]
232        MaximumNumberOfGuildRolesReached = 30_005,
233        /// `30007`: The limit of webhooks in the channel (15) was reached.
234        #[doc(alias = "30007")]
235        MaximumNumberOfWebhooksReached = 30_007,
236        /// `30008`: The limit of emojis in the guild was reached.
237        #[doc(alias = "30008")]
238        MaximumNumberOfEmojisReached = 30_008,
239        /// `30010`: The limit of different reactions on the message (20) was reached.
240        #[doc(alias = "30010")]
241        MaximumNumberOfReactionsReached = 30_010,
242        /// `30011`: The limit of group DMs (10) was reached.
243        #[doc(alias = "MaximumNumberOfGroupDMsReached")]
244        #[doc(alias = "30011")]
245        MaximumNumberOfGroupDmsReached = 30_011,
246        /// `30013`: The limit of channels in the guild (500) was reached.
247        #[doc(alias = "30013")]
248        MaximumNumberOfGuildChannelsReached = 30_013,
249        /// `30015`: The limit of attachments in one message (10) was reached.
250        #[doc(alias = "30015")]
251        MaximumNumberOfAttachmentsInAMessageReached = 30_015,
252        /// `30016`: The limit of invites (1000) was reached.
253        #[doc(alias = "30016")]
254        MaximumNumberOfInvitesReached = 30_016,
255        /// `30018`: The limit of animated emojis in the guild was reached.
256        #[doc(alias = "30018")]
257        MaximumNumberOfAnimatedEmojisReached = 30_018,
258        /// `30019`: The limit of members in the guild was reached.
259        #[doc(alias = "30019")]
260        MaximumNumberOfServerMembersReached = 30_019,
261        /// `30030`: The limit of server categories (5) was reached.
262        #[doc(alias = "30030")]
263        MaximumNumberOfServerCategoriesReached = 30_030,
264        /// `30031`: The guild already has a template.
265        #[doc(alias = "30031")]
266        GuildAlreadyHasTemplate = 30_031,
267        /// `30032`: The limit of application commands was reached.
268        #[doc(alias = "30032")]
269        MaximumNumberOfApplicationCommandsReached = 30_032,
270        /// `30033`: The limit of thread participants (1000) was reached.
271        #[doc(alias = "30033")]
272        MaximumThreadParticipantsReached = 30_033,
273        /// `30034`: The limit of application commands created per day (200) was reached.
274        #[doc(alias = "30034")]
275        MaximumDailyApplicationCommandCreatesReached = 30_034,
276        /// `30035`: The limit of bans of users who are not members was reached.
277        #[doc(alias = "30035")]
278        MaximumNumberOfNonGuildMemberBansHasBeenExceeded = 30_035,
279        /// `30037`: The limit of ban list fetches was reached.
280        #[doc(alias = "30037")]
281        MaximumNumberOfBanFetchesHasBeenReached = 30_037,
282        /// `30038`: The limit of scheduled events that have not ended (100) was reached.
283        #[doc(alias = "30038")]
284        MaximumNumberOfUncompletedGuildScheduledEventsReached = 30_038,
285        /// `30039`: The limit of stickers in the guild was reached.
286        #[doc(alias = "30039")]
287        MaximumNumberOfStickersReached = 30_039,
288        /// `30040`: Too many prune requests; try again later.
289        #[doc(alias = "30040")]
290        MaximumNumberOfPruneRequestsHasBeenReached = 30_040,
291        /// `30042`: Too many guild widget settings updates; try again later.
292        #[doc(alias = "30042")]
293        MaximumNumberOfGuildWidgetSettingsUpdatesHasBeenReached = 30_042,
294        /// `30045`: The limit of soundboard sounds was reached.
295        #[doc(alias = "30045")]
296        MaximumNumberOfSoundboardSoundsReached = 30_045,
297        /// `30046`: Too many edits to messages older than one hour; try again later.
298        #[doc(alias = "30046")]
299        MaximumNumberOfEditsToMessagesOlderThanOneHourReached = 30_046,
300        /// `30047`: The limit of pinned threads in the forum channel was reached.
301        #[doc(alias = "30047")]
302        MaximumNumberOfPinnedThreadsInForumHasBeenReached = 30_047,
303        /// `30048`: The limit of tags in the forum channel was reached.
304        #[doc(alias = "30048")]
305        MaximumNumberOfTagsInForumHasBeenReached = 30_048,
306        /// `30052`: The bitrate is too high for this type of channel.
307        #[doc(alias = "30052")]
308        BitrateIsTooHighForChannelOfThisType = 30_052,
309        /// `30056`: The limit of premium (subscription) emojis (25) was reached.
310        #[doc(alias = "30056")]
311        MaximumNumberOfPremiumEmojisReached = 30_056,
312        /// `30058`: The limit of webhooks in the guild (1000) was reached.
313        #[doc(alias = "30058")]
314        MaximumNumberOfWebhooksPerGuildReached = 30_058,
315        /// `30060`: The limit of permission overwrites on the channel (1000) was reached.
316        #[doc(alias = "30060")]
317        MaximumNumberOfChannelPermissionOverwritesReached = 30_060,
318        /// `30061`: The guild's channels are too large.
319        #[doc(alias = "30061")]
320        TheChannelsForThisGuildAreTooLarge = 30_061,
321        /// `30084`: The guild's limit of invite target users was reached.
322        #[doc(alias = "30084")]
323        InviteTargetUsersLimitReached = 30_084,
324        /// `40001`: Unauthorized: send a valid token.
325        #[doc(alias = "40001")]
326        Unauthorized = 40_001,
327        /// `40002`: The account must be verified first.
328        #[doc(alias = "40002")]
329        VerifyYourAccount = 40_002,
330        /// `40003`: Direct messages are being opened too quickly.
331        #[doc(alias = "40003")]
332        OpeningDirectMessagesTooFast = 40_003,
333        /// `40004`: Sending messages is temporarily disabled.
334        #[doc(alias = "40004")]
335        SendMessagesHasBeenTemporarilyDisabled = 40_004,
336        /// `40005`: The request is too large; send something smaller.
337        #[doc(alias = "40005")]
338        RequestEntityTooLarge = 40_005,
339        /// `40006`: This feature is temporarily disabled on Discord's side.
340        #[doc(alias = "40006")]
341        FeatureTemporarilyDisabledServerSide = 40_006,
342        /// `40007`: The user is banned from this guild.
343        #[doc(alias = "40007")]
344        UserBannedFromThisGuild = 40_007,
345        /// `40009`: The `parent_id` of only one channel can be changed at a time.
346        #[doc(alias = "40009")]
347        OnlyOneChannelCanHaveAParentIdModifiedAtATime = 40_009,
348        /// `40012`: The connection was revoked.
349        #[doc(alias = "40012")]
350        ConnectionHasBeenRevoked = 40_012,
351        /// `40018`: Only consumable SKUs can be consumed.
352        #[doc(alias = "OnlyConsumableSKUsCanBeConsumed")]
353        #[doc(alias = "40018")]
354        OnlyConsumableSkusCanBeConsumed = 40_018,
355        /// `40019`: Only test (sandbox) entitlements can be deleted.
356        #[doc(alias = "40019")]
357        YouCanOnlyDeleteSandboxEntitlements = 40_019,
358        /// `40032`: The target user is not in a voice channel.
359        #[doc(alias = "40032")]
360        TargetUserIsNotConnectedToVoice = 40_032,
361        /// `40033`: The message was already crossposted (published).
362        #[doc(alias = "40033")]
363        ThisMessageWasAlreadyCrossposted = 40_033,
364        /// `40041`: An application command with this name already exists.
365        #[doc(alias = "40041")]
366        ApplicationCommandWithThatNameAlreadyExists = 40_041,
367        /// `40043`: The application interaction could not be sent.
368        #[doc(alias = "40043")]
369        ApplicationInteractionFailedToSend = 40_043,
370        /// `40058`: Messages cannot be sent in a forum channel (create a post instead).
371        #[doc(alias = "40058")]
372        CannotSendAMessageInAForumChannel = 40_058,
373        /// `40060`: The interaction was already acknowledged (responded to).
374        #[doc(alias = "40060")]
375        InteractionHasAlreadyBeenAcknowledged = 40_060,
376        /// `40061`: Forum tag names must be unique.
377        #[doc(alias = "40061")]
378        TagNamesMustBeUnique = 40_061,
379        /// `40062`: The service resource is rate limited.
380        #[doc(alias = "40062")]
381        ServiceResourceIsBeingRateLimited = 40_062,
382        /// `40066`: No forum tags are available that non-moderators can set.
383        #[doc(alias = "40066")]
384        ThereAreNoTagsAvailableThatCanBeSetByNonModerators = 40_066,
385        /// `40067`: Creating a post in this forum channel requires a tag.
386        #[doc(alias = "40067")]
387        TagRequiredToCreateAForumPostInThisChannel = 40_067,
388        /// `40074`: An entitlement was already granted for this resource.
389        #[doc(alias = "40074")]
390        AnEntitlementHasAlreadyBeenGrantedForThisResource = 40_074,
391        /// `40094`: The interaction already has the maximum number of follow-up messages.
392        #[doc(alias = "40094")]
393        ThisInteractionHasHitTheMaximumNumberOfFollowUpMessages = 40_094,
394        /// `40114`: The invite's target users are already being processed.
395        #[doc(alias = "40114")]
396        InviteTargetUsersAlreadyBeingProcessed = 40_114,
397        /// `40115`: The invite's target users file was not processed yet.
398        #[doc(alias = "40115")]
399        InviteTargetUsersFileNotProcessed = 40_115,
400        /// `40333`: Cloudflare blocked the request; a proper
401        /// [User-Agent](https://docs.discord.com/developers/reference#user-agent) often fixes it.
402        #[doc(alias = "40333")]
403        CloudflareIsBlockingYourRequest = 40_333,
404        /// `50001`: The bot has no access to the resource (e.g. it cannot see the channel).
405        #[doc(alias = "50001")]
406        MissingAccess = 50_001,
407        /// `50002`: The account type is not valid for this action.
408        #[doc(alias = "50002")]
409        InvalidAccountType = 50_002,
410        /// `50003`: The action is not possible in a DM channel.
411        #[doc(alias = "CannotExecuteActionOnDMChannel")]
412        #[doc(alias = "50003")]
413        CannotExecuteActionOnDmChannel = 50_003,
414        /// `50004`: The guild's widget is disabled.
415        #[doc(alias = "50004")]
416        GuildWidgetDisabled = 50_004,
417        /// `50005`: Messages of other users cannot be edited.
418        #[doc(alias = "50005")]
419        CannotEditMessageAuthoredByAnotherUser = 50_005,
420        /// `50006`: A message cannot be empty.
421        #[doc(alias = "50006")]
422        CannotSendAnEmptyMessage = 50_006,
423        /// `50007`: The user does not accept messages from the bot (e.g. DMs are closed).
424        #[doc(alias = "50007")]
425        CannotSendMessagesToThisUser = 50_007,
426        /// `50008`: Messages can only be sent in text-based channels.
427        #[doc(alias = "50008")]
428        CannotSendMessagesInNonTextChannel = 50_008,
429        /// `50009`: The channel's verification level is too high for the user.
430        #[doc(alias = "50009")]
431        ChannelVerificationLevelTooHighForYouToGainAccess = 50_009,
432        /// `50010`: The `OAuth2` application has no bot.
433        #[doc(alias = "50010")]
434        OAuth2ApplicationDoesNotHaveBot = 50_010,
435        /// `50011`: The limit of `OAuth2` applications was reached.
436        #[doc(alias = "50011")]
437        OAuth2ApplicationLimitReached = 50_011,
438        /// `50012`: The `OAuth2` state is invalid.
439        #[doc(alias = "50012")]
440        InvalidOAuth2State = 50_012,
441        /// `50013`: The bot lacks the permissions for this action.
442        #[doc(alias = "50013")]
443        MissingPermissions = 50_013,
444        /// `50014`: The authentication token is invalid.
445        #[doc(alias = "50014")]
446        InvalidToken = 50_014,
447        /// `50015`: The note is too long.
448        #[doc(alias = "50015")]
449        NoteWasTooLong = 50_015,
450        /// `50016`: Bulk deletes take between 2 and 100 messages.
451        #[doc(alias = "50016")]
452        ProvidedTooFewOrTooManyMessagesToDelete = 50_016,
453        /// `50017`: The MFA level is invalid.
454        #[doc(alias = "InvalidMFALevel")]
455        #[doc(alias = "50017")]
456        InvalidMfaLevel = 50_017,
457        /// `50019`: A message can only be pinned in its own channel.
458        #[doc(alias = "50019")]
459        MessageCanOnlyBePinnedInTheChannelItWasSentIn = 50_019,
460        /// `50020`: The invite code is invalid or already taken.
461        #[doc(alias = "50020")]
462        InviteCodeInvalidOrTaken = 50_020,
463        /// `50021`: The action is not possible on a system message.
464        #[doc(alias = "50021")]
465        CannotExecuteActionOnSystemMessage = 50_021,
466        /// `50024`: The action is not possible on this type of channel.
467        #[doc(alias = "50024")]
468        CannotExecuteActionOnThisChannelType = 50_024,
469        /// `50025`: The `OAuth2` access token is invalid.
470        #[doc(alias = "50025")]
471        InvalidOAuth2AccessToken = 50_025,
472        /// `50026`: A required `OAuth2` scope is missing.
473        #[doc(alias = "50026")]
474        MissingRequiredOAuth2Scope = 50_026,
475        /// `50027`: The webhook token is invalid.
476        #[doc(alias = "50027")]
477        InvalidWebhookToken = 50_027,
478        /// `50028`: The role is invalid.
479        #[doc(alias = "50028")]
480        InvalidRole = 50_028,
481        /// `50033`: The recipient(s) are invalid.
482        #[doc(alias = "50033")]
483        InvalidRecipients = 50_033,
484        /// `50034`: A message is too old to be bulk deleted (two weeks at most).
485        #[doc(alias = "50034")]
486        OneOfTheMessagesProvidedWasTooOldForBulkDelete = 50_034,
487        /// `50035`: The form body (JSON or multipart) or the `Content-Type` is invalid; the field
488        /// errors tell which fields.
489        #[doc(alias = "50035")]
490        InvalidFormBodyOrContentType = 50_035,
491        /// `50036`: An invite was accepted to a guild the application's bot is not in.
492        #[doc(alias = "50036")]
493        InviteAcceptedToGuildWithoutTheBotBeingIn = 50_036,
494        /// `50039`: The activity action is invalid.
495        #[doc(alias = "50039")]
496        InvalidActivityAction = 50_039,
497        /// `50041`: The API version is invalid.
498        #[doc(alias = "InvalidAPIVersion")]
499        #[doc(alias = "50041")]
500        InvalidApiVersion = 50_041,
501        /// `50045`: The uploaded file is larger than allowed.
502        #[doc(alias = "50045")]
503        FileUploadedExceedsMaximumSize = 50_045,
504        /// `50046`: The uploaded file is invalid.
505        #[doc(alias = "50046")]
506        InvalidFileUploaded = 50_046,
507        /// `50054`: The gift cannot be redeemed by its own sender.
508        #[doc(alias = "50054")]
509        CannotSelfRedeemThisGift = 50_054,
510        /// `50055`: The guild is invalid.
511        #[doc(alias = "50055")]
512        InvalidGuild = 50_055,
513        /// `50057`: The SKU is invalid.
514        #[doc(alias = "InvalidSKU")]
515        #[doc(alias = "50057")]
516        InvalidSku = 50_057,
517        /// `50067`: The request origin is invalid.
518        #[doc(alias = "50067")]
519        InvalidRequestOrigin = 50_067,
520        /// `50068`: The message type is invalid.
521        #[doc(alias = "50068")]
522        InvalidMessageType = 50_068,
523        /// `50070`: Redeeming the gift requires a payment source.
524        #[doc(alias = "50070")]
525        PaymentSourceRequiredToRedeemGift = 50_070,
526        /// `50073`: System webhooks cannot be modified.
527        #[doc(alias = "50073")]
528        CannotModifyASystemWebhook = 50_073,
529        /// `50074`: Community guilds need this channel, so it cannot be deleted.
530        #[doc(alias = "50074")]
531        CannotDeleteChannelRequiredForCommunityGuilds = 50_074,
532        /// `50080`: The stickers of a message cannot be edited.
533        #[doc(alias = "50080")]
534        CannotEditStickersWithinMessage = 50_080,
535        /// `50081`: The sticker is invalid.
536        #[doc(alias = "50081")]
537        InvalidStickerSent = 50_081,
538        /// `50083`: The thread is archived, so the operation (e.g. editing a message or adding a
539        /// member) is not possible.
540        #[doc(alias = "50083")]
541        InvalidActionOnArchivedThread = 50_083,
542        /// `50084`: The thread notification settings are invalid.
543        #[doc(alias = "50084")]
544        InvalidThreadNotificationSettings = 50_084,
545        /// `50085`: The `before` value is earlier than the thread's creation.
546        #[doc(alias = "50085")]
547        ParameterEarlierThanCreation = 50_085,
548        /// `50086`: Channels of community servers must be text channels.
549        #[doc(alias = "50086")]
550        CommunityServerChannelsMustBeTextChannels = 50_086,
551        /// `50091`: The event's entity type differs from the entity it is being started for.
552        #[doc(alias = "50091")]
553        TheEntityTypeOfTheEventIsDifferentFromTheEntityYouAreTryingToStartTheEventFor = 50_091,
554        /// `50095`: The server is not available in the user's location.
555        #[doc(alias = "50095")]
556        ServerNotAvailableInYourLocation = 50_095,
557        /// `50097`: The server needs monetization enabled for this action.
558        #[doc(alias = "50097")]
559        ServerNeedsMonetizationEnabledToPerformThisAction = 50_097,
560        /// `50101`: The server needs more boosts for this action.
561        #[doc(alias = "50101")]
562        ServerNeedsMoreBoostsToPerformThisAction = 50_101,
563        /// `50109`: The request body is not valid JSON.
564        #[doc(alias = "RequestBodyContainsInvalidJSON")]
565        #[doc(alias = "50109")]
566        RequestBodyContainsInvalidJson = 50_109,
567        /// `50110`: The file is invalid.
568        #[doc(alias = "50110")]
569        ProvidedFileIsInvalid = 50_110,
570        /// `50123`: The file type is invalid.
571        #[doc(alias = "50123")]
572        ProvidedFileTypeIsInvalid = 50_123,
573        /// `50124`: The file is longer than the maximum duration (5.2 seconds).
574        #[doc(alias = "50124")]
575        ProvidedFileDurationExceedsMaximumLength = 50_124,
576        /// `50131`: The owner cannot be a pending member.
577        #[doc(alias = "50131")]
578        OwnerCannotBePendingMember = 50_131,
579        /// `50132`: A bot user cannot become the owner.
580        #[doc(alias = "50132")]
581        OwnershipCannotBeMovedToABotUser = 50_132,
582        /// `50138`: The asset could not be resized below the maximum size (262 144).
583        #[doc(alias = "50138")]
584        FailedToResizeAssetBelowTheMaximumSize = 50_138,
585        /// `50144`: An emoji cannot mix subscription and non-subscription roles.
586        #[doc(alias = "50144")]
587        CannotMixSubscriptionAndNonSubscriptionRolesForAnEmoji = 50_144,
588        /// `50145`: An emoji cannot be converted between premium and normal.
589        #[doc(alias = "50145")]
590        CannotConvertBetweenPremiumEmojiAndNormalEmoji = 50_145,
591        /// `50146`: The uploaded file was not found.
592        #[doc(alias = "50146")]
593        UploadedFileNotFound = 50_146,
594        /// `50151`: The emoji is invalid.
595        #[doc(alias = "50151")]
596        SpecifiedEmojiIsInvalid = 50_151,
597        /// `50159`: A voice message cannot have other content.
598        #[doc(alias = "50159")]
599        VoiceMessagesDoNotSupportAdditionalContent = 50_159,
600        /// `50160`: A voice message needs exactly one audio attachment.
601        #[doc(alias = "50160")]
602        VoiceMessagesMustHaveASingleAudioAttachment = 50_160,
603        /// `50161`: A voice message needs its metadata (duration and waveform).
604        #[doc(alias = "50161")]
605        VoiceMessagesMustHaveSupportingMetadata = 50_161,
606        /// `50162`: Voice messages cannot be edited.
607        #[doc(alias = "50162")]
608        VoiceMessagesCannotBeEdited = 50_162,
609        /// `50163`: The guild subscription integration cannot be deleted.
610        #[doc(alias = "50163")]
611        CannotDeleteGuildSubscriptionIntegration = 50_163,
612        /// `50167`: No voice effect can be sent while the user is server muted, deafened or
613        /// suppressed.
614        #[doc(alias = "50167")]
615        CannotSendVoiceEffectWhenUserIsServerMutedDeafenedOrSuppressed = 50_167,
616        /// `50173`: Voice messages cannot be sent in this channel.
617        #[doc(alias = "50173")]
618        YouCannotSendVoiceMessagesInThisChannel = 50_173,
619        /// `50178`: The user account must be verified first.
620        #[doc(alias = "50178")]
621        TheUserAccountMustFirstBeVerified = 50_178,
622        /// `50192`: The file has no valid duration.
623        #[doc(alias = "50192")]
624        ProvidedFileDoesNotHaveAValidDuration = 50_192,
625        /// `50278`: The user shares no guild with the bot, so it cannot message them.
626        #[doc(alias = "50278")]
627        CannotSendMessagesToThisUserDueToHavingNoMutualGuilds = 50_278,
628        /// `50600`: The bot may not send this sticker.
629        #[doc(alias = "50600")]
630        YouDoNotHavePermissionToSendThisSticker = 50_600,
631        /// `60003`: The operation requires two-factor authentication.
632        #[doc(alias = "60003")]
633        TwoFactorAuthenticationIsRequired = 60_003,
634        /// `80004`: No user with this Discord tag exists.
635        #[doc(alias = "80004")]
636        NoUsersWithDiscordTagExist = 80_004,
637        /// `90001`: The reaction was blocked.
638        #[doc(alias = "90001")]
639        ReactionWasBlocked = 90_001,
640        /// `90002`: The user cannot use super (burst) reactions.
641        #[doc(alias = "90002")]
642        UserCannotUseBurstReactions = 90_002,
643        /// `110000`: The index is not available yet; try again later.
644        #[doc(alias = "110000")]
645        IndexNotYetAvailable = 110_000,
646        /// `110001`: The application is not available yet; try again later.
647        #[doc(alias = "110001")]
648        ApplicationNotYetAvailable = 110_001,
649        /// `130000`: The API resource is overloaded; try again a little later.
650        #[doc(alias = "APIResourceOverloaded")]
651        #[doc(alias = "130000")]
652        ApiResourceOverloaded = 130_000,
653        /// `150006`: The Stage is already open.
654        #[doc(alias = "150006")]
655        TheStageIsAlreadyOpen = 150_006,
656        /// `160002`: Replying requires the permission to read the message history.
657        #[doc(alias = "160002")]
658        CannotReplyWithoutPermissionToReadMessageHistory = 160_002,
659        /// `160004`: This message already has a thread.
660        #[doc(alias = "160004")]
661        ThreadAlreadyCreatedForMessage = 160_004,
662        /// `160005`: The thread is locked.
663        #[doc(alias = "160005")]
664        ThreadLocked = 160_005,
665        /// `160006`: The limit of active threads was reached.
666        #[doc(alias = "160006")]
667        MaximumActiveThreads = 160_006,
668        /// `160007`: The limit of active announcement threads was reached.
669        #[doc(alias = "160007")]
670        MaximumActiveAnnouncementThreads = 160_007,
671        /// `160009`: Referencing a message requires the permission to read the message history.
672        #[doc(alias = "160009")]
673        CannotReferenceAMessageWithoutPermissionToReadMessageHistory = 160_009,
674        /// `160010`: Messages of NSFW channels cannot be referenced here.
675        #[doc(alias = "NSFWChannelMessageReferenceNotAllowed")]
676        #[doc(alias = "160010")]
677        NsfwChannelMessageReferenceNotAllowed = 160_010,
678        /// `160014`: A message whose content the user cannot read cannot be forwarded.
679        #[doc(alias = "160014")]
680        CannotForwardMessageWithUnreadableContent = 160_014,
681        /// `170001`: The uploaded Lottie file is not valid JSON.
682        #[doc(alias = "InvalidJSONForUploadedLottieFile")]
683        #[doc(alias = "170001")]
684        InvalidJsonForUploadedLottieFile = 170_001,
685        /// `170002`: An uploaded Lottie cannot contain raster images (e.g. PNG or JPEG).
686        #[doc(alias = "170002")]
687        UploadedLottiesCannotContainRasterizedImages = 170_002,
688        /// `170003`: The sticker's frame rate is above the maximum.
689        #[doc(alias = "170003")]
690        StickerMaximumFramerateExceeded = 170_003,
691        /// `170004`: The sticker has more than 1000 frames.
692        #[doc(alias = "170004")]
693        StickerFrameCountExceedsMaximumOf1000Frames = 170_004,
694        /// `170005`: The Lottie animation is larger than the maximum dimensions.
695        #[doc(alias = "170005")]
696        LottieAnimationMaximumDimensionsExceeded = 170_005,
697        /// `170006`: The sticker's frame rate is too low or too high.
698        #[doc(alias = "170006")]
699        StickerFramerateIsTooSmallOrTooLarge = 170_006,
700        /// `170007`: The sticker's animation is longer than 5 seconds.
701        #[doc(alias = "170007")]
702        StickerAnimationDurationExceedsMaximumOf5Seconds = 170_007,
703        /// `180000`: A finished event cannot be updated.
704        #[doc(alias = "180000")]
705        CannotUpdateAFinishedEvent = 180_000,
706        /// `180002`: The Stage for the Stage event could not be created.
707        #[doc(alias = "180002")]
708        FailedToCreateStageNeededForStageEvent = 180_002,
709        /// `200000`: `AutoMod` blocked the message.
710        #[doc(alias = "200000")]
711        MessageWasBlockedByAutomaticModeration = 200_000,
712        /// `200001`: `AutoMod` blocked the title.
713        #[doc(alias = "200001")]
714        TitleWasBlockedByAutomaticModeration = 200_001,
715        /// `220001`: A webhook message in a forum channel needs a `thread_name` or a `thread_id`.
716        #[doc(alias = "220001")]
717        WebhooksPostedToForumChannelsMustHaveAThreadNameOrThreadId = 220_001,
718        /// `220002`: A webhook message in a forum channel cannot have both a `thread_name` and a
719        /// `thread_id`.
720        #[doc(alias = "220002")]
721        WebhooksPostedToForumChannelsCannotHaveBothAThreadNameAndThreadId = 220_002,
722        /// `220003`: Webhooks can only create threads in forum channels.
723        #[doc(alias = "220003")]
724        WebhooksCanOnlyCreateThreadsInForumChannels = 220_003,
725        /// `220004`: Webhook services cannot be used in forum channels.
726        #[doc(alias = "220004")]
727        WebhookServicesCannotBeUsedInForumChannels = 220_004,
728        /// `240000`: The harmful links filter blocked the message.
729        #[doc(alias = "240000")]
730        MessageBlockedByHarmfulLinksFilter = 240_000,
731        /// `340015`: The user is limited from joining new servers.
732        #[doc(alias = "340015")]
733        AccessToJoiningNewServersHasBeenLimitedForTheUser = 340_015,
734        /// `350000`: Onboarding cannot be enabled: its requirements are not met.
735        #[doc(alias = "350000")]
736        CannotEnableOnboardingRequirementsAreNotMet = 350_000,
737        /// `350001`: Onboarding cannot be updated while it is below the requirements.
738        #[doc(alias = "350001")]
739        CannotUpdateOnboardingWhileBelowRequirements = 350_001,
740        /// `400001`: File uploads are limited for this guild.
741        #[doc(alias = "400001")]
742        AccessToFileUploadsHasBeenLimitedForThisGuild = 400_001,
743        /// `500000`: The users could not be banned.
744        #[doc(alias = "500000")]
745        FailedToBanUsers = 500_000,
746        /// `520000`: Voting in the poll is blocked.
747        #[doc(alias = "520000")]
748        PollVotingBlocked = 520_000,
749        /// `520001`: The poll has expired.
750        #[doc(alias = "520001")]
751        PollExpired = 520_001,
752        /// `520002`: Polls cannot be created in this type of channel.
753        #[doc(alias = "520002")]
754        InvalidChannelTypeForPollCreation = 520_002,
755        /// `520003`: A poll message cannot be edited.
756        #[doc(alias = "520003")]
757        CannotEditAPollMessage = 520_003,
758        /// `520004`: An emoji that is part of the poll cannot be used.
759        #[doc(alias = "520004")]
760        CannotUseAnEmojiIncludedWithThePoll = 520_004,
761        /// `520006`: Only poll messages can be expired.
762        #[doc(alias = "520006")]
763        CannotExpireANonPollMessage = 520_006,
764        /// `530000`: The application may not use provisional accounts.
765        #[doc(alias = "530000")]
766        ProvisionalAccountsPermissionNotGranted = 530_000,
767        /// `530001`: The ID token (JWT) has expired; get a new one from the identity provider.
768        #[doc(alias = "IdTokenJWTExpired")]
769        #[doc(alias = "530001")]
770        IdTokenJwtExpired = 530_001,
771        /// `530002`: The ID token's issuer does not match the configured one.
772        #[doc(alias = "IdTokenJWTIssuerMismatch")]
773        #[doc(alias = "530002")]
774        IdTokenJwtIssuerMismatch = 530_002,
775        /// `530003`: The ID token's audience does not match the OIDC configuration; fix the
776        /// configuration or use a token issued to the application.
777        #[doc(alias = "IdTokenJWTAudienceMismatch")]
778        #[doc(alias = "530003")]
779        IdTokenJwtAudienceMismatch = 530_003,
780        /// `530004`: The ID token was issued more than a week ago; get a new one from the identity
781        /// provider.
782        #[doc(alias = "IdTokenJWTIssuedTooLongAgo")]
783        #[doc(alias = "530004")]
784        IdTokenJwtIssuedTooLongAgo = 530_004,
785        /// `530006`: No unique username could be generated in time; retrying usually works.
786        #[doc(alias = "530006")]
787        FailedToGenerateUniqueUsername = 530_006,
788        /// `530007`: The client secret is invalid; check it or create a new one.
789        #[doc(alias = "530007")]
790        InvalidClientSecret = 530_007,
791    }
792}