aboutsummaryrefslogtreecommitdiffstats
path: root/slack/slack_message.py
diff options
context:
space:
mode:
Diffstat (limited to 'slack/slack_message.py')
-rw-r--r--slack/slack_message.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/slack/slack_message.py b/slack/slack_message.py
index db5c6cf..1a0d482 100644
--- a/slack/slack_message.py
+++ b/slack/slack_message.py
@@ -3,8 +3,10 @@ from __future__ import annotations
import re
from typing import TYPE_CHECKING, List, Optional
+from slack.shared import shared
from slack.slack_user import SlackUser, format_bot_nick
from slack.task import gather
+from slack.util import with_color
if TYPE_CHECKING:
from slack_api.slack_conversations_history import SlackMessage as SlackMessageDict
@@ -59,6 +61,12 @@ class SlackMessage:
def unfurl_user(user_id: str):
user = users[user_id]
- return "@" + user.nick() if isinstance(user, SlackUser) else f"@{user_id}"
+ return (
+ with_color(
+ shared.config.color.user_mention_color.value, "@" + user.nick()
+ )
+ if isinstance(user, SlackUser)
+ else f"@{user_id}"
+ )
return re_user.sub(lambda match: unfurl_user(match.group(1)), message)