lib/chatterbot/tweet.rb in chatterbot-0.5.1 vs lib/chatterbot/tweet.rb in chatterbot-0.6.1
- old
+ new
@@ -1,11 +1,10 @@
module Chatterbot
#
# routines for sending tweets
module Tweet
-
# simple wrapper for sending a message
def tweet(txt, params = {}, original = nil)
return if require_login == false
txt = replace_variables(txt, original)
@@ -15,14 +14,17 @@
else
debug txt
log txt, original
client.update txt, params
end
- end
+ rescue Twitter::Error::Forbidden => e
+ debug e
+ false
+ end
# reply to a tweet
def reply(txt, source)
debug txt
- self.tweet txt, {:in_reply_to_status_id => source[:id]}, source
- end
+ tweet txt, {:in_reply_to_status_id => source[:id]}, source
+ end
end
end