mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-12 10:11:52 +00:00
Rewrite Bot classes. Add moooooore pydocs.
This commit is contained in:
parent
a6e90655bc
commit
ffbb89100c
5 changed files with 2030 additions and 967 deletions
|
|
@ -1,3 +1,5 @@
|
|||
from aiogram.utils import json
|
||||
|
||||
DEFAULT_FILTER = ['self']
|
||||
|
||||
|
||||
|
|
@ -8,3 +10,11 @@ def generate_payload(exclude=None, **kwargs):
|
|||
key not in exclude + DEFAULT_FILTER
|
||||
and value
|
||||
and not key.startswith('_')}
|
||||
|
||||
|
||||
def prepare_arg(value):
|
||||
if isinstance(value, (list, dict)):
|
||||
return json.dumps(value)
|
||||
elif hasattr(value, 'to_json'):
|
||||
return json.dumps(value.to_json())
|
||||
return value
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue