aboutsummaryrefslogtreecommitdiffstats
path: root/typings/slack_api
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2023-01-15 14:18:37 +0100
committerTrygve Aaberge <trygveaa@gmail.com>2024-02-18 11:32:53 +0100
commit988c7770e2c70e0cdf8268dabb4ef6f02ce2ca99 (patch)
tree9fd61b1bc60d614904a1d5c51c6c157c10850394 /typings/slack_api
parent7b9cf4d9278f584c4ce754e3dfbbcd245b1f9985 (diff)
downloadwee-slack-988c7770e2c70e0cdf8268dabb4ef6f02ce2ca99.tar.gz
Show nick suffix for bots
Diffstat (limited to 'typings/slack_api')
-rw-r--r--typings/slack_api/slack_bots_info.pyi24
-rw-r--r--typings/slack_api/slack_conversations_history.pyi24
2 files changed, 44 insertions, 4 deletions
diff --git a/typings/slack_api/slack_bots_info.pyi b/typings/slack_api/slack_bots_info.pyi
new file mode 100644
index 0000000..0fb296f
--- /dev/null
+++ b/typings/slack_api/slack_bots_info.pyi
@@ -0,0 +1,24 @@
+from typing import Dict, Literal, TypedDict, final
+
+from typing_extensions import NotRequired
+
+class SlackBotInfo(TypedDict):
+ id: str
+ deleted: bool
+ name: str
+ updated: int
+ app_id: str
+ user_id: NotRequired[str]
+ icons: Dict[str, str]
+
+@final
+class SlackBotsInfoErrorResponse(TypedDict):
+ ok: Literal[False]
+ error: str
+
+@final
+class SlackBotsInfoSuccessResponse(TypedDict):
+ ok: Literal[True]
+ bot: SlackBotInfo
+
+SlackBotInfoResponse = SlackBotsInfoSuccessResponse | SlackBotsInfoErrorResponse
diff --git a/typings/slack_api/slack_conversations_history.pyi b/typings/slack_api/slack_conversations_history.pyi
index 479fe50..b0220e3 100644
--- a/typings/slack_api/slack_conversations_history.pyi
+++ b/typings/slack_api/slack_conversations_history.pyi
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import List, Literal, TypedDict, final
+from typing import Dict, List, Literal, TypedDict, final
from typing_extensions import NotRequired
@@ -81,17 +81,21 @@ class SlackMessageFile(TypedDict):
class SlackMessageCommon(TypedDict):
type: Literal["message"]
text: str
- user: str
ts: str
reactions: NotRequired[List[SlackMessageReaction]]
-class SlackMessageStandard(SlackMessageCommon):
+class SlackMessageStandardCommon(SlackMessageCommon):
client_msg_id: NotRequired[str]
+ user: str
blocks: List[SlackMessageBlock]
attachments: NotRequired[List[SlackMessageAttachment]]
team: str
-class SlackMessageThreadParentCommon(SlackMessageStandard):
+@final
+class SlackMessageStandard(SlackMessageStandardCommon):
+ pass
+
+class SlackMessageThreadParentCommon(SlackMessageStandardCommon):
thread_ts: str
reply_count: int
reply_users_count: int
@@ -108,21 +112,32 @@ class SlackMessageThreadParentSubscribed(SlackMessageThreadParentCommon):
subscribed: Literal[True]
last_read: str
+@final
class SlackMessageWithFiles(SlackMessageCommon):
+ user: str
files: List[SlackMessageFile]
upload: bool
display_as_bot: bool
# TODO: Add other subtypes
@final
+class SlackMessageSubtypeBotMessage(SlackMessageCommon):
+ subtype: Literal["bot_message"]
+ bot_id: str
+ username: NotRequired[str]
+ icons: NotRequired[Dict[str, str]]
+
+@final
class SlackMessageSubtypeBotRemove(SlackMessageCommon):
subtype: Literal["bot_remove"]
+ user: str
bot_id: str
bot_link: str
@final
class SlackMessageSubtypeBotAdd(SlackMessageCommon):
subtype: Literal["bot_add"]
+ user: str
bot_id: str
bot_link: str
@@ -136,6 +151,7 @@ SlackMessage = (
| SlackMessageThreadParentNotSubscribed
| SlackMessageThreadParentSubscribed
| SlackMessageWithFiles
+ | SlackMessageSubtypeBotMessage
| SlackMessageSubtypeBotRemove
| SlackMessageSubtypeBotAdd
)