Add Two Constants Related to Local Bot API Servers (#3296)

This commit is contained in:
Harshil 2022-10-17 23:28:28 +05:30 committed by GitHub
parent 1c20ff3fb9
commit eb818da93f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View file

@ -66,6 +66,7 @@ __all__ = [
"UpdateType", "UpdateType",
] ]
import sys
from typing import List, NamedTuple from typing import List, NamedTuple
from telegram._utils.enum import IntEnum, StringEnum from telegram._utils.enum import IntEnum, StringEnum
@ -334,6 +335,13 @@ class FileSizeLimit(IntEnum):
""":obj:`int`: Bots can download files of up to 20MB in size.""" """:obj:`int`: Bots can download files of up to 20MB in size."""
FILESIZE_UPLOAD = int(50e6) # (50MB) FILESIZE_UPLOAD = int(50e6) # (50MB)
""":obj:`int`: Bots can upload non-photo files of up to 50MB in size.""" """:obj:`int`: Bots can upload non-photo files of up to 50MB in size."""
FILESIZE_UPLOAD_LOCAL_MODE = int(2e9) # (2000MB)
""":obj:`int`: Bots can upload non-photo files of up to 2000MB in size when using a local bot
API server.
"""
FILESIZE_DOWNLOAD_LOCAL_MODE = sys.maxsize
""":obj:`int`: Bots can download files without a size limit when using a local bot API server.
"""
PHOTOSIZE_UPLOAD = int(10e6) # (10MB) PHOTOSIZE_UPLOAD = int(10e6) # (10MB)
""":obj:`int`: Bots can upload photo files of up to 10MB in size.""" """:obj:`int`: Bots can upload photo files of up to 10MB in size."""

View file

@ -49,6 +49,7 @@ class TestConstants:
not key.startswith("_") not key.startswith("_")
# exclude imported stuff # exclude imported stuff
and getattr(member, "__module__", "telegram.constants") == "telegram.constants" and getattr(member, "__module__", "telegram.constants") == "telegram.constants"
and key != "sys"
) )
} }
actual = set(constants.__all__) actual = set(constants.__all__)