mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2024-12-22 22:45:09 +01:00
Add Two Constants Related to Local Bot API Servers (#3296)
This commit is contained in:
parent
1c20ff3fb9
commit
eb818da93f
2 changed files with 9 additions and 0 deletions
|
@ -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."""
|
||||||
|
|
||||||
|
|
|
@ -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__)
|
||||||
|
|
Loading…
Reference in a new issue