def unblock(user, reason = nil)
      params = {
        action: 'unblock',
        user: user
      }
      token = get_token
      params[:reason] = reason if reason
      params[:token] = token

      response = post(params)

      if response.key?('error')
        raise MediaWiki::Butt::BlockError.new(response.dig('error', 'code') || 'Unknown error code')
      end

      response['id'].to_i
    end
def unblock(user, reason = nil)
      params = {
        action: 'unblock',
        user: user
      }
      token = get_token
      params[:reason] = reason if reason
      params[:token] = token

      response = post(params)

      if response.key?('error')
        raise MediaWiki::Butt::BlockError.new(response.dig('error', 'code') || 'Unknown error code')
      end

      response['id'].to_i
    end
Unblocks the user.
 @param user [String] The user affected.
 @param reason [String] The reason to show in the block log.
 @see https://www.mediawiki.org/wiki/API:Block MediaWiki Block API Docs
 @since 0.5.0
 @raise [BlockError]
 @return [Fixnum] The block ID.