Поправлена аннотация photo в __init__ ChangeInfo
This commit is contained in:
parent
9c0567d858
commit
b1f8fb91cb
@ -1,5 +1,7 @@
|
|||||||
from typing import Any, Dict, List, TYPE_CHECKING, Optional
|
from typing import Any, Dict, List, TYPE_CHECKING, Optional
|
||||||
|
|
||||||
|
from ..types.attachments.image import PhotoAttachmentRequestPayload
|
||||||
|
|
||||||
from ..types.users import User
|
from ..types.users import User
|
||||||
from ..types.command import BotCommand
|
from ..types.command import BotCommand
|
||||||
|
|
||||||
@ -23,7 +25,7 @@ class ChangeInfo(BaseConnection):
|
|||||||
name (str, optional): Новое имя бота
|
name (str, optional): Новое имя бота
|
||||||
description (str, optional): Новое описание
|
description (str, optional): Новое описание
|
||||||
commands (List[BotCommand], optional): Список команд
|
commands (List[BotCommand], optional): Список команд
|
||||||
photo (Dict[str, Any], optional): Данные фото
|
photo (PhotoAttachmentRequestPayload, optional): Данные фото
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
@ -32,7 +34,7 @@ class ChangeInfo(BaseConnection):
|
|||||||
name: Optional[str] = None,
|
name: Optional[str] = None,
|
||||||
description: Optional[str] = None,
|
description: Optional[str] = None,
|
||||||
commands: Optional[List[BotCommand]] = None,
|
commands: Optional[List[BotCommand]] = None,
|
||||||
photo: Optional[Dict[str, Any]] = None
|
photo: Optional[PhotoAttachmentRequestPayload] = None
|
||||||
):
|
):
|
||||||
self.bot = bot
|
self.bot = bot
|
||||||
self.name = name
|
self.name = name
|
||||||
@ -60,7 +62,7 @@ class ChangeInfo(BaseConnection):
|
|||||||
if self.commands:
|
if self.commands:
|
||||||
json['commands'] = [command.model_dump() for command in self.commands]
|
json['commands'] = [command.model_dump() for command in self.commands]
|
||||||
if self.photo:
|
if self.photo:
|
||||||
json['photo'] = self.photo
|
json['photo'] = self.photo.model_dump()
|
||||||
|
|
||||||
return await super().request(
|
return await super().request(
|
||||||
method=HTTPMethod.PATCH,
|
method=HTTPMethod.PATCH,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user