Skip to content

Commit

Permalink
response.error seems to no longer be a thing
Browse files Browse the repository at this point in the history
  • Loading branch information
bgreenlee committed Jun 28, 2015
1 parent 19d433c commit 51e7e05
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions lib/mutetweets/client.rb
Expand Up @@ -73,15 +73,16 @@ def is_follower?(user)
def send_message(user, message)
# append the time to the message so twitter doesn't complain to us about duplicate statuses
message += " (at #{Time.now})"
if is_follower?(user)
logger.info "sending direct message to #{user.screen_name}: #{message}"
response = direct_message_create(user.screen_name, message)
else
logger.info "sending public message to #{user.screen_name}: #{message}"
response = update("@#{user.screen_name} #{message}")
end
if response.error
logger.error "error sending message: #{response['error']}"
begin
if is_follower?(user)
logger.info "sending direct message to #{user.screen_name}: #{message}"
response = direct_message_create(user.screen_name, message)
else
logger.info "sending public message to #{user.screen_name}: #{message}"
response = update("@#{user.screen_name} #{message}")
end
rescue Twitter::Error => e
logger.error "error sending message: #{e.message}"
end
end
end
Expand Down

0 comments on commit 51e7e05

Please sign in to comment.