forked from minetest-mods/irc
added callbacks to block or otherwise process messages from other mods
This commit is contained in:
@ -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");
|
||||
|
Reference in New Issue
Block a user