Add a command for reloading commands.

This commit is contained in:
Robert "ar" Gerus 2013-06-09 16:45:30 +02:00
parent 16ac68caba
commit b5ff36d688
2 changed files with 13 additions and 4 deletions

View file

@ -24,12 +24,16 @@ class Repost
99
end
def reload_commands
self.commands = []
Dir.glob(File.dirname($0) + "/plugins/commands/*.rb") { |filename|
load filename
}
end
end
# And here's where commands are actually loaded and registered
Dir.glob(File.dirname($0) + "/plugins/commands/*.rb") { |filename|
load filename
}
Client.reload_commands
Client.register_trigger("PRIVMSG") { |msg|
# who sent the message

View file

@ -0,0 +1,5 @@
Client.register_command("reload") { |args|
Client.reload_commands
"commands reloaded..."
}