def initialize
@manager = Plugins::manager
@bot = @manager.bot
+ @priority = nil
@botmodule_triggers = Array.new
# the idea here is to prevent namespace pollution. perhaps there
# is another way?
plugin_module = Module.new
+ # each plugin uses its own textdomain, we bind it automatically here
+ bindtextdomain_to(plugin_module, "rbot-#{File.basename(fname, '.rb')}")
desc = desc.to_s + " " if desc
begin
- plugin_string = IO.readlines(fname).join("")
+ plugin_string = IO.read(fname)
debug "loading #{desc}#{fname}"
plugin_module.module_eval(plugin_string, fname)
return :loaded
if method.to_sym == :privmsg
delegate('ctcp_listen', m) if m.ctcp
delegate('message', m)
- privmsg(m) if m.address?
+ privmsg(m) if m.address? and not m.ignored?
delegate('unreplied', m) unless m.replied
else
delegate(method, m)