lib/chatterbot/bot.rb in chatterbot-0.5.1 vs lib/chatterbot/bot.rb in chatterbot-0.6.1
- old
+ new
@@ -8,10 +8,11 @@
include Logging
include Search
include Tweet
include Retweet
include Reply
+ include UI
include Client
include DB
include Helpers
#
@@ -20,15 +21,21 @@
if params.has_key?(:name)
@botname = params.delete(:name)
end
@config = load_config(params)
-
- # update config when we exit
- at_exit do
- raise $! if $!
+
+ if reset_bot?
+ reset_since_id
update_config
- end
+ puts "Reset to #{@config[:since_id]}"
+ exit
+ else
+ # update config when we exit
+ at_exit do
+ raise $! if $!
+ update_config
+ end
+ end
end
-
end
end