- Notifications
You must be signed in to change notification settings - Fork5.7k
Description
What kind of feature are you missing? Where do you notice a shortcoming of PTB?
Intest_official
we currently allow convenience input types only forsend_*
methods:
python-telegram-bot/tests/test_official/arg_type_checker.py
Lines 174 to 178 in1511237
# 2) HANDLING OTHER TYPES: | |
# Special case for send_* methods where we accept more types than the official API: | |
elifptb_param.nameinPTCE.ADDITIONAL_TYPESandobj.__name__.startswith("send"): | |
log("Checking that `%s` has an additional argument!\n",ptb_param.name) | |
mapped_type=mapped_type|PTCE.ADDITIONAL_TYPES[ptb_param.name] |
python-telegram-bot/tests/test_official/exceptions.py
Lines 39 to 48 in1511237
ADDITIONAL_TYPES= { | |
"photo":PhotoSize, | |
"video":Video, | |
"video_note":VideoNote, | |
"audio":Audio, | |
"document":Document, | |
"animation":Animation, | |
"voice":Voice, | |
"sticker":Sticker, | |
} |
Removing theobj.__name__.startswith("send")
reveals that there are a few more parameters that could use convenience types.
Describe the solution you'd like
- Set up the "additional types" excetpions in test_official such that they can either be defined globally or per method, remove the
obj.__name__
check - add support for convenience types where possible
Describe alternatives you've considered
No response
Additional context
No response