mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-12 10:11:52 +00:00
Dev 3.x api 4.8 (#317)
* AIOG-T-20 Bot API 4.8 * AIOG-T-20 Update aliases * AIOG-T-20 Add parse mode passing in sendPoll method * AIOG-T-20 Small changes in docs * AIOG-T-20 Revert overriding remove keyboard default value and add tests * AIOG-T-20 Bot API 4.8
This commit is contained in:
parent
15bcc0ba9f
commit
6be0b36305
104 changed files with 312 additions and 175 deletions
|
|
@ -18,7 +18,7 @@ Full list of methods can be found in section "[Methods](methods/index.md)"
|
|||
All types is also wrapped with [pydantic](https://pydantic-docs.helpmanual.io/) and placed in `aiogram.api.types` package.
|
||||
In this place makes some more differences with official documentations:
|
||||
|
||||
- name `from` was renamed to `from_user` in due to `from` is an keyword in python
|
||||
- name `from` was renamed to `from_user` in due to `from` is an [keyword in python](https://docs.python.org/3/reference/lexical_analysis.html#keywords)
|
||||
- timestamps has `datetime.datetime` type instead of `int`
|
||||
- InputFile is used for sending files and is not use `pydantic.BaseModel` as base class
|
||||
|
||||
|
|
@ -37,3 +37,23 @@ Constructor specification:
|
|||
| `parse_mode` | `#!python3 Optional[str]` | Default parse mode. If specified it will be propagated into the API methods at runtime. |
|
||||
|
||||
This class has aliases for all API methods and named in `lower_camel_case`. For example `sendMessage` named `send_message` and has the same specification with all class-based methods.
|
||||
|
||||
Here you can pass default parse mode (argument `parse_mode`) and this value will be used in all API methods automatically.
|
||||
|
||||
|
||||
## Usage
|
||||
```python3
|
||||
import asyncio
|
||||
from os import getenv
|
||||
|
||||
from aiogram import Bot
|
||||
|
||||
|
||||
async def main():
|
||||
async with Bot(token=getenv("TELEGRAM_TOKEN"), parse_mode="HTML").context() as bot:
|
||||
await bot.send_message(61043901, "<b>Hello, World!</b>")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(main())
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue