@@ -52,6 +52,7 @@ class BotSlackSender implements SlackSender {
5252
5353 private final String botToken
5454 private final String channelId
55+ private final SlackMentionResolver mentionResolver
5556 private final Set<String > loggedErrors = Collections . synchronizedSet(new HashSet<String > ())
5657 private String threadTs // Store the thread timestamp for threaded conversations
5758 private String resolvedChannelId // Channel ID resolved from Slack API response
@@ -65,6 +66,7 @@ class BotSlackSender implements SlackSender {
6566 BotSlackSender (String botToken , String channelId ) {
6667 this . botToken = botToken
6768 this . channelId = channelId
69+ this . mentionResolver = new SlackMentionResolver (botToken)
6870 }
6971
7072 /**
@@ -75,8 +77,8 @@ class BotSlackSender implements SlackSender {
7577 @Override
7678 void sendMessage (String message ) {
7779 try {
78- // Message is already formatted by SlackMessageBuilder with channel ID
79- postToSlack(message )
80+ def resolvedMessage = mentionResolver . resolveInJson(message)
81+ postToSlack(resolvedMessage )
8082
8183 } catch (Exception e) {
8284 def errorMsg = " Slack plugin: Error sending bot message: ${ e.message} " . toString()
@@ -419,7 +421,8 @@ class BotSlackSender implements SlackSender {
419421 @Override
420422 void updateMessage (String message , String messageTs ) {
421423 try {
422- postUpdate(message, messageTs)
424+ def resolvedMessage = mentionResolver. resolveInJson(message)
425+ postUpdate(resolvedMessage, messageTs)
423426 } catch (Exception e) {
424427 def errorMsg = " Slack plugin: Error updating message: ${ e.message} " . toString()
425428 if (loggedErrors. add(errorMsg)) {
0 commit comments