Update existing plugins to use the new utils plugin.

This commit is contained in:
Major-
2014-08-09 17:12:25 +01:00
parent 17975206cb
commit c162705cd4
16 changed files with 79 additions and 98 deletions
+10 -4
View File
@@ -3,9 +3,15 @@
def valid_arg_length(args, length, player, message)
valid = length.kind_of?(Range) ? length.include?(args.length) : length == args.length
if (!valid)
player.send_message(message)
return false
player.send_message(message) if !valid
return valid
end
# Add a has_keys? method to hash
class Hash
def has_keys?(*keys)
keys.each { |key| return false unless has_key?(key) }
return true
end
return true
end