class Object
Public Instance Methods
generate(e, c, targeted)
click to toggle source
# File lib/tinyirc/plugins/cookies.rb, line 43 def generate(e, c, targeted) quality = @cookie_qualities[c.options['quality']] || @cookie_qualities.values.sample type = @cookie_types[c.options['type']] || @cookie_types.values.sample target = if targeted c.positionals['who'] else e[:nick] end "ACTION %Ngives %B#{target}%N a %B#{quality}#{type}%N%B%C%BROWNcookie%N" end
get_target(e, c, raw)
click to toggle source
get target func
# File lib/tinyirc/plugins/admin-utils.rb, line 106 def get_target(e, c, raw) host = e[:socket].usercache.get(c.positionals['who'], false)[:host] if raw || host == nil c.positionals['who'] else "*!*@#{host}" end end
notify_plugin(plugin, e)
click to toggle source
# File lib/tinyirc/plugins/core.rb, line 8 def notify_plugin(plugin, e) (plugin.event_handlers[e[:type]] || []).each do |h| begin h[:handler].(e) if e >= h[:pattern] rescue => e e.backtrace.each do |l| @log.error "- #{l}" end @log.error "#{e.class.name} - #{e.message}" end end end