Sha256: a9b9fa9fc41f8279a9c060858c0bc82820f7d1782bc1ec25950160eb257f8c31

Contents?: true

Size: 848 Bytes

Versions: 2

Compression:

Stored size: 848 Bytes

Contents

---
layout: page
title: "Running your Bot"
category: doc
---

There's a couple ways of running your bot:

Manually
--------

Run it on the command-line whenever you like. Whee!


Cron
----
Run it via cron.  Here's an example of running a bot every two minutes

    */2 * * * * . ~/.bash_profile; cd /path/to/bot/;  ./bot.rb

Looping
-------
Run it as a background process.  Just put the guts of your bot in a loop like this:

```rb
loop do
  search "twitter" do |tweet|
    # here you could do something with a tweet
    # if you want to retweet
    retweet(tweet[:id])
  end

  replies do |tweet|
    # do stuff
  end

  # explicitly update our config
  update_config

  sleep 60
end
```

**NOTE:** You need to call `update_config` to update the last tweet your script
has processed -- if you don't have this call, you will get duplicate
tweets.

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
chatterbot-2.2.0 docs/deploying.md
chatterbot-2.1.0 docs/deploying.md