Skip to content

Commit

Permalink
feat: add message_type property to TalkBotMessage (#292)
Browse files Browse the repository at this point in the history
Sample chat message structure:
https://nextcloud-talk.readthedocs.io/en/latest/bots/#sample-chat-message

Signed-off-by: Anupam Kumar <[email protected]>
  • Loading branch information
kyteinsky authored Sep 4, 2024
1 parent fb3ee49 commit 4647e06
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions nc_py_api/talk_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ class TalkBotMessage:
def __init__(self, raw_data: dict):
self._raw_data = raw_data

@property
def message_type(self) -> str:
"""The type of message like Join, Leave, Create, Activity, etc."""
return self._raw_data["type"]

@property
def actor_id(self) -> str:
"""One of the attendee types followed by the ``/`` character and a unique identifier within the given type.
Expand Down

0 comments on commit 4647e06

Please sign in to comment.