mcbot/mcbot_engine.lua
changeset 26 c12be727375b
parent 25 788c62c29e18
child 27 a166e9ab8065
equal deleted inserted replaced
25:788c62c29e18 26:c12be727375b
    33 require "cmds.xmpp"
    33 require "cmds.xmpp"
    34 
    34 
    35 function process (line, botdata, muc)
    35 function process (line, botdata, muc)
    36     local n
    36     local n
    37     line = trim(line)
    37     line = trim(line)
    38     line, n = line:gsub("^"..botdata.nickname.."[,: ]%s+", "")
    38     line, n = line:gsub("^"..botdata.nickname.."[,:]?%s+", "")
    39     if muc and n ~= 1 then return nil, nil end
    39     if muc and n ~= 1 then return nil, nil end
    40 
    40 
    41     local cmd, arg
    41     local cmd, arg
    42     cmd = line:match("^(%w+)%s*[!]*$")
    42     cmd = line:match("^(%w+)%s*[!]*$")
    43     if not cmd then
    43     if not cmd then