Рейтлимит на изменение баннера discord developer portal

Обновлено: 07.07.2024

There appears to be an entirely undocumented (and unreported in the API) rate limit of 2 channel renames/10 minutes. The first two name changes go through fine, with the expected/documented rate limit headers indicating that I can use the endpoint 5 times per 15 seconds:

However, the third request results in a 429 response with the following headers and content

No information is provided in the returned message about what I have done to trigger this rate limit, I am simply forced to assume that it's the 2 renames/10 minutes limit I've seen mentioned in unofficial sources online. This rate limit should be both documented somewhere (ideally under both Modify Channel and Rate Limits, and it should be reported to the API clients so they can avoid it without having to hard-code a rate limit, which the docs explicitly state developers should not do.

The text was updated successfully, but these errors were encountered:

AEnterprise commented Aug 13, 2020

spiralw commented Aug 13, 2020

Could this be documented?

ahnolds commented Aug 13, 2020

Just to put this in writing here for documentation so it's not just sitting in a discord thread:

I have a bot that has been temporarily blocked three weeks running at our busiest time, and the only explanation we've come up with is that we are getting too many of these 429s. I really don't think that we are having 16/second for ten minutes, but since I've only added response code logging now, I have no way to be sure of that until we get blocked again. We are using discord.js, which does implement proper handling of rate limits, 429 responses, backoff times, etc as far as I am aware.

  1. The sublimit information should be shown in the headers, even if it has to be done with different headers ( x-ratesublimit-remaining or something). I recognize this is the discord-api-docs repo and probably not the place to submit this as an issue, so if someone can point me to the proper place to submit API bugs/issues/feature requests, I'd be delighted to submit this part there.
  2. The sublimit information should be documented in the actual Discord API documentation, not just in a post on the Discord Developers guild (that is, as established above, not entirely correct anyway).

night commented Aug 16, 2020

Individual rate limits are generally not documented on our API docs, and that is for good reason: they can change at any time. We make no guarantees that rate limits will remain the same, and they may end up being variable per application at some point in the future. We understand some 429 errors are to be encountered, which is why we offer flexibility by allowing applications to still encounter them before being temporarily blocked from the API. I would recommend you start logging and/or tracking metrics on 401, 403, and 429 status codes to discover the abuse pattern your bot is encountering, and then fixing that behavior to not be abusive.

spiralw commented Aug 16, 2020

@night I think what we're asking for here, is documentation on sub limits in general, not of a specific sub limit - essentially what was said in the screenshot a couple replies above of your message in discord-developers

ahnolds commented Aug 16, 2020


Если вы ограничены в скорости действия, это означает, что вы пробовали это действие много раз за короткий промежуток времени, поэтому вам нужно будет дождаться истечения этого таймера ограничения скорости, прежде чем разрешат повторить попытку. К сожалению, нет точного определения для периода тайм-аута. Как правило, ошибка не длится большой период времени, но при нарушении работы на платформе, ошибка может затянуться, и мешать стандартному варианту выполнения работы в программе Дискорд. Например, при прохождении процедуры регистрации, пользователи могут постараться ввести предложенный код несколько раз, и поэтому программа выдаст ошибку. Сложность может возникнуть и по идентичной причине.


Для решения проблемы можно воспользоваться универсальными советами. Пользователи могут не производить действий, поскольку ошибка может исчезнуть без манипуляций со стороны пользователя. Ошибка возникает у начинающих пользователей, или опытных юзеров в программе Дискорд.

Как решить проблему?

Как правило, ошибка варианта «You are being rate limited» пропадает по истечению конкретного момента времени. При этом, нельзя точно определить время, когда ошибка не дает работать на платформе. Решить проблему не получится, следует подождать, и программа начнет работать, после чего и пользователь сможет производить необходимые действия.


Если не удалось дождаться, когда ошибка решиться, следует попробовать перезапустить программу. Для этого, следует выйти из приложения с персонального компьютера, или мобильного устройства, Затем войти снова в программу. Как правило, ошибка должна пропасть, и тогда пользователь сможет продолжить работу.

Если не помогло, то следует принимать кардинальные действия, и переходить к перезапуску устройства. Для этого, следует выключить используемое устройство, смартфон или персональный компьютер. После выключения устройства, программа должна обновиться, и ошибка не будет выявляться. После включения устройства, можно войти в мессенджер Дискорд, и проверить исчезла ли ошибка, и можно ли пользователю производить необходимые действия.

Следует отметить, что выданная ошибка не влияет на стандартный вариант работы программы, и исправление ситуации поможет пользователю продолжать использовать программу Дискорд.


4 2 8 2


[SOLVED] [READ EDITS]

It fixes itself (usually only a couple hours but times vary)

What triggered it for me was spamming reactions on a discord message

Still works in mobile app but pc and web stop (someone else has had the same experience as me)


Edit: Workaround is to wait about an hour. Or use VPN (and/or another device) since it’s likely a temporary IP block.

same for me rn . I changed my public IP and its OK !

i know it has been 2 months but

I was rapidly removing reactions on a message

thank you for helping me realize this. i was messing around and spamming emotes 20 times a second, and i was wondering why discord was buggy after a while.

Same, I now realised it was because I used an auto clicker for reactions. LOL!

Helpful

i was autoclicking reactions and i refreshed my discord using ctrl + r. my app was working every time i go on a dm or a server, it would say "Messages failed to load" so i right clicked the arrow thing and pressed quit discord and tried opening it again. I got the update failed loop and i decided to restart my computer and nothing worked. I deleted the app and tried to install and got that same message. not even on the website would work and on mobile. what do i do? can someone please help me please

that happened to me too. I was removeing reactions rapidly and discord stopped working properly. I closed and tried to open discord and it said "update failed" and I watched some youtube videos to open discord but it made it worse.

Helpful

Copy raw contents

Copy raw contents

Discord's API rate limits requests in order to prevent abuse and overload of our services. Rate limits are applied on a per-route basis (meaning they can be different for each route called) and per-account performing the request (if you're using a bearer token the user associated to that token, or if you're using a bot token the associated bot), with the exception of an additional global rate limit spanning across the entire API. Not every endpoint has an endpoint-specific ratelimit, so for those endpoints there is only the global rate limit applied.

Because we may change rate limits at any time and rate limits can be different per application, rate limits should not be hard coded into your bot/application. In order to properly support our dynamic rate limits, your bot/application should parse for our rate limits in response headers and locally prevent exceeding the limits as they change.

warn Routes for controlling emojis do not follow the normal rate limit conventions. These routes are specifically limited on a per-guild basis to prevent abuse. This means that the quota returned by our APIs may be inaccurate, and you may encounter 429s.

Rate Limit Header Examples

Exceeding A Rate Limit

Rate Limit Response Structure

Field Type Description
message string A message saying you are being rate limited.
retry_after float The number of seconds to wait before submitting another request.
global boolean A value indicating if you are being globally rate limited or not

Note that the normal rate-limiting headers will be sent in this response. The rate-limiting response will look something like the following:

Example Rate Limit Response

Example Global Rate Limit Response

Global Rate Limit

All bots can make up to 50 requests per second to our API. This is independent of any individual rate limit on a route. If your bot gets big enough, based on its functionality, it may be impossible to stay below 50 requests per second during normal operations.

Global rate limit issues generally show up as repeatedly getting banned from the Discord API when your bot starts (see below). If your bot gets temporarily CloudFlare banned from the Discord API every once in a while, it is most likely not a global rate limit issue. You probably had a spike of errors that was not properly handled and hit our error threshold.

Invalid Request Limit aka CloudFlare bans

All applications should make reasonable attempts to avoid making invalid requests. For example:

  • 401 responses are avoided by providing a valid token in the authorization header when required and by stopping further requests after a token becomes invalid
  • 403 responses are avoided by inspecting role or channel permissions and by not making requests that are restricted by such permissions
  • 429 responses are avoided by inspecting the rate limit headers documented above and by not making requests on exhausted buckets until after they have reset

Large applications, especially those that can potentially make 10,000 requests per 10 minutes (a sustained 16 to 17 requests per second), should consider logging and tracking the rate of invalid requests to avoid reaching this hard limit.

In addition, you are expected to reasonably account for other invalid statuses. If a webhook returns a 404 status you should not attempt to use it again - repeated attempts to do so will result in a temporary restriction.

This page explains how Discord rate limits are constantly varying, and in order to prevent your bot from exceeding these rate limits, they highly suggest that your bot/application should parse for our rate limits in response headers and locally prevent exceeding of the limits as they change.

Problem

With abuse of this in multiple different text channels it will end up by globally rate limiting your bot preventing it from functioning properly. Now, there are multiple obvious solutions to this, such as:

  • Blacklisting the users spamming commands.
  • Leaving the guild in question.
  • Hard code how many commands should your bot respond to within five seconds.

However, none of these are genuine solutions to the problem at hand, not to mention that Discord themselves explicitly stated that rate limits should not be hard coded into your bot/application.

Solution

There are two solutions that I see:

  1. Allow users to toggle an option which discards all messages in the rate limit buckets.
  2. Allow users to access all rate limit information to implement in their bot.

The first solution would be more of a cover up than an actual fix. The commands would still be executed but the messages sent inside of them would never go through.

The second solution allows for a much better handling of rate limits, and could be done with either events or methods. An example of the method implementation could be as following:

The return value could be something along the lines of Array<RateLimit> containing the following information as presented in the Discord documentation:

Читайте также: