Skip to content

Commit d0d5867

Browse files
committed
Improve discord message replies
1 parent 66d148c commit d0d5867

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/main/kotlin/io/github/quiltservertools/blockbotdiscord/config/ChatRelaySpec.kt

+1
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ fun Config.getReplyMsg(
183183
Placeholders.ALT_PLACEHOLDER_PATTERN_CUSTOM,
184184
mapOf(
185185
"sender" to (sender).literal(),
186+
"message" to message.content.literal(),
186187
"summary" to message.summary().literal(),
187188
)
188189
), PlaceholderContext.of(server)

src/main/kotlin/io/github/quiltservertools/blockbotdiscord/extensions/BlockBotApiExtension.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ class BlockBotApiExtension : Extension(), Bot {
140140
content = convertEmojiToTranslatable(content)
141141
if (message.referencedMessage != null) {
142142
val reply = config.getReplyMsg(
143-
message.referencedMessage!!.getAuthorAsMemberOrNull()?.effectiveName ?: "unknown-user",
143+
message.referencedMessage!!.getAuthorAsMemberOrNull()?.effectiveName ?: message.referencedMessage!!.data.author.username,
144144
message.referencedMessage!!,
145145
server
146146
)

src/main/resources/blockbot-discord.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ escapeIngameMarkdown = false
2525
# Supports Simplified Text Format and Placeholder API with server context
2626
messageFormat = "[<color:#7289DA>Discord</color> | {sender_colored}] {message}"
2727
# Discord -> Minecraft reply format
28-
# Placeholders: {sender}, {summary}
28+
# Placeholders: {sender}, {summary}, {message}
2929
# Supports Simplified Text Format and Placeholder API with server context
30-
replyFormat = "<gray>(Replying to @{sender}: {summary})</gray>"
30+
replyFormat = "<gray>(Replying to @{sender}: <hover:'{message}'>{summary}</hover>)</gray>"
3131
# Try to add images to messages
3232
appendImages = false
3333
# Use image interpolation

0 commit comments

Comments
 (0)