Skip to content

Commit

Permalink
Go back to contentDisplay for IRC relay so that mentions are resolved
Browse files Browse the repository at this point in the history
  • Loading branch information
randomnetcat committed Nov 20, 2023
1 parent 3c12867 commit a3fb3df
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/kotlin/org/randomcat/agorabot/irc/IrcEndpoint.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ private suspend fun IrcChannel.sendDiscordMessage(message: DiscordMessage) {

val referencedMessage = message.referencedMessage

// Use contentDisplay to resolve mentions.

val replySection = run {
if (referencedMessage != null) {
val replyName = referencedMessage.retrieveEffectiveSenderName().await()
"In response to $replyName saying: ${formatRelayDiscordContent(referencedMessage.contentRaw)}\n"
"In response to $replyName saying: ${formatRelayDiscordContent(referencedMessage.contentDisplay)}\n"
} else {
""
}
Expand All @@ -44,7 +46,7 @@ private suspend fun IrcChannel.sendDiscordMessage(message: DiscordMessage) {
?: ""

val saysVerb = if (referencedMessage != null) "replies" else "says"
val textSection = "$senderName $saysVerb: ${formatRelayDiscordContent(message.contentRaw)}"
val textSection = "$senderName $saysVerb: ${formatRelayDiscordContent(message.contentDisplay)}"

val fullMessage = replySection + textSection + attachmentSection

Expand Down

0 comments on commit a3fb3df

Please sign in to comment.