role.setColor() only works sometimes #672
-
Hello, so I've been maintaining some server bots I had created for my friends' and mine's personal discord channel. The issue I'm running into is that the bots are programmed to change their role colors depending on what data comes in from an API, and for some reason the role.setColor() function just decides to stop working. My assumption is that there is a limit as to how many times a role color can be changed programmatically, but I cant find any confirmation anywhere. Can anyone confirm/deny this theory for me? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Role edits (as almost all API calls) are subject to API rate limiting. Discord.js handles rate limits for you, however, we strictly discourage spamming the API. Changing the role color on a short interval is the prime example (dubbed "rainbow roles") for API abuse and something you should avoid doing. |
Beta Was this translation helpful? Give feedback.
Role edits (as almost all API calls) are subject to API rate limiting. Discord.js handles rate limits for you, however, we strictly discourage spamming the API.
Changing the role color on a short interval is the prime example (dubbed "rainbow roles") for API abuse and something you should avoid doing.