diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2023-09-17 13:00:00 +0200 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2024-02-18 11:32:54 +0100 |
commit | f103563e404b3f4e3d24ed57834c2fe517c979d8 (patch) | |
tree | 0c4230d7204ccf88bb266ae9d79ff8d5ffe32f75 /slack/slack_api.py | |
parent | c102376e7b3052126680465c3f99c1b3818ed697 (diff) | |
download | wee-slack-f103563e404b3f4e3d24ed57834c2fe517c979d8.tar.gz |
Fetch thread replies when receiving thread message
This is done so we can know if we should include a message hash when
completing thread hashes, and it also has the benefit of eliminating the
loading time when opening thread buffers.
Diffstat (limited to 'slack/slack_api.py')
-rw-r--r-- | slack/slack_api.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/slack/slack_api.py b/slack/slack_api.py index 72c82e4..0e38bf4 100644 --- a/slack/slack_api.py +++ b/slack/slack_api.py @@ -7,7 +7,7 @@ from urllib.parse import urlencode from slack.error import SlackApiError from slack.http import http_request from slack.shared import shared -from slack.slack_message import SlackMessage +from slack.slack_message import SlackTs if TYPE_CHECKING: from slack_api.slack_bots_info import SlackBotInfoResponse, SlackBotsInfoResponse @@ -138,11 +138,13 @@ class SlackApi(SlackApiCommon): raise SlackApiError(self.workspace, method, response, params) return response - async def fetch_conversations_replies(self, parent_message: SlackMessage): + async def fetch_conversations_replies( + self, conversation: SlackConversation, parent_message_ts: SlackTs + ): method = "conversations.replies" params: Params = { - "channel": parent_message.conversation.id, - "ts": str(parent_message.ts), + "channel": conversation.id, + "ts": parent_message_ts, } response: SlackConversationsRepliesResponse = await self._fetch_list( method, "messages", params |