Skip to content

Commit

Permalink
Do not translate colors from Discord
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobwgillespie committed Feb 21, 2016
1 parent dc45087 commit 32d286e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/kotlin/gg/obsidian/discordbridge/Util.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ import org.bukkit.ChatColor
object Util {
fun formatMessage(message: String, replacements: Map<String, String>, colors: Boolean = false): String {
var formattedString = message

if (colors) formattedString = ChatColor.translateAlternateColorCodes('&', formattedString)

for ((token, replacement) in replacements) {
formattedString = formattedString.replace(token, replacement)
}

if (colors) formattedString = ChatColor.translateAlternateColorCodes('&', formattedString)

return formattedString
}
}

0 comments on commit 32d286e

Please sign in to comment.