Skip to content

Commit

Permalink
feat: data saturation for Forward entity
Browse files Browse the repository at this point in the history
  • Loading branch information
kutuzov13 committed Mar 21, 2024
1 parent e98a00d commit 5fab4bb
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions pybotx/models/message/forward.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from dataclasses import dataclass
from datetime import datetime
from typing import Literal
from uuid import UUID

Expand All @@ -11,12 +12,16 @@ class Forward:
chat_id: UUID
author_id: UUID
sync_id: UUID
chat_name: str
inserted_at: datetime


class BotAPIForwardData(VerifiedPayloadBaseModel):
group_chat_id: UUID
sender_huid: UUID
source_sync_id: UUID
source_chat_name: str
source_inserted_at: datetime


class BotAPIForward(VerifiedPayloadBaseModel):
Expand Down
2 changes: 2 additions & 0 deletions pybotx/models/message/incoming_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ def convert_bot_api_entity_to_domain(api_entity: BotAPIEntity) -> Entity:
chat_id=api_entity.data.group_chat_id,
author_id=api_entity.data.sender_huid,
sync_id=api_entity.data.source_sync_id,
chat_name=api_entity.data.source_chat_name,
inserted_at=api_entity.data.source_inserted_at,
)

if api_entity.type == BotAPIEntityTypes.REPLY:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pybotx"
version = "0.63.0"
version = "0.64.0"
description = "A python library for interacting with eXpress BotX API"
authors = [
"Sidnev Nikolay <nsidnev@ccsteam.ru>",
Expand Down
2 changes: 2 additions & 0 deletions tests/test_incoming_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,8 @@ async def default_handler(message: IncomingMessage, bot: Bot) -> None:
),
forward=Forward(
chat_id=UUID("918da23a-1c9a-506e-8a6f-1328f1499ee8"),
chat_name="Simple Chat",
inserted_at=datetime_formatter("2020-04-21T22:09:32.178Z"),
author_id=UUID("c06a96fa-7881-0bb6-0e0b-0af72fe3683f"),
sync_id=UUID("a7ffba12-8d0a-534e-8896-a0aa2d93a434"),
),
Expand Down

0 comments on commit 5fab4bb

Please sign in to comment.