diff options
author | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2014-04-14 14:18:01 -0700 |
---|---|---|
committer | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2014-04-14 14:18:01 -0700 |
commit | 64cc3ddcea4c6c45298d6e5e65f6b0c74e4d9b0a (patch) | |
tree | 182a4565b48548e1cbd4e41a534efe26b50bb37b /admin.rb | |
parent | 29cc359a91d8f73f9a2f4e47646e691bfe117346 (diff) | |
download | dinobot-64cc3ddcea4c6c45298d6e5e65f6b0c74e4d9b0a.tar.gz dinobot-64cc3ddcea4c6c45298d6e5e65f6b0c74e4d9b0a.tar.xz |
Load/unload modules via admin commands.
Diffstat (limited to 'admin.rb')
-rw-r--r-- | admin.rb | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -5,7 +5,7 @@ module Dinobot def initialize super - @commands << :join << :part + @commands << :join << :part << :listadmins << :load << :unload @admins = Array.new end @@ -30,5 +30,21 @@ module Dinobot def part(user, channel, argument) [[:part, argument]] if is_admin?(user) end + + def listadmins(user, channel, argument) + [[:say, channel, @admins.join(' ')]] if is_admin?(user) + end + + def load(user, channel, argument) + argument.split.map do |x| + [:load_module, x.intern] + end + end + + def unload(user, channel, argument) + argument.split.map do |x| + [:unload_module, x.intern] + end + end end end |