lib/twitter_ebooks/bot.rb
def mentions_bot?
      # To check if this is someone talking to us, ensure:
      # - The tweet mentions list contains our username
      # - The tweet is not being retweeted by somebody else
      # - Or soft-retweeted by somebody else
      @mentions.map(&:downcase).include?(@bot.username.downcase) && !@tweet.retweeted_status? && !@tweet.text.match(/([`'‘’"“”]|RT|via|by|from)\s*@/i)
    end
# Check whether this tweet mentions our bot
# @return [Boolean]
Check whether this tweet mentions our bot
Check whether this tweet mentions our bot
def mentions_bot?
      @mentions.map(&:downcase).include?(@bot.username.downcase) && !@tweet.retweeted_status? && !@tweet.text.match(/([`'‘’"“”]|RT|via|by|from)\s*@/i)
    end
def mentions_bot? @mentions . map ( & :downcase ) . include? ( @bot . username . downcase ) && ! @tweet . retweeted_status? && ! @tweet . text . match ( / ([`'‘’"“”]|RT|via|by|from)\s*@/i) end
Check whether this tweet mentions our bot
Check whether this tweet mentions our bot
# To check if this is someone talking to us, ensure: # - The tweet mentions list contains our username # - The tweet is not being retweeted by somebody else # - Or soft-retweeted by somebody else
None
Boolean