From f4c6bf48fa81aeb9e52410e2fb75a9cd0af38f1f Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Thu, 9 Sep 2021 08:21:32 -0700 Subject: [PATCH] Trim command before processing private message. --- src/main/kotlin/net/thauvin/erik/mobibot/Mobibot.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/net/thauvin/erik/mobibot/Mobibot.kt b/src/main/kotlin/net/thauvin/erik/mobibot/Mobibot.kt index 6e21c00..b7b7d1a 100644 --- a/src/main/kotlin/net/thauvin/erik/mobibot/Mobibot.kt +++ b/src/main/kotlin/net/thauvin/erik/mobibot/Mobibot.kt @@ -351,7 +351,7 @@ class Mobibot(nickname: String, channel: String, logsDirPath: String, p: Propert message: String ) { if (logger.isDebugEnabled) logger.debug(">>> $sender : $message") - val cmds = message.split(" ".toRegex(), 2) + val cmds = message.trim().split(" ".toRegex(), 2) val cmd = cmds[0].lowercase() val args = if (cmds.size > 1) { cmds[1].trim()