Skip to content

Treat 420 FLOOD_PREMIUM_WAIT_X #123

@FolcloreX

Description

@FolcloreX

Checklist

  • I believe the idea is awesome and would benefit the framework
  • I have searched in the issue tracker for similar requests, including closed ones

Description

When I'm uploading a file I get this error every time. I can't catch it or treat it. It's two messages

  1. Telegram says: [420 FLOOD_PREMIUM_WAIT_X] (caused by "upload.SaveBigFilePart") Pyrogram 2.1.37 thinks: A wait of 14 seconds is required

  2. Channel_Filter] Waiting for 9 seconds before continuing (required by "upload.GetFile")

I tried as the documentation says but no success:

from pyrogram.errors import FloodWait

try:
    await self.send_video(
            chat_id=chat_id,
            video=file_path,
        )

except FloodWait as e:
    print(f"Rate limit hit. Waiting for {e.value} seconds...")
    await asyncio.sleep(e.value)

But it seems that the error is treated internally in the client.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions