Skip to content

Commit

Permalink
fix: space formatting all as same
Browse files Browse the repository at this point in the history
  • Loading branch information
Boy0000 committed Dec 11, 2023
1 parent c6bd2e4 commit 0552951
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 2 additions & 1 deletion core/src/main/kotlin/com/mineinabyss/emojy/EmojyHelpers.kt
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ private fun Component.transformEmoteIds(insert: Boolean = true): Component {

spaceRegex.findAll(serialized).forEach { match ->
val space = match.groupValues[1].toIntOrNull() ?: return@forEach
val spaceRegex = "(?<!\\\\):space_(-?$space+):".toRegex()
msg = msg.replaceText(
TextReplacementConfig.builder()
.match(spaceRegex.pattern)
Expand All @@ -131,7 +132,7 @@ private fun Component.transformEmoteIds(insert: Boolean = true): Component {
escapedSpaceRegex.findAll(serialized).forEach { match ->
msg = msg.replaceText(
TextReplacementConfig.builder()
.match(escapedSpaceRegex.pattern)
.match(match.value)
.replacement(match.value.removePrefix("\\"))
.build()
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,8 @@ data class EmojyConfig(
val debug: Boolean = true,
val emojyList: EmojyList = EmojyList(),
val supportedLanguages: Set<String> = mutableSetOf("en_us"),

) {

enum class ListType { BOOK, BOOK2, CHAT }

@Serializable
data class EmojyList(
val ignoredEmoteIds: Set<String> = mutableSetOf(),
Expand Down

0 comments on commit 0552951

Please sign in to comment.