mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2024-11-21 22:56:38 +01:00
Updated Bot API Forward Compatibility (markdown)
parent
bcc7ee283a
commit
db19f314ef
1 changed files with 5 additions and 1 deletions
|
@ -82,7 +82,11 @@ However, PTB provides the method `Bot.do_api_request` that allows you to make an
|
|||
For example, imagine that Telegram adds a new method called `get_message` allowing your bot to fetch information about a specific method. Then calling that method via `await bot.get_message(chat_id=123, message_id=456)` is possible only after PTB was updated. However, you can already do
|
||||
|
||||
```python
|
||||
await bot.do_api_request(endpoint="get_message", api_kwargs={"message_id": 456, "chat_id": 123}, return_type=Message)
|
||||
await bot.do_api_request(
|
||||
endpoint="get_message",
|
||||
api_kwargs={"message_id": 456, "chat_id": 123},
|
||||
return_type=Message
|
||||
)
|
||||
```
|
||||
|
||||
and PTB will call the corresponding Bot API method with the given parameters and return the result as a `Message` object.
|
||||
|
|
Loading…
Reference in a new issue