And some more comments for commands plugin.

This commit is contained in:
Robert "ar" Gerus 2013-06-05 01:10:04 +02:00
parent f475f5b70c
commit c6563eea1b

View file

@ -13,6 +13,7 @@ class Repost
end
# And here's where commands are actually loaded and registered
Dir.glob(File.dirname($0) + "/plugins/commands/*.rb") { |filename|
load filename
}
@ -54,6 +55,8 @@ Client.register_trigger("PRIVMSG") { |msg|
Client.commands.each do |cmd|
# couldn't inline the if into second argument of Client.privmsg() call
if command.downcase == cmd[:keyword] then
# we actually expect for the command to return some message for
# for the user
Client.privmsg(target, reply_prefix + cmd[:code].call(arguments))
end
end if not ( Client.commands.nil? or command.nil? )