-
Notifications
You must be signed in to change notification settings - Fork 11
[INTPROD-9686] Add threaded conversation support #115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -17,6 +17,7 @@ def __init__(self, bot: Bot, event: dict, event_trace: dict): | |||||||||
| super().__init__(bot, event, event_trace, "message") | ||||||||||
| self._payload["ts"] = event["ts"] | ||||||||||
| self._payload["thread_ts"] = event.get("thread_ts") | ||||||||||
| self._payload["parent_user_id"] = event.get("parent_user_id") | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what is a parent_user_id?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not reference to parent message
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is the user id for the first message in the thread and exists for thread replies but not for regular messages |
||||||||||
| self._check_unsupported() | ||||||||||
| try: | ||||||||||
| self._payload["text"] = event["text"] | ||||||||||
|
|
@@ -50,10 +51,6 @@ def _check_unsupported(self): | |||||||||
| elif self.user and self.user == "USLACKBOT": | ||||||||||
| logger.debug("ignoring message from slackbot", extra=self.event_trace) | ||||||||||
| unsupported = True | ||||||||||
| # Ignore threads | ||||||||||
| elif self.thread_ts: | ||||||||||
| logger.debug("ignoring thread message", extra=self.event_trace) | ||||||||||
| unsupported = True | ||||||||||
| # For now, ignore all event subtypes | ||||||||||
| elif self.subtype: | ||||||||||
| extra = {"subtype": self.subtype} | ||||||||||
|
|
@@ -201,8 +198,19 @@ def mentioned(self): | |||||||||
|
|
||||||||||
| @property | ||||||||||
| def thread_ts(self): | ||||||||||
| """ | ||||||||||
| The timestamp of the parent message, if this is a reply to a message. | ||||||||||
| :return: | ||||||||||
|
||||||||||
| :return: | |
| :return: The timestamp of the parent message as a string, or None if the message is not part of a thread. | |
| :rtype: Optional[str] |
david-lyft marked this conversation as resolved.
Show resolved
Hide resolved
Copilot
AI
Jul 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parent_user_id property can return None when parent_user_id is not present in the event, but this isn't documented in the docstring. Consider adding a return type annotation and documenting the None case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
feel this needs to go on infradocs