Починить CallbackQuery
Код сильно расходится с документацией Tg Bot API к CallbackQuery. Вот код:
class CallbackQuery(BaseModel):
data: str
message: Message | None = Field(description='New incoming message of any kind - text, photo, sticker, etc.')
from_: User | None = Field(default=None, alias='from')
chat_instance: str | None = None
Не хватает полей.
Не хватает проверок:
If the button that originated the query was attached to a message sent by the bot, the field message will be present.If the button was attached to a message sent via the bot (in inline mode), the field inline_message_id will be present.- Exactly one of the fields data or game_short_name will be present.
Хорошо бы во всех полях скопировать description из оф.документации.
Edited by Евгений Евсеев