Skip to content

Commit

Permalink
fix: messageDeletion component not closing clickable to format
Browse files Browse the repository at this point in the history
  • Loading branch information
Boy0000 committed Jan 20, 2024
1 parent c10f862 commit f4f6c17
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ fun formatModerationMessage(messageDeletion: ChattyChannel.MessageDeletion, mess

return when {
!messageDeletion.enabled || audience !is Player || audience == source || !audience.hasPermission(ChattyPermissions.MODERATION_PERM) -> message
messageDeletion.position == ChattyChannel.MessageDeletion.MessageDeletionPosition.PREFIX -> messageDeletion.format.miniMsg().appendDeletionHover(audience).append(message)
messageDeletion.position == ChattyChannel.MessageDeletion.MessageDeletionPosition.SUFFIX -> message.append(messageDeletion.format.miniMsg().appendDeletionHover(audience))
messageDeletion.position == ChattyChannel.MessageDeletion.MessageDeletionPosition.PREFIX -> Component.textOfChildren(messageDeletion.format.miniMsg().appendDeletionHover(audience), message)
messageDeletion.position == ChattyChannel.MessageDeletion.MessageDeletionPosition.SUFFIX -> Component.textOfChildren(message, messageDeletion.format.miniMsg().appendDeletionHover(audience))
else -> message
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,10 @@ class DiscordListener {

private fun String.translateEmoteIDs(): String {
var translated = this
chatty.emotefixer.emotes.entries.forEach { (emoteId, replacement) ->
val id = ":$emoteId:"
if (id in this) {
translated = translated.replace(id, replacement)
}
chatty.emotefixer.emotes.entries.map { ":${it.key}:" to it.value }.forEach { (emoteId, replacement) ->
translated = translated.replace(emoteId, replacement)
}

return translated.cleanUpHackyFix()
}
}

0 comments on commit f4f6c17

Please sign in to comment.