aboutsummaryrefslogtreecommitdiffstats
path: root/typings
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2023-09-17 12:17:41 +0200
committerTrygve Aaberge <trygveaa@gmail.com>2024-02-18 11:32:54 +0100
commit94ef876bd1b1c94e03b389183160bf8373b96114 (patch)
treeed8618e5c169584c7de7a79fa58f74fdd4b11b7e /typings
parent571952b5845910a0cac098bc83af632c7568e9c5 (diff)
downloadwee-slack-94ef876bd1b1c94e03b389183160bf8373b96114.tar.gz
Add types for broadcast messages from rtm
Diffstat (limited to 'typings')
-rw-r--r--typings/slack_api/slack_conversations_history.pyi7
-rw-r--r--typings/slack_api/slack_conversations_replies.pyi4
-rw-r--r--typings/slack_rtm/slack_rtm_message.pyi14
3 files changed, 19 insertions, 6 deletions
diff --git a/typings/slack_api/slack_conversations_history.pyi b/typings/slack_api/slack_conversations_history.pyi
index 944d367..df10725 100644
--- a/typings/slack_api/slack_conversations_history.pyi
+++ b/typings/slack_api/slack_conversations_history.pyi
@@ -332,12 +332,15 @@ class SlackMessageThreadParentSubscribed(SlackMessageThreadParentCommon):
class SlackMessageThreadParentSubscribedFinal(SlackMessageThreadParentSubscribed):
pass
-@final
class SlackMessageThreadBroadcast(SlackMessageThreadCommon):
subtype: Literal["thread_broadcast"]
root: SlackMessageThreadParentCommon
# TODO: team is missing in response
+@final
+class SlackMessageThreadBroadcastFinal(SlackMessageThreadBroadcast):
+ pass
+
class SlackMessageWithFiles(SlackMessageCommon):
user: str
files: List[SlackMessageFile]
@@ -446,7 +449,7 @@ SlackMessage = (
| SlackMessageThreadParentCommon
| SlackMessageThreadParentNotSubscribedFinal
| SlackMessageThreadParentSubscribedFinal
- | SlackMessageThreadBroadcast
+ | SlackMessageThreadBroadcastFinal
| SlackMessageWithFilesFinal
| SlackMessageSubtypeHuddleThreadFinal
| SlackMessageSubtypeBotMessageFinal
diff --git a/typings/slack_api/slack_conversations_replies.pyi b/typings/slack_api/slack_conversations_replies.pyi
index fd6ff0c..fe8be8b 100644
--- a/typings/slack_api/slack_conversations_replies.pyi
+++ b/typings/slack_api/slack_conversations_replies.pyi
@@ -3,7 +3,7 @@ from typing import List
from slack_api.slack_common import SlackErrorResponse, SlackResponseMetadata
from slack_api.slack_conversations_history import (
SlackMessageStandardCommon,
- SlackMessageThreadBroadcast,
+ SlackMessageThreadBroadcastFinal,
SlackMessageThreadParentNotSubscribedFinal,
SlackMessageThreadParentSubscribedFinal,
)
@@ -22,7 +22,7 @@ class SlackConversationsRepliesSuccessResponse(TypedDict):
messages: List[
SlackMessageThreadParentNotSubscribedFinal
| SlackMessageThreadParentSubscribedFinal
- | SlackMessageThreadBroadcast
+ | SlackMessageThreadBroadcastFinal
| SlackMessageThread
]
has_more: bool
diff --git a/typings/slack_rtm/slack_rtm_message.pyi b/typings/slack_rtm/slack_rtm_message.pyi
index 64dc64e..01c3f9c 100644
--- a/typings/slack_rtm/slack_rtm_message.pyi
+++ b/typings/slack_rtm/slack_rtm_message.pyi
@@ -9,6 +9,7 @@ from slack_api.slack_conversations_history import (
SlackMessageSubtypeChannelLeave,
SlackMessageSubtypeHuddleThread,
SlackMessageSubtypeHuddleThreadRoom,
+ SlackMessageThreadBroadcast,
SlackMessageThreadParentCommon,
SlackMessageThreadParentNotSubscribed,
SlackMessageThreadParentSubscribed,
@@ -45,7 +46,15 @@ class SlackMessageThreadRtm(SlackMessageThreadCommon):
channel: str
event_ts: str
source_team: str
- suppress_notification: bool
+ suppress_notification: NotRequired[bool]
+ user_team: str
+
+@final
+class SlackMessageThreadBroadcastRtm(SlackMessageThreadBroadcast):
+ channel: str
+ event_ts: str
+ source_team: str
+ suppress_notification: NotRequired[bool]
user_team: str
@final
@@ -55,7 +64,7 @@ class SlackMessageWithFilesRtm(SlackMessageWithFiles):
@final
class SlackMessageSubtypeHuddleThreadRtm(SlackMessageSubtypeHuddleThread):
event_ts: str
- suppress_notification: bool
+ suppress_notification: NotRequired[bool]
@final
class SlackMessageSubtypeBotMessageRtm(SlackMessageSubtypeBotMessage):
@@ -170,6 +179,7 @@ SlackMessageRtm = (
| SlackMessageThreadParentNotSubscribedRtm
| SlackMessageThreadParentSubscribedRtm
| SlackMessageThreadRtm
+ | SlackMessageThreadBroadcastRtm
| SlackMessageWithFilesRtm
| SlackMessageSubtypeHuddleThreadRtm
| SlackMessageSubtypeBotMessageRtm