Skip to content

Commit

Permalink
Use formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
wtlgo committed Nov 26, 2023
1 parent bb0fa5e commit 0d43db8
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ internal class MOTDListener(private val plugin: MOTDPlugin) : Listener {
if (!plugin.config.enabled) return
val motd = plugin.motdManager.getRandom() ?: return

if (motd.firstLine != null || motd.secondLine != "") {
val firstLine = motd.firstLine ?: ""
val secondLine = motd.secondLine ?: ""
if (motd.firstLine != null || motd.secondLine != null) {
val firstLine = motd.firstLine?.let { plugin.formatter.format(it) } ?: ""
val secondLine = motd.secondLine?.let { plugin.formatter.format(it) } ?: ""
event.motd = "${firstLine}\n${secondLine}"
}

Expand Down

0 comments on commit 0d43db8

Please sign in to comment.