From ae0cb08e3e79f3a36fe8148a3fe35ae0cf9bfbf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Mart=C3=ADnez?= Date: Sun, 29 Jan 2017 15:05:42 -0300 Subject: [PATCH] Remove leading whitespace from command before processing. Fixes bug where `Server: asdf` (note the double space) gets taken as an empty command name. --- botcmds.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/botcmds.lua b/botcmds.lua index e8461f4..a6d72ca 100644 --- a/botcmds.lua +++ b/botcmds.lua @@ -37,6 +37,8 @@ end function irc:bot_command(msg, text) + -- Remove leading whitespace + text = text:match("^%s*(.*)") if text:sub(1, 1) == "@" then local found, _, player_to, message = text:find("^.([^%s]+)%s(.+)$") if not minetest.get_player_by_name(player_to) then