Remove leading whitespace from command before processing.

Fixes bug where `Server:  asdf` (note the double space)
gets taken as an empty command name.
This commit is contained in:
Diego Martínez 2017-01-29 15:05:42 -03:00
parent bb5f549193
commit ae0cb08e3e
1 changed files with 2 additions and 0 deletions

View File

@ -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