aboutsummaryrefslogtreecommitdiffstats
path: root/typings/slack_rtm
diff options
context:
space:
mode:
Diffstat (limited to 'typings/slack_rtm')
-rw-r--r--typings/slack_rtm/slack_rtm_message.pyi105
1 files changed, 105 insertions, 0 deletions
diff --git a/typings/slack_rtm/slack_rtm_message.pyi b/typings/slack_rtm/slack_rtm_message.pyi
new file mode 100644
index 0000000..0f8d397
--- /dev/null
+++ b/typings/slack_rtm/slack_rtm_message.pyi
@@ -0,0 +1,105 @@
+from slack_api.slack_conversations_history import (
+ SlackMessage,
+ SlackMessageStandardCommon,
+ SlackMessageSubtypeBotAdd,
+ SlackMessageSubtypeBotMessage,
+ SlackMessageSubtypeBotRemove,
+ SlackMessageThreadParentNotSubscribed,
+ SlackMessageThreadParentSubscribed,
+ SlackMessageWithFiles,
+)
+from typing_extensions import Literal, TypedDict, final
+
+class SlackRtmHello(TypedDict):
+ type: Literal["hello"]
+ fast_reconnect: bool
+ region: str
+ start: bool
+ host_id: str
+
+@final
+class SlackMessageStandardRtm(SlackMessageStandardCommon):
+ channel: str
+
+@final
+class SlackMessageThreadParentNotSubscribedRtm(SlackMessageThreadParentNotSubscribed):
+ channel: str
+
+@final
+class SlackMessageThreadParentSubscribedRtm(SlackMessageThreadParentSubscribed):
+ channel: str
+
+@final
+class SlackMessageWithFilesRtm(SlackMessageWithFiles):
+ channel: str
+
+@final
+class SlackMessageSubtypeBotMessageRtm(SlackMessageSubtypeBotMessage):
+ channel: str
+
+@final
+class SlackMessageSubtypeBotRemoveRtm(SlackMessageSubtypeBotRemove):
+ channel: str
+
+@final
+class SlackMessageSubtypeBotAddRtm(SlackMessageSubtypeBotAdd):
+ channel: str
+
+@final
+class SlackMessageChanged(TypedDict):
+ type: Literal["message"]
+ subtype: Literal["message_changed"]
+ message: SlackMessage
+ previous_message: SlackMessage
+ channel: str
+ hidden: bool
+ ts: str
+ event_ts: str
+
+@final
+class SlackMessageDeleted(TypedDict):
+ type: Literal["message"]
+ subtype: Literal["message_deleted"]
+ previous_message: SlackMessage
+ channel: str
+ hidden: bool
+ ts: str
+ deleted_ts: str
+ event_ts: str
+
+@final
+class SlackMessageReplied(TypedDict):
+ type: Literal["message"]
+ subtype: Literal["message_replied"]
+ message: SlackMessage
+ channel: str
+ hidden: bool
+ ts: str
+ event_ts: str
+
+@final
+class SlackUserTyping(TypedDict):
+ type: Literal["user_typing"]
+ channel: str
+ thread_ts: str
+ id: int
+ user: str
+
+SlackMessageRtm = (
+ SlackMessageStandardRtm
+ | SlackMessageThreadParentNotSubscribedRtm
+ | SlackMessageThreadParentSubscribedRtm
+ | SlackMessageWithFilesRtm
+ | SlackMessageSubtypeBotMessageRtm
+ | SlackMessageSubtypeBotRemoveRtm
+ | SlackMessageSubtypeBotAddRtm
+)
+
+SlackRtmMessage = (
+ SlackRtmHello
+ | SlackMessageRtm
+ | SlackMessageChanged
+ | SlackMessageDeleted
+ | SlackMessageReplied
+ | SlackUserTyping
+)