mirror of
https://github.com/minetest-mods/irc.git
synced 2024-12-27 09:10:21 +01:00
Fix error if @
with no name is used.
This commit is contained in:
parent
33542b07fe
commit
78fbe26a2c
@ -41,7 +41,9 @@ function irc:bot_command(msg, text)
|
|||||||
text = text:match("^%s*(.*)")
|
text = text:match("^%s*(.*)")
|
||||||
if text:sub(1, 1) == "@" then
|
if text:sub(1, 1) == "@" then
|
||||||
local _, _, player_to, message = text:find("^.([^%s]+)%s(.+)$")
|
local _, _, player_to, message = text:find("^.([^%s]+)%s(.+)$")
|
||||||
if not minetest.get_player_by_name(player_to) then
|
if not player_to then
|
||||||
|
return
|
||||||
|
elseif not minetest.get_player_by_name(player_to) then
|
||||||
irc:reply("User '"..player_to.."' is not in the game.")
|
irc:reply("User '"..player_to.."' is not in the game.")
|
||||||
return
|
return
|
||||||
elseif not irc.joined_players[player_to] then
|
elseif not irc.joined_players[player_to] then
|
||||||
|
Loading…
Reference in New Issue
Block a user