def arg_check(args, types = nil, server = nil)
      return args unless types

      args.each_with_index.map do |arg, i|
        next arg if types[i].nil? || types[i] == String

        if types[i] == Integer
          begin
            Integer(arg)
          rescue ArgumentError
            nil
          end
        elsif types[i] == Float
          begin
            Float(arg)
          rescue ArgumentError
            nil
          end
        elsif types[i] == Time
          begin
            Time.parse arg
          rescue ArgumentError
            nil
          end
        elsif types[i] == TrueClass || types[i] == FalseClass
          if arg.casecmp('true').zero? || arg.downcase.start_with?('y')
            true
          elsif arg.casecmp('false').zero? || arg.downcase.start_with?('n')
            false
          end
        elsif types[i] == Symbol
          arg.to_sym
        elsif types[i] == Encoding
          begin
            Encoding.find arg
          rescue ArgumentError
            nil
          end
        elsif types[i] == Regexp
          begin
            Regexp.new arg
          rescue ArgumentError
            nil
          end
        elsif types[i] == Rational
          begin
            Rational(arg)
          rescue ArgumentError
            nil
          end
        elsif types[i] == Range
          begin
            if arg.include? '...'
              Range.new(*arg.split('...').map(&:to_i), true)
            elsif arg.include? '..'
              Range.new(*arg.split('..').map(&:to_i))
            end
          rescue ArgumentError
            nil
          end
        elsif types[i] == NilClass
          nil
        elsif [Discordrb::User, Discordrb::Role, Discordrb::Emoji].include? types[i]
          result = parse_mention arg, server
          result if result.instance_of? types[i]
        elsif types[i] == Discordrb::Invite
          resolve_invite_code arg
        elsif types[i].respond_to?(:from_argument)
          begin
            types[i].from_argument arg
          rescue StandardError
            nil
          end
        else
          raise ArgumentError, "#{types[i]} doesn't implement from_argument"
        end
      end
    end
def arg_check(args, types = nil, server = nil)
      return args unless types

      args.each_with_index.map do |arg, i|
        next arg if types[i].nil? || types[i] == String

        if types[i] == Integer
          begin
            Integer(arg)
          rescue ArgumentError
            nil
          end
        elsif types[i] == Float
          begin
            Float(arg)
          rescue ArgumentError
            nil
          end
        elsif types[i] == Time
          begin
            Time.parse arg
          rescue ArgumentError
            nil
          end
        elsif types[i] == TrueClass || types[i] == FalseClass
          if arg.casecmp('true').zero? || arg.downcase.start_with?('y')
            true
          elsif arg.casecmp('false').zero? || arg.downcase.start_with?('n')
            false
          end
        elsif types[i] == Symbol
          arg.to_sym
        elsif types[i] == Encoding
          begin
            Encoding.find arg
          rescue ArgumentError
            nil
          end
        elsif types[i] == Regexp
          begin
            Regexp.new arg
          rescue ArgumentError
            nil
          end
        elsif types[i] == Rational
          begin
            Rational(arg)
          rescue ArgumentError
            nil
          end
        elsif types[i] == Range
          begin
            if arg.include? '...'
              Range.new(*arg.split('...').map(&:to_i), true)
            elsif arg.include? '..'
              Range.new(*arg.split('..').map(&:to_i))
            end
          rescue ArgumentError
            nil
          end
        elsif types[i] == NilClass
          nil
        elsif [Discordrb::User, Discordrb::Role, Discordrb::Emoji].include? types[i]
          result = parse_mention arg, server
          result if result.instance_of? types[i]
        elsif types[i] == Discordrb::Invite
          resolve_invite_code arg
        elsif types[i].respond_to?(:from_argument)
          begin
            types[i].from_argument arg
          rescue StandardError
            nil
          end
        else
          raise ArgumentError, "#{types[i]} doesn't implement from_argument"
        end
      end
    end
Transforms an array of string arguments based on types array.
 For example, `['1', '10..14']` with types `[Integer, Range]` would turn into `[1, 10..14]`.