diff --git a/hooks.lua b/hooks.lua index 975c89c..6c8e243 100644 --- a/hooks.lua +++ b/hooks.lua @@ -104,6 +104,14 @@ end function irc.hooks.channelChat(msg) local text = normalize(msg.args[2]) + irc:check_botcmd(msg) + + -- Don't let a user impersonate someone else by using the nick "IRC" + if msg.user.nick == "IRC" then + irc:sendLocal(" "..text) + return + end + -- Support multiple servers in a channel better by converting: -- " message" into " message" -- " *** player joined/left the game" into "*** player joined/left server" @@ -117,8 +125,6 @@ function irc.hooks.channelChat(msg) local foundaction, _, actionnick, actionmessage = text:find("^%* ([^%s]+) (.*)$") - irc:check_botcmd(msg) - if text:sub(1, 5) == "[off]" then return elseif foundchat then