lib/chatterbot/client.rb in chatterbot-2.0.0.pre vs lib/chatterbot/client.rb in chatterbot-2.0.2
- old
+ new
@@ -169,10 +169,11 @@
#
# query twitter for the bots screen name. we do this during the bot registration process
#
def get_screen_name(t = @access_token)
return unless @screen_name.nil?
+ return if t.nil?
oauth_response = t.get('/1.1/account/verify_credentials.json')
@screen_name = JSON.parse(oauth_response.body)["screen_name"]
end
@@ -196,13 +197,13 @@
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[:token] = @access_token.token
- self.config[:secret] = @access_token.secret
+ self.config[:access_token] = @access_token.token
+ self.config[:access_token_secret] = @access_token.secret
- update_config unless ! do_update_config
+ #update_config unless ! do_update_config
reset_client
rescue OAuth::Unauthorized => e
display_oauth_error
warn e.inspect