Add channel prefix check to incoming PMs
This commit is contained in:
parent
eca229645a
commit
b101206115
2
init.lua
2
init.lua
|
@ -148,6 +148,8 @@ minetest.register_on_receiving_chat_messages(function(msg)
|
||||||
elseif m:match('^PM from [^\\- ]*: -[^ ]*- ') then
|
elseif m:match('^PM from [^\\- ]*: -[^ ]*- ') then
|
||||||
local s, e = msg:find('-[^ ]*- ')
|
local s, e = msg:find('-[^ ]*- ')
|
||||||
if not s then return end
|
if not s then return end
|
||||||
|
local prefix = msg:sub(s + 1, s + 1)
|
||||||
|
if prefix ~= '#' then return end
|
||||||
local chan = msg:sub(s + 2, e - 2)
|
local chan = msg:sub(s + 2, e - 2)
|
||||||
local text = msg:sub(e + 1)
|
local text = msg:sub(e + 1)
|
||||||
local user = m:sub(9)
|
local user = m:sub(9)
|
||||||
|
|
Loading…
Reference in New Issue