From 4b68e8721d18f83c58fea5109da95346363bb9e8 Mon Sep 17 00:00:00 2001 From: Trygve Aaberge Date: Sat, 26 Aug 2023 21:00:07 +0200 Subject: Support showing thread replies in the channel --- typings/slack_api/slack_conversations_replies.pyi | 31 +++++++++++++++++++++++ typings/slack_rtm/slack_rtm_message.pyi | 10 ++++++++ 2 files changed, 41 insertions(+) create mode 100644 typings/slack_api/slack_conversations_replies.pyi (limited to 'typings') diff --git a/typings/slack_api/slack_conversations_replies.pyi b/typings/slack_api/slack_conversations_replies.pyi new file mode 100644 index 0000000..4e4fd4c --- /dev/null +++ b/typings/slack_api/slack_conversations_replies.pyi @@ -0,0 +1,31 @@ +from typing import List + +from slack_api.slack_common import SlackErrorResponse, SlackResponseMetadata +from slack_api.slack_conversations_history import ( + SlackMessageStandardCommon, + SlackMessageThreadParentNotSubscribedFinal, + SlackMessageThreadParentSubscribedFinal, +) +from typing_extensions import Literal, NotRequired, TypedDict, final + +class SlackMessageThreadCommon(SlackMessageStandardCommon): + thread_ts: str + +@final +class SlackMessageThread(SlackMessageThreadCommon): + parent_user_id: str + +@final +class SlackConversationsRepliesSuccessResponse(TypedDict): + ok: Literal[True] + messages: List[ + SlackMessageThreadParentNotSubscribedFinal + | SlackMessageThreadParentSubscribedFinal + | SlackMessageThread + ] + has_more: bool + response_metadata: NotRequired[SlackResponseMetadata] + +SlackConversationsRepliesResponse = ( + SlackConversationsRepliesSuccessResponse | SlackErrorResponse +) diff --git a/typings/slack_rtm/slack_rtm_message.pyi b/typings/slack_rtm/slack_rtm_message.pyi index 65f15e8..64dc64e 100644 --- a/typings/slack_rtm/slack_rtm_message.pyi +++ b/typings/slack_rtm/slack_rtm_message.pyi @@ -14,6 +14,7 @@ from slack_api.slack_conversations_history import ( SlackMessageThreadParentSubscribed, SlackMessageWithFiles, ) +from slack_api.slack_conversations_replies import SlackMessageThreadCommon from typing_extensions import Literal, NotRequired, TypedDict, final class SlackRtmHello(TypedDict): @@ -39,6 +40,14 @@ class SlackMessageThreadParentNotSubscribedRtm(SlackMessageThreadParentNotSubscr class SlackMessageThreadParentSubscribedRtm(SlackMessageThreadParentSubscribed): channel: str +@final +class SlackMessageThreadRtm(SlackMessageThreadCommon): + channel: str + event_ts: str + source_team: str + suppress_notification: bool + user_team: str + @final class SlackMessageWithFilesRtm(SlackMessageWithFiles): channel: str @@ -160,6 +169,7 @@ SlackMessageRtm = ( | SlackMessageMeRtm | SlackMessageThreadParentNotSubscribedRtm | SlackMessageThreadParentSubscribedRtm + | SlackMessageThreadRtm | SlackMessageWithFilesRtm | SlackMessageSubtypeHuddleThreadRtm | SlackMessageSubtypeBotMessageRtm -- cgit