Skip to content

Missing retry_after parameter in rate limits #2544

@Luc1412

Description

@Luc1412

Summary

Context:
I got a bot that broadcast messages (Game updates) to multiple thousand servers (who subscribed to it). I try to do this task as fast as possible. Normally I post it with multiple threads and discord.py auto handles the rate limits for me.

It seems that since 01/26 it sometimes happens that the retry_after parameter isn't included?
This only happens after approx. 4min of posting at max speed.

Reproduction Steps

I'm not sure. I think sending messages at max speed.

Expected Results

The API auto handles the missing retry_after parameter and might do a default timeout.

Actual Results

An error gets thrown:

    message = await channel.fetch_message(int(message_data['message_id']))
  File "/opt/EasyFortniteStats/bot_venv/lib/python3.8/site-packages/discord/abc.py", line 921, in fetch_message
    data = await self._state.http.get_message(channel.id, id)
  File "/opt/EasyFortniteStats/bot_venv/lib/python3.8/site-packages/discord/http.py", line 189, in request
    retry_after = data['retry_after'] / 1000.0
KeyError: 'retry_after'
NoneType: None

Checklist

  • I have searched the open issues for duplicates.
  • I have shown the entire traceback, if possible.
  • I have removed my token from display, if visible.

System Information

Metadata

Metadata

Assignees

No one assigned

    Labels

    no reproCannot be reproduced.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions