diff options
Diffstat (limited to 'slack/slack_message.py')
-rw-r--r-- | slack/slack_message.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/slack/slack_message.py b/slack/slack_message.py index dc7d79d..1a3365f 100644 --- a/slack/slack_message.py +++ b/slack/slack_message.py @@ -1,6 +1,7 @@ from __future__ import annotations import re +from enum import Enum from typing import TYPE_CHECKING, List, Match, Optional from slack.log import print_exception_once @@ -17,6 +18,13 @@ if TYPE_CHECKING: from slack.slack_workspace import SlackWorkspace +class MessagePriority(Enum): + LOW = 0 + MESSAGE = 1 + PRIVATE = 2 + HIGHLIGHT = 3 + + class SlackMessage: def __init__(self, conversation: SlackConversation, message_json: SlackMessageDict): self._message_json = message_json @@ -31,6 +39,10 @@ class SlackMessage: def sender_user_id(self) -> Optional[str]: return self._message_json.get("user") + @property + def priority(self) -> MessagePriority: + return MessagePriority.MESSAGE + async def render_message(self) -> str: prefix_coro = self._prefix() message_coro = self._unfurl_refs(self._message_json["text"]) |