diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2023-02-03 01:27:31 +0100 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2024-02-18 11:32:53 +0100 |
commit | 4de39f91d9d8942816b8967a115010c466b8f252 (patch) | |
tree | e019d0f6437f131ce3192991b17ef2263ee442e8 /typings/slack_rtm/slack_rtm_message.pyi | |
parent | 684e7d701a4eb21c3b95954c3ca2e38d78ee451c (diff) | |
download | wee-slack-4de39f91d9d8942816b8967a115010c466b8f252.tar.gz |
Add messages received over rtm to channels
Diffstat (limited to 'typings/slack_rtm/slack_rtm_message.pyi')
-rw-r--r-- | typings/slack_rtm/slack_rtm_message.pyi | 105 |
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 +) |