And some more comments for commands plugin.
This commit is contained in:
parent
f475f5b70c
commit
c6563eea1b
1 changed files with 3 additions and 0 deletions
|
@ -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? )
|
||||
|
|
Loading…
Reference in a new issue