Skip to content

Commit aae9390

Browse files
committed
fix: handle bot join messages properly
Signed-off-by: Anupam Kumar <kyteinsky@gmail.com>
1 parent 7a374e5 commit aae9390

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

nc_py_api/talk_bot.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,17 @@ def conversation_token(self) -> str:
7676
7777
It can be used to react or reply to the given message.
7878
"""
79+
# bot join
80+
if self.message_type == "Join":
81+
return self._raw_data["object"]["id"]
7982
return self._raw_data["target"]["id"]
8083

8184
@property
8285
def conversation_name(self) -> str:
8386
"""The name of the conversation in which the message was posted."""
87+
# bot join
88+
if self.message_type == "Join":
89+
return self._raw_data["object"]["name"]
8490
return self._raw_data["target"]["name"]
8591

8692
def __repr__(self):

0 commit comments

Comments
 (0)