Skip to content

Commit 87e938b

Browse files
DamegoFayeDelpre-commit-ci[bot]
authored
feat: Add new json error codes (#954)
* feat: Add new json error codes * ci: correct from checks. Co-authored-by: DeltaX <33706469+DeltaXWizard@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 56df1a8 commit 87e938b

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

interactions/api/error.py

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,20 +149,25 @@ def lookup(code: int) -> str:
149149
10060: "Unknown Sticker.",
150150
10062: "Unknown Interaction.",
151151
10063: "Unknown Application Command.",
152+
10065: "Unknown voice state",
152153
10066: "Unknown Application Command permissions.",
153154
10067: "Unknown Stage.",
154155
10068: "Unknown Guild Member Verification Form.",
155156
10069: "Unknown Guild Welcome Screen.",
156157
10070: "Unknown Scheduled Event.",
157158
10071: "Unknown Scheduled Event user.",
159+
10087: "Unknown Tag",
158160
20001: "Bots cannot use this endpoint.",
159161
20002: "Only bots can use this endpoint.",
160162
20009: "Explicit content cannot be sent to the desired recipient(s).",
161163
20012: "You are not authorized to perform this action on this application",
162164
20016: "This action cannot be performed due to slow-mode rate limit.",
163165
20018: "Only the owner of this account can perform this action",
164166
20022: "This message cannot be edited due to announcement rate limits.",
167+
20024: "Under minimum age",
165168
20028: "The channel you are writing has hit the write rate limit",
169+
20029: "The write action you are performing on the server has hit the write "
170+
"rate limit",
166171
20031: "Your Stage topic, server name, server description, "
167172
"or channel names contain words that are not allowed",
168173
20035: "Guild premium subscription level too low",
@@ -181,25 +186,33 @@ def lookup(code: int) -> str:
181186
30019: "Maximum number of server members reached",
182187
30030: "Maximum number of server categories has been reached",
183188
30031: "Guild already has a template",
189+
30032: "Maximum number of application commands reached",
184190
30033: "Max number of thread participants has been reached (1000)",
191+
30034: "Max number of daily application command creates has been reached " "(200)",
185192
30035: "Maximum number of bans for non-guild members have been exceeded",
186193
30037: "Maximum number of bans fetches has been reached",
187194
30038: "Maximum number of uncompleted guild scheduled events reached (100)",
188195
30039: "Maximum number of stickers reached",
189196
30040: "Maximum number of prune requests has been reached. Try again later",
190197
30042: "Maximum number of guild widget settings updates has been reached. Try again later",
191198
30046: "Maximum number of edits to messages older than 1 hour reached. Try again later",
199+
30047: "Maximum number of pinned threads in a forum channel has been reached",
200+
30048: "Maximum number of tags in a forum channel has been reached",
201+
30052: "Bitrate is too high for channel of this type",
192202
40001: "Unauthorized. Provide a valid token and try again",
193203
40002: "You need to verify your account in order to perform this action",
194204
40003: "You are opening direct messages too fast",
195205
40004: "Send messages has been temporarily disabled",
196206
40005: "Request entity too large. Try sending something smaller in size",
197207
40006: "This feature has been temporarily disabled server-side",
198208
40007: "The user is banned from this guild",
209+
40012: "Connection has been revoked",
199210
40032: "Target user is not connected to voice",
200211
40033: "This message has already been crossposted",
201212
40041: "An application command with that name already exists",
213+
40043: "Application interaction failed to send",
202214
40060: "Interaction has already been acknowledged",
215+
40061: "Tag names must be unique",
203216
50001: "Missing access",
204217
50002: "Invalid account type",
205218
50003: "Cannot execute action on a DM channel",
@@ -217,6 +230,7 @@ def lookup(code: int) -> str:
217230
50015: "Note was too long",
218231
50016: "Provided too few or too many messages to delete. "
219232
"Must provide at least 2 and fewer than 100 messages to delete",
233+
50017: "Invalid MFA Level",
220234
50019: "A message can only be pinned to the channel it was sent in",
221235
50020: "Invite code was either invalid or taken",
222236
50021: "Cannot execute action on a system message",
@@ -238,19 +252,25 @@ def lookup(code: int) -> str:
238252
50068: "Invalid message type",
239253
50070: "Payment source required to redeem gift",
240254
50074: "Cannot delete a channel required for Community guilds",
255+
50080: "Cannot edit stickers within a message",
241256
50081: "Invalid sticker sent",
242-
50083: "Tried to perform an operation on an archived thread, such as editing a "
243-
"message or adding a user to the thread",
257+
50083: "Tried to perform an operation on an archived thread, such as editing "
258+
"a message or adding a user to the thread",
244259
50084: "Invalid thread notification settings",
245260
50085: "'before' value is earlier than the thread creation date",
246261
50086: "Community server channels must be text channels",
247262
50095: "This server is not available in your location",
248263
50097: "This server needs monetization enabled in order to perform this action",
249264
50101: "This server needs more boosts to perform this action",
250265
50109: "The request body contains invalid JSON.",
266+
50132: "Ownership cannot be transferred to a bot user",
267+
50138: "Failed to resize asset below the maximum size: 262144",
268+
50146: "Uploaded file not found.",
269+
50600: "You do not have permission to send this sticker.",
251270
60003: "Two factor is required for this operation",
252271
80004: "No users with DiscordTag exist",
253272
90001: "Reaction was blocked",
273+
110001: "Application not yet available. Try again later",
254274
130000: "API resource is currently overloaded. Try again a little later",
255275
150006: "The Stage is already open",
256276
160002: "Cannot reply without permission to read message history",
@@ -267,6 +287,9 @@ def lookup(code: int) -> str:
267287
170007: "Sticker animation duration exceeds maximum of 5 seconds",
268288
180000: "Cannot update a finished event",
269289
180002: "Failed to create stage needed for stage event",
290+
200000: "Message was blocked by automatic moderation",
291+
200001: "Title was blocked by automatic moderation",
292+
220003: "Webhooks can only create threads in forum channels",
270293
}.get(code, f"Unknown error: {code}")
271294

272295
def __init__(self, code: int = 0, message: str = None, severity: int = 0, **kwargs):

0 commit comments

Comments
 (0)