Skip to content

Commit

Permalink
fix: make Reply field source_chat_name optional and Forward field `…
Browse files Browse the repository at this point in the history
…source_sync_id` required
  • Loading branch information
rrrrs09 authored and lxmnk committed Jul 8, 2021
1 parent 75dfa3f commit 14549af
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions botx/models/entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class Forward(BotXBaseModel):
source_chat_name: Optional[str] = None

#: id of original message event.
source_sync_id: Optional[UUID]
source_sync_id: UUID

#: id of event creation.
source_inserted_at: datetime
Expand Down Expand Up @@ -162,7 +162,7 @@ class Reply(BotXBaseModel):
sender: UUID

#: chat name of source message.
source_chat_name: str
source_chat_name: Optional[str]

#: chat uuid of source message.
source_group_chat_id: Optional[UUID]
Expand Down
2 changes: 2 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Add `inserted_at` field to `ChatFromSearch` model
* `HTTPRequest` & `HTTPResponse` moved to `clients.types`
* `HTTPRequest` now work with JSON (dict) instead of bytes. It improves consistency with
`HTTPResponse` and will be useful in interceptors implementation.
* Reply event field `source_chat_name` is optional now
* Forward event field `source_sync_id` is required now

### Removed

Expand Down
2 changes: 2 additions & 0 deletions tests/test_testing/test_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ def test_building_forward_via_models(self):
sender_huid=uuid.uuid4(),
forward_type=ChatTypes.group_chat, # ignore: type
source_inserted_at=datetime.now(),
source_sync_id=uuid.uuid4(),
),
)

Expand All @@ -161,6 +162,7 @@ def test_building_forward_arguments_error(self, message):
sender_huid=uuid.uuid4(),
forward_type=ChatTypes.botx, # ignore: type
source_inserted_at=datetime.now(),
source_sync_id=uuid.uuid4(),
),
)

Expand Down

0 comments on commit 14549af

Please sign in to comment.