-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Description
What kind of feature are you missing? Where do you notice a shortcoming of PTB?
Have a dict representation of TelegramObject without having the attributes also converted to dicts
Describe the solution you'd like
Make TO.to_dict accept a parameter recursion that specifies up to which level attributes should be converted to dict. Logic:
recursion=None(default) recurs infinitely0gives a dict representation but doesn't convert attributes to dicts1converts attributes, but not attributes of attributes- etc
Describe alternatives you've considered
Alternatively, a simple recursion=True/False could be a step in the same direction with, having the same effect as None/0 described above
Additional context
Would e.g. allow to do ptbcontrib.send_by_kwargs(bot, chat_id=chat_id, **message.to_dict(recursion=0). See also python-telegram-bot/ptbcontrib#39 which was implemented only partly
Just a wild idea so far and of no major importance to me :)