Class methods - #362
Conversation
|
Any chance we could add |
|
It's already on Chat, I think that is enough, since they are both look linked |
|
Alright yeah, that seems good. Just wasn't sure if you added it since it's not in the original list :) |
|
Sorry, just got back to my laptop and saw the huge screenshot. But I'll leave it that way 😎 |
|
I think we should leave the static |
|
@jh0ker Just do them. They aren't confusing. |
|
@KamranMackey The problem is that you need an instance of the class before you could use them, because only the instance can have a reference to the So it couldn't be a static method after all. |
|
@jh0ker Oh, okay. Just leave them then. |
|
|
||
| def create_references(self, d): | ||
| """ | ||
| Recursively reates a reference to this Bot instance in the dict and all contained dicts and |
There was a problem hiding this comment.
(edited) Recursively iterates? creates?
|
I left some comments on the diff. |
…ake the additional parameter bot
|
If I'm not going to use any of those methods, is it safe to pass in |
|
@whipermr5 Yes, that is safe. |

PR to keep track of development.
The idea of this PR is to add shortcut-methods to the classes defined by the API.
Example:
To reply to a message with another text message, you would have to do
Now, you can also do
which is nothing more than a shortcut for
bot.sendMessage(update.message.chat_id, *args, **kwargs).List of methods planned:
Messagereply_textforwardreply_photoreply_audioreply_documentreply_stickerreply_videoreply_voicereply_locationreply_venuereply_contactChatsend_actionkick_memberleaveunban_memberget(static?)get_administratorsget_members_countget_memberUserget_profile_photosFileget(static?)InlineQueryanswerCallbackQueryanswer