Two plugins. Nothing useful.

master
Robert "ar" Gerus 2013-06-04 21:31:27 +02:00
parent 0ec057d23b
commit 01d8a64ebb
2 changed files with 32 additions and 0 deletions

27
plugins/commands.rb Normal file
View File

@ -0,0 +1,27 @@
include EventMachine::IRC::Commands
repost.register_trigger("PRIVMSG") { |msg|
src_nick = msg[:prefix].split('!').first
message = msg[:params][1]
if msg[:params][0] == Config[:client][:nick] then
target = src_nick
reply_prefix = ""
else
target = msg[:params][0]
reply_prefix = "#{src_nick}: "
end
if message.split.first == Config[:client][:nick] + ":" then
command = message.split[1]
arguments = message.split[2..-1]
else
if message.split.first[0] == ":" then
command = message.split.first[1..-1]
arguments = message.split[1..-1]
end
end
repost.privmsg(target, "#{reply_prefix}command: #{command} arguments: #{arguments.join(' ')}")
}

5
plugins/pretty_print.rb Normal file
View File

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