Module: Chatterbot::Retweet

Included in:
Bot
Defined in:
lib/chatterbot/retweet.rb

Overview

routines for retweet

Instance Method Summary collapse

Instance Method Details

#retweet(id = @current_tweet) ⇒ Object

simple wrapper for retweeting a message tries to use the current tweet if available

Parameters:

  • id (id) (defaults to: @current_tweet)

    A tweet or the ID of a tweet. if not specified,



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/chatterbot/retweet.rb', line 9

def retweet(id=@current_tweet)
  return if  == false || id.nil?

  id = id_from_tweet(id)
  #:nocov:
  if debug_mode?
    debug "I'm in debug mode, otherwise I would retweet with tweet id: #{id}"
    return
  end
  #:nocov:
  
  client.retweet id
end