examples/echoes_bot.rb in chatterbot-0.5.1 vs examples/echoes_bot.rb in chatterbot-0.6.1
- old
+ new
@@ -1,7 +1,11 @@
#!/usr/bin/env ruby
+## This is a very simple working example of a bot you can build with
+## chatterbot. It looks for mentions of '@echoes_bot' (the twitter
+## handle the bot uses), and sends replies with the name switched to
+## the handle of the sending user
#
# require the dsl lib to include all the methods you see below.
#
require 'rubygems'
@@ -17,13 +21,9 @@
blacklist "mean_user, private_user"
puts "checking for replies to me"
replies do |tweet|
-
- # replace the incoming username with the handle of the user who tweeted us
- # src = tweet[:text].gsub(/@echoes_bot/, tweet_user(tweet))
-
# replace the incoming username with #USER#, which will be replaced
# with the handle of the user who tweeted us by the
# replace_variables helper
src = tweet[:text].gsub(/@echoes_bot/, "#USER#")