def on_privmsg(m)
target, message = *m.params
if message =~ / +\//
termtter_command = message.gsub(/ +\//, '')
return unless Termtter::Client.find_command(termtter_command)
execute_command(termtter_command)
return
end
config.plugins.irc_gw.command_regexps and
config.plugins.irc_gw.command_regexps.each do |rule|
if message =~ rule
command = message.scan(rule).first.join(' ')
next unless Termtter::Client.find_command(command)
execute_command(command)
return
end
end
execute_command('update ' + message)
post @prefix, TOPIC, main_channel, message
rescue Exception => e
Termtter::Client.handle_error(e)
end