'Discord API request limit bypass

I'm sending requests to the Discord API to get the users servername on given server by userID. It must be executed for every message being processed, because user can change server name between messages. But there are too many requests and they go beyond the 50 per second allowed by the developers.

<class 'KeyError'> 
{'global': False, 'message': 'The resource is being rate limited.', 'retry_after': 15.986}

Storing a dictionary of "user_id": "servername" doesn't seem like a good option as it will take up too much space in the database, file or ram.

Therefore I'm looking for a bypass for this limitation, cause it is not possible to change the code.

It has to be an automatic free way that will not require constant intervention and data changes by hand.

I tried some libraries (fake-useragent , requests-ip-rotator) but they didn't help. Constantly scaping public proxies also is not an option, it takes too much time to collect and check them.

I would be grateful for possible. Thanks.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source