diff --git a/plugins/commands.rb b/plugins/commands.rb index 12350fb..a6143cd 100644 --- a/plugins/commands.rb +++ b/plugins/commands.rb @@ -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 diff --git a/plugins/commands/reload.rb b/plugins/commands/reload.rb new file mode 100644 index 0000000..c67b0ab --- /dev/null +++ b/plugins/commands/reload.rb @@ -0,0 +1,5 @@ +Client.register_command("reload") { |args| + Client.reload_commands + + "commands reloaded..." +}