added callbacks to block or otherwise process messages from other mods

This commit is contained in:
Diego Martínez
2013-01-11 14:20:30 -02:00
parent b147586bc3
commit 96ed8287f4
4 changed files with 104 additions and 5 deletions

View File

@ -116,7 +116,7 @@ mt_irc.connect = function ( )
name=(msg.name or "<BUG:no one is saying this>");
message=(msg.message or "<BUG:there is no message>");
};
local text = mt_irc.message_format_out:gsub("%$%(([^)]+)%)", t)
local text = mt_irc.message_format_out:expandvars(t);
irc.say(mt_irc.channel, text);
end
mt_irc.buffered_messages = nil;
@ -145,6 +145,13 @@ end
mt_irc.irc = irc;
-- Misc helpers
-- Requested by Exio
string.expandvars = function ( s, vars )
return s:gsub("%$%(([^)]+)%)", vars);
end
dofile(MODPATH.."/callback.lua");
dofile(MODPATH.."/chatcmds.lua");
dofile(MODPATH.."/botcmds.lua");