1
0
mirror of https://github.com/minetest-mods/irc.git synced 2024-12-26 17:00:17 +01:00

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

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