Add a command for reloading commands.
This commit is contained in:
parent
16ac68caba
commit
b5ff36d688
2 changed files with 13 additions and 4 deletions
|
@ -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
|
||||
|
|
5
plugins/commands/reload.rb
Normal file
5
plugins/commands/reload.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
Client.register_command("reload") { |args|
|
||||
Client.reload_commands
|
||||
|
||||
"commands reloaded..."
|
||||
}
|
Loading…
Reference in a new issue