mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +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
|
|
@ -105,19 +105,19 @@ def prepare_media_file(data: Dict[str, Any], files: Dict[str, InputFile]) -> Non
|
|||
data["media"]["media"] = f"attach://{tag}"
|
||||
|
||||
|
||||
def prepare_parse_mode(root: Any) -> None:
|
||||
def prepare_parse_mode(root: Any, parse_mode_property: str = "parse_mode") -> None:
|
||||
if isinstance(root, list):
|
||||
for item in root:
|
||||
prepare_parse_mode(item)
|
||||
prepare_parse_mode(item, parse_mode_property=parse_mode_property)
|
||||
return
|
||||
|
||||
if root.get("parse_mode"):
|
||||
if root.get(parse_mode_property):
|
||||
return
|
||||
|
||||
from ..client.bot import Bot
|
||||
|
||||
bot = Bot.get_current(no_error=True)
|
||||
if bot and bot.parse_mode:
|
||||
root["parse_mode"] = bot.parse_mode
|
||||
root[parse_mode_property] = bot.parse_mode
|
||||
return
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue