Sha256: 8b95971a0d0fdd7a64db2013946d9fe6dbc968f3602e5543f02908e8e1b75ef4

Contents?: true

Size: 529 Bytes

Versions: 6

Compression:

Stored size: 529 Bytes

Contents

module Chatterbot

  #
  # reply method for responding to tweets
  module Reply

    # handle replies for the bot
    def replies(&block)
      return unless require_login

      debug "check for replies since #{since_id}"

      opts = since_id > 0 ? {:since_id => since_id} : {}
      opts[:count] = 200

      results = client.mentions(opts)
      results.each { |s|
        unless ! block_given? || on_blacklist?(s) || skip_me?(s)
          update_since_id(s)
          yield s         
        end
      }
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
chatterbot-0.7.0 lib/chatterbot/reply.rb
chatterbot-0.6.6 lib/chatterbot/reply.rb
chatterbot-0.6.5 lib/chatterbot/reply.rb
chatterbot-0.6.3 lib/chatterbot/reply.rb
chatterbot-0.6.2 lib/chatterbot/reply.rb
chatterbot-0.6.1 lib/chatterbot/reply.rb