lib/chatterbot/client.rb
def login(do_update_config=true)
      if needs_api_key?
        get_api_key
      end

      if needs_auth_token?
        pin = get_oauth_verifier
        return false if pin.nil?


        begin
          # this will throw an error that we can try and catch
          @access_token = request_token.get_access_token(:oauth_verifier => pin.chomp)
          get_screen_name

          self.config[:access_token] = @access_token.token
          self.config[:access_token_secret] = @access_token.secret

          #update_config unless ! do_update_config
          reset_client

        rescue OAuth::Unauthorized => e
          display_oauth_error
          warn e.inspect
          return false
        end
      end

      return true
    end
def login(do_update_config=true)
      if needs_api_key?
        get_api_key
      end

      if needs_auth_token?
        pin = get_oauth_verifier
        return false if pin.nil?


        begin
          # this will throw an error that we can try and catch
          @access_token = request_token.get_access_token(:oauth_verifier => pin.chomp)
          get_screen_name

          self.config[:access_token] = @access_token.token
          self.config[:access_token_secret] = @access_token.secret

          #update_config unless ! do_update_config
          reset_client

        rescue OAuth::Unauthorized => e
          display_oauth_error
          warn e.inspect
          return false
        end
      end

      return true
    end
handle oauth for this request.  if the client isn't authorized, print
 out the auth URL and get a pin code back from the user
 If +do_update_config+ is false, don't udpate the bots config
 file after authorization. This defaults to true but
 chatterbot-register will pass in false because it does some
 other work before saving.