-
Notifications
You must be signed in to change notification settings - Fork 5.7k
[Discussion] kwargs for input-only classes (like InputMedia*
)
#2607
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
If I understand this correctly, you mean these classes aren't used by Telegram and only by Users to make a request. So I dont get what you mean with "minor risk of TG sending them back to us" |
The important part here is "at some point", meaning after a future bot api release. E.g. TG might decide to to have |
Ah I see. Thats a risk I would say is worth to take. I would drop kwargs and include the api kwargs parameter like we do with requests. |
My comment on this in dev chat seems to have gone unnoticed: What would |
... right, weird comment. My stance is the same, I would take the risk that telegram might screw it up and rather have a better user experience and not swallowing errors. |
Breakfast idea: instead of blindly doing |
hm. so you want to fail then in the function if a keyword is unexpected, and you want to keep the kwargs parameter? |
No, I want to remove |
ah well that sounds like a pretty good approach actually. |
Closed by #3233 |
There are some TG classes that are used for input only, but where we still accept kwargs - which is mainly intended for the classes that we de-json TG data. This sometimes leads to confusion like here https://t.me/pythontelegrambotgroup/503803 b/c additional arguments are silently ignored.
This is somehow the same problem as in #1924.
I see three possible ways to proceed with this:
**kwargs
and do nothing**kwargs
for classes that are exclusively used for input. This has a minor risk of TG actually sending them back to us at some point …**kwargs
but issue warnings when receiving unexpected argumentsI think we should at least try to apply any of the solutions consistently - not sure if that's currently the case.
The text was updated successfully, but these errors were encountered: