Fix register_trigger calls.

configuration-in-hiera
Robert Gerus 2015-04-16 10:40:52 +02:00
parent fa8ee9d02e
commit 9ff54e0a06
4 changed files with 6 additions and 6 deletions

View File

@ -39,7 +39,7 @@ end
Client.load_commands
Client.register_trigger("PRIVMSG") { |msg|
Client.register_trigger("PRIVMSG", "commands") { |msg|
# who sent the message
src_nick = msg[:prefix].split('!').first
# what was it

View File

@ -1,7 +1,7 @@
include EventMachine::IRC::Commands
Client.register_trigger("PRIVMSG") { |msg|
Client.register_trigger("PRIVMSG", "mikrofalowka") { |msg|
nick = msg[:prefix].split('!').first
destination = msg[:params][0]
Client.privmsg(destination, "#{nick}: napraw mikrofalowke") if nick.match /[Bb].[Rr][Tt]/
Client.privmsg(destination, "#{nick}: napraw mikrofalowke") if nick.match(/[Bb].[Rr][Tt]/)
}

View File

@ -1,5 +1,5 @@
include EventMachine::IRC::Commands
Client.register_trigger("PRIVMSG") { |msg|
p msg
Client.register_trigger("PRIVMSG", "pretty_print") { |msg|
pp msg
}

View File

@ -32,7 +32,7 @@ end
DataMapper.auto_upgrade!
Client.register_trigger("PRIVMSG") do |msg|
Client.register_trigger("PRIVMSG", "scrape") do |msg|
titles = []
return 0 if msg[:params][1].nil?
msg[:params][1].split.each do |word|