chatterbot 1.0.2 → 2.0.0.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +2 -2
  3. data/LICENSE.txt +18 -9
  4. data/README.markdown +83 -65
  5. data/bin/chatterbot-register +0 -1
  6. data/chatterbot.gemspec +3 -10
  7. data/examples/class_bot.rb +0 -1
  8. data/examples/echoes_bot.rb +2 -2
  9. data/examples/search_bot.rb +1 -1
  10. data/examples/streaming_bot.rb +21 -15
  11. data/lib/chatterbot.rb +7 -12
  12. data/lib/chatterbot/blocklist.rb +61 -0
  13. data/lib/chatterbot/bot.rb +118 -13
  14. data/lib/chatterbot/client.rb +52 -20
  15. data/lib/chatterbot/config.rb +92 -215
  16. data/lib/chatterbot/config_manager.rb +49 -0
  17. data/lib/chatterbot/direct_messages.rb +46 -0
  18. data/lib/chatterbot/dsl.rb +157 -78
  19. data/lib/chatterbot/followers.rb +4 -0
  20. data/lib/chatterbot/handler.rb +29 -0
  21. data/lib/chatterbot/helpers.rb +14 -3
  22. data/lib/chatterbot/home_timeline.rb +5 -8
  23. data/lib/chatterbot/logging.rb +0 -17
  24. data/lib/chatterbot/profile.rb +0 -1
  25. data/lib/chatterbot/reply.rb +6 -11
  26. data/lib/chatterbot/retweet.rb +2 -6
  27. data/lib/chatterbot/safelist.rb +33 -0
  28. data/lib/chatterbot/search.rb +26 -16
  29. data/lib/chatterbot/skeleton.rb +7 -38
  30. data/lib/chatterbot/streaming.rb +26 -33
  31. data/lib/chatterbot/tweet.rb +0 -1
  32. data/lib/chatterbot/ui.rb +9 -2
  33. data/lib/chatterbot/utils.rb +13 -0
  34. data/lib/chatterbot/version.rb +1 -1
  35. data/spec/blocklist_spec.rb +170 -0
  36. data/spec/bot_spec.rb +83 -8
  37. data/spec/client_spec.rb +61 -7
  38. data/spec/config_manager_spec.rb +59 -0
  39. data/spec/config_spec.rb +33 -158
  40. data/spec/direct_messages_spec.rb +115 -0
  41. data/spec/dsl_spec.rb +95 -53
  42. data/spec/handler_spec.rb +27 -0
  43. data/spec/helpers_spec.rb +7 -11
  44. data/spec/home_timeline_spec.rb +42 -31
  45. data/spec/logging_spec.rb +0 -34
  46. data/spec/reply_spec.rb +10 -34
  47. data/spec/search_spec.rb +65 -6
  48. data/spec/spec_helper.rb +25 -1
  49. data/spec/streaming_spec.rb +56 -58
  50. data/spec/whitelist_spec.rb +10 -10
  51. data/specs.watchr +2 -4
  52. data/templates/skeleton.txt +148 -12
  53. metadata +20 -22
  54. data/bin/chatterbot-blacklist +0 -65
  55. data/bin/chatterbot-status +0 -55
  56. data/examples/loop_bot.rb +0 -44
  57. data/lib/chatterbot/blacklist.rb +0 -61
  58. data/lib/chatterbot/db.rb +0 -79
  59. data/lib/chatterbot/streaming_handler.rb +0 -96
  60. data/lib/chatterbot/whitelist.rb +0 -32
  61. data/spec/blacklist_spec.rb +0 -116
  62. data/spec/db_spec.rb +0 -53
  63. data/spec/streaming_handler_spec.rb +0 -78
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f47ae273235445119432cb12e637dddef93b7a60
4
- data.tar.gz: b16803b44e1e27ef85a14d87beaeea861e594d34
3
+ metadata.gz: 7333d751e027fb23ffd45e3df6a2602d271af411
4
+ data.tar.gz: 29e07ecf21574c314f0603a16b6f7b65cf2af4ce
5
5
  SHA512:
6
- metadata.gz: 37d91e3432c7585611b3999ae18cdae67281d6c9e6cf8e06d7803c987d1573990d98330fbf6856f7b0aaf2141d0a367e0e68cec2e7a83d9b5a700b82d9a25c8c
7
- data.tar.gz: 518a94f32455be84ccfa9932123820fb863b00bda64d81c1b434b621cf0c3d9acb669e85d7a1c24bfbf93c155246dd1adff52f0674a91ee9315be06e167b9c3a
6
+ metadata.gz: 92e31e5c24e929fe2ecca7e9a8f01b1bfdc9dfb56754817bd44ce3dcf29a2bf3beb5c8e1a259059e31b4bb1d6f005e1c5f795ac573cef52478711005dd55c2b2
7
+ data.tar.gz: ae42ada56f4635ea488e3996e3f7643aa5fcac79fd724a88512e0b4c39d3683189a3f9b21803411227464265981fb051f2697750ba23b4d7b74e38ea25e9eb9a
data/.travis.yml CHANGED
@@ -1,8 +1,8 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 1.9.2
4
- - 1.9.3
5
3
  - 2.0.0
6
4
  - 2.1.1
5
+ - 2.2.0
6
+ - ruby-head
7
7
  # uncomment this line if your project needs to run something other than `rake`:
8
8
  # script: bundle exec rspec spec
data/LICENSE.txt CHANGED
@@ -1,13 +1,22 @@
1
- DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
2
- Version 2, December 2004
1
+ The MIT License (MIT)
2
+ Copyright © 2015 Colin Mitchell, http://muffinlabs.com
3
3
 
4
- Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
4
+ Permission is hereby granted, free of charge, to any person obtaining
5
+ a copy of this software and associated documentation files (the
6
+ “Software”), to deal in the Software without restriction, including
7
+ without limitation the rights to use, copy, modify, merge, publish,
8
+ distribute, sublicense, and/or sell copies of the Software, and to
9
+ permit persons to whom the Software is furnished to do so, subject to
10
+ the following conditions:
5
11
 
6
- Everyone is permitted to copy and distribute verbatim or modified
7
- copies of this license document, and changing it is allowed as long
8
- as the name is changed.
12
+ The above copyright notice and this permission notice shall be
13
+ included in all copies or substantial portions of the Software.
9
14
 
10
- DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
11
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
15
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
16
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
19
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
20
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
21
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
12
22
 
13
- 0. You just DO WHAT THE FUCK YOU WANT TO.
data/README.markdown CHANGED
@@ -14,17 +14,20 @@ Features
14
14
  * Handles search queries and replies to your bot
15
15
  * Use a simple scripting language, or extend a Bot class if you need it
16
16
  * Wraps the Twitter gem so you have access to the entire Twitter API
17
- * Simple blacklistling system to limit your annoyance of users
17
+ * Simple blocklist system to limit your annoyance of users
18
18
  * Avoid your bot making a fool of itself by ignoring tweets with
19
19
  certain bad words
20
20
  * Basic Streaming API support
21
- * Optionally log tweets to the database for metrics and tracking purposes
22
21
 
23
22
 
24
23
  Using Chatterbot
25
24
  ================
26
25
 
27
- **NEW!!** Chatterbot has a [documentation website](http://muffinista.github.io/chatterbot/). It's a work-in-progress.
26
+ Chatterbot has a [documentation
27
+ website](http://muffinista.github.io/chatterbot/). It's a
28
+ work-in-progress. You can also read the [gem
29
+ documentation](http://www.rubydoc.info/gems/chatterbot/).
30
+
28
31
 
29
32
 
30
33
  Make a Twitter account
@@ -69,10 +72,13 @@ end
69
72
 
70
73
  Or you can write a bot using more traditional ruby classes, extend it if needed, and use it like so:
71
74
 
72
- bot = Chatterbot::Bot.new
73
- bot.search("'surely you must be joking'") do |tweet|
74
- bot.reply "@#{tweet_user(tweet)} I am serious, and don't call me Shirley!", tweet
75
+ class MyBot < Chatterbot::Bot
76
+ def do_stuff
77
+ search("'surely you must be joking'") do |tweet|
78
+ reply "@#{tweet_user(tweet)} I am serious, and don't call me Shirley!", tweet
79
+ end
75
80
  end
81
+ end
76
82
 
77
83
  Chatterbot can actually generate a template bot file for you, and will
78
84
  walk you through process of getting a bot authorized with Twitter.
@@ -82,7 +88,33 @@ That's it!
82
88
  Chatterbot uses the the Twitter gem
83
89
  (https://github.com/sferik/twitter) to handle the underlying API
84
90
  calls. Any calls to the search/reply methods will return
85
- Twitter::Status objects, which are basically extended hashes.
91
+ Twitter::Status objects, which are basically extended hashes. If you
92
+ find yourself pushing the limits of Chatterbot, it's very possible
93
+ that you should just be using the Twitter gem directly.
94
+
95
+ Streaming
96
+ ---------
97
+
98
+ Chatterbot has some basic support for the Streaming API. If you want
99
+ to do something complicated, you should probably consider using the
100
+ [Twitter gem](https://github.com/sferik/twitter#streaming) directly.
101
+
102
+ Basic usage is very straightforward:
103
+
104
+ streaming true
105
+ home_timeline do |tweet|
106
+ puts "someone i follow tweeted! #{tweet.text}"
107
+ end
108
+
109
+
110
+ You can also run a search:
111
+
112
+ streaming true
113
+ search("pizza") do |tweet|
114
+ puts "someone is talking about pizza! #{tweet.text}"
115
+ end
116
+
117
+
86
118
 
87
119
  What Can I Do?
88
120
  --------------
@@ -91,8 +123,8 @@ Here's a list of the important methods in the Chatterbot DSL:
91
123
 
92
124
  **search** -- You can use this to perform a search on Twitter:
93
125
 
94
- search("'surely you must be joking'") do |tweet|
95
- reply "@#{tweet_user(tweet)} I am serious, and don't call me Shirley!", tweet
126
+ search("pizza") do |tweet|
127
+ tweet "I just read another tweet about pizza"
96
128
  end
97
129
 
98
130
  **replies** -- Use this to check for replies and mentions:
@@ -101,14 +133,28 @@ Here's a list of the important methods in the Chatterbot DSL:
101
133
  reply "#USER# Thanks for contacting me!", tweet
102
134
  end
103
135
 
104
- Note that the string #USER# will be replaced with the username of the person who sent the original tweet.
136
+ Note that the string #USER# will be replaced with the username of the
137
+ person who sent the original tweet.
105
138
 
106
- **home_timeline** -- This call will return tweets from the bot's home timeline -- this will include tweets from accounts the bot follows, as well as the bot's own tweets:
139
+ **home_timeline** -- This call will return tweets from the bot's home
140
+ timeline -- this will include tweets from accounts the bot follows,
141
+ as well as the bot's own tweets:
142
+
107
143
  home_timeline do |tweet|
108
144
  puts tweet.text # this is the actual tweeted text
109
145
  favorite tweet # i like to fave tweets
110
146
  end
111
147
 
148
+ **direct_messages** -- This will return any DMs for the bot:
149
+
150
+ direct_messages do |dm|
151
+ puts dm.text
152
+
153
+ # send a DM back to the user
154
+ direct_message "Hey, I got your message at #{Time.now.to_s}", dm.sender
155
+ end
156
+
157
+
112
158
  **tweet** -- send a Tweet out for this bot:
113
159
 
114
160
  tweet "I AM A BOT!!!"
@@ -125,6 +171,12 @@ Note that the string #USER# will be replaced with the username of the person who
125
171
  end
126
172
  ```
127
173
 
174
+ **direct_message** -- send a DM to a user:
175
+
176
+ direct_message "I am a bot sending you a direct message", user
177
+
178
+ (NOTE: you'll need to make sure your bot has permission to send DMs)
179
+
128
180
  **blacklist** -- you can use this to specify a list of users you don't
129
181
  want to interact with. If you put the following line at the top of
130
182
  your bot:
@@ -150,7 +202,11 @@ precaution if you want to avoid spreading spam), you could call:
150
202
  **followers** -- get a list of your followers. This is an experimental
151
203
  feature but should work for most purposes.
152
204
 
153
- For more details, check out dsl.rb in the source code.
205
+ For more details, check out
206
+ [dsl.rb](https://github.com/muffinista/chatterbot/blob/master/lib/chatterbot/dsl.rb)
207
+ in the source code.
208
+
209
+
154
210
 
155
211
  Direct Client Access
156
212
  --------------------
@@ -168,11 +224,6 @@ users who DM you:
168
224
  Authorization
169
225
  -------------
170
226
 
171
- If you only want to use Chatterbot to search for tweets, it will work
172
- out of the box without any authorization. However, if you want to
173
- reply to tweets, or check for replies to your bot, you will have to
174
- jump through a few authorization hoops with Twitter.
175
-
176
227
  Before you setup a bot for the first time, you will need to register an
177
228
  application with Twitter. Twitter requires all API communication to be via an
178
229
  app which is registered on Twitter. I would set one up and make it
@@ -185,7 +236,7 @@ The helper script `chatterbot-register` will walk you through most of
185
236
  this without too much hand-wringing. And, if you write a bot without
186
237
  `chatterbot-register`, you'll still be sent through the authorization
187
238
  process the first time you run your script. But if you prefer, here's
188
- the instructions if you want to do it yourself:
239
+ sthe instructions if you want to do it yourself:
189
240
 
190
241
  1. [Setup your own app](https://twitter.com/apps/new) on Twitter.
191
242
 
@@ -222,6 +273,9 @@ your bot:
222
273
  1. Your credentials can be stored as variables in the script itself.
223
274
  `chatterbot-register` will do this for you. If your bot is using
224
275
  replies or searches, that data will be written to a YAML file.
276
+ **NOTE** this is a bad practice for scripts that are stored in a
277
+ source control system such as git, or are publicly available on a
278
+ site like github.
225
279
  2. In a YAML file with the same name as the bot, so if you have
226
280
  botname.rb or a Botname class, store your config in botname.yaml
227
281
  3. In a global config file at `/etc/chatterbot.yml` -- values stored here
@@ -231,14 +285,6 @@ your bot:
231
285
  5. In a `global.yml` file in the same directory as your bot. This
232
286
  gives you the ability to have a global configuration file, but keep
233
287
  it with your bots if desired.
234
- 6. In a database. You can store your configuration in a DB, and then
235
- specify the connection string either in one of the global config
236
- files by setting `:db_uri: postgres://username:password@host/database`, or on the command-line by using the `--db="db_uri"`
237
- configuration option. Any calls to the database are handled by the
238
- Sequel gem, and MySQL and Sqlite should work. The DB URI should
239
- be in the form of `mysql://username:password@host/database` -- see
240
- http://sequel.rubyforge.org/rdoc/files/doc/opening_databases_rdoc.html
241
- for details.
242
288
 
243
289
  Running Your Bot
244
290
  ----------------
@@ -251,6 +297,9 @@ Run it via cron. Here's an example of running a bot every two minutes
251
297
 
252
298
  */2 * * * * . ~/.bash_profile; cd /path/to/bot/; ./bot.rb
253
299
 
300
+
301
+
302
+
254
303
  Run it as a background process. Just put the guts of your bot in a loop like this:
255
304
 
256
305
  ```rb
@@ -265,38 +314,17 @@ loop do
265
314
  # do stuff
266
315
  end
267
316
 
268
- # explicitly update our config
269
- update_config
270
-
271
317
  sleep 60
272
318
  end
273
319
  ```
274
320
 
275
- **NOTE:** You need to call `update_config` to update the last tweet your script
276
- has processed -- if you don't have this call, you will get duplicate
277
- tweets.
278
-
279
-
280
- Database logging
281
- ----------------
282
-
283
- Chatterbot can log tweet activity to the database if desired. This
284
- can be handy for tracking what's going on with your bot. See
285
- `Chatterbot::Logging` for details on this.
286
-
287
321
 
288
322
  Blacklists
289
323
  ----------
290
324
 
291
325
  Not everyone wants to hear from your bot. To keep annoyances to a
292
- minimum, Chatterbot has a global blacklist option, as well as
293
- bot-specific blacklists if desired. The global blacklist is stored in
294
- the database, and you can add entries to it by using the
295
- `chatterbot-blacklist` script included with the gem.
326
+ minimum, Chatterbot has a simple blacklist tool. Using it is as simple as:
296
327
 
297
- You can also specify users to skip as part of the DSL:
298
-
299
- require 'chatterbot'
300
328
  blacklist "mean_user, private_user"
301
329
 
302
330
  You should really respect the wishes of users who don't want to hear
@@ -308,30 +336,20 @@ to ignore tweets with links, you could do something like this:
308
336
 
309
337
  exclude "http://"
310
338
 
311
- TODO
312
- ====
313
-
314
- * document DSL methods
315
- * document database setup
316
- * web-based frontend for tracking bot activity
317
- * opt-out system that adds people to blacklist if they reply to a bot
318
- in the right way
319
-
320
339
  Contributing to Chatterbot
321
340
  --------------------------
322
341
 
323
- Since this code is based off of actual Twitter bots, it's mostly
324
- working the way I want it to, and I might prefer to keep it that way.
325
- But please, if there are bugs or things you would like to improve,
326
- fork the project and hack away. I'll pull anything back that makes
327
- sense if requested.
328
-
342
+ Pull requests for bug fixes and new features are eagerly accepted.
343
+ Since this code is based off of actual Twitter bots, please try and
344
+ maintain compatability with the existing codebase. If you are
345
+ comfortable writing a spec for any changed code, please do so. If not,
346
+ I can work with you on that.
329
347
 
330
348
  Copyright/License
331
349
  -----------------
332
350
 
333
- Copyright (c) 2014 Colin Mitchell. Chatterbot is distributed under the
334
- WTFPL licence -- Please see LICENSE.txt for further details.
351
+ Copyright (c) 2015 Colin Mitchell. Chatterbot is distributed under the
352
+ MIT licence -- Please see LICENSE.txt for further details.
335
353
 
336
354
  http://muffinlabs.com
337
355
 
@@ -7,7 +7,6 @@ require 'optparse'
7
7
 
8
8
  include Chatterbot::Helpers
9
9
  include Chatterbot::Config
10
- include Chatterbot::DB
11
10
  include Chatterbot::Logging
12
11
 
13
12
  Chatterbot::from_helper = true
data/chatterbot.gemspec CHANGED
@@ -18,17 +18,10 @@ Gem::Specification.new do |s|
18
18
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
19
19
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
20
20
  s.require_paths = ["lib"]
21
- s.licenses = ["WTFPL"]
21
+ s.licenses = ["MIT"]
22
22
 
23
- if RUBY_VERSION < "1.9" || RUBY_VERSION == "1.9.2"
24
- s.add_dependency "activesupport", "~> 3.0.11"
25
- s.add_development_dependency(%q<redcarpet>, ["2.3.0"])
26
- s.add_development_dependency(%q<shoulda-matchers>, ["1.0.0"])
27
- else
28
- s.add_development_dependency(%q<redcarpet>, [">= 0"])
29
- end
30
-
31
- s.add_runtime_dependency(%q<oauth>, ["~> 0.4.7"])
23
+ s.add_development_dependency(%q<redcarpet>, [">= 0"])
24
+ s.add_runtime_dependency(%q<oauth>, [">= 0.4.7"])
32
25
  s.add_runtime_dependency(%q<twitter>, ["5.14.0"])
33
26
  s.add_runtime_dependency(%q<launchy>, [">= 2.4.2"])
34
27
  s.add_runtime_dependency(%q<colorize>, [">= 0.7.3"])
@@ -2,7 +2,6 @@
2
2
 
3
3
  require 'chatterbot'
4
4
 
5
-
6
5
  x = Chatterbot::Bot.new
7
6
  x.search("foo") do |tweet|
8
7
  puts tweet.inspect
@@ -19,14 +19,14 @@ puts "Loading echoes_bot.rb"
19
19
  ##
20
20
  exclude "http://"
21
21
 
22
- blacklist "mean_user, private_user"
22
+ blocklist "mean_user, private_user"
23
23
 
24
24
  puts "checking for replies to me"
25
25
  replies do |tweet|
26
26
  # replace the incoming username with #USER#, which will be replaced
27
27
  # with the handle of the user who tweeted us by the
28
28
  # replace_variables helper
29
- src = tweet[:text].gsub(/@echoes_bot/, "#USER#")
29
+ src = tweet.text.gsub(/@echoes_bot/, "#USER#")
30
30
 
31
31
  # send it back!
32
32
  reply src, tweet
@@ -14,7 +14,7 @@ puts "Loading search_bot.rb"
14
14
  ##
15
15
  exclude "http://"
16
16
 
17
- blacklist "mean_user, private_user"
17
+ blocklist "mean_user, private_user"
18
18
 
19
19
  search("twitter", :lang => "en") do |tweet|
20
20
  puts tweet[:text]
@@ -19,24 +19,30 @@ puts "Loading echoes_bot.rb using the streaming API"
19
19
 
20
20
  exclude "http://", "https://"
21
21
 
22
- blacklist "mean_user, private_user"
22
+ blocklist "mean_user, private_user"
23
23
 
24
- streaming do
25
- favorited do |user, tweet|
26
- reply "@#{user.screen_name} thanks for the fave!", tweet
27
- end
24
+ streaming true
28
25
 
29
- followed do |user|
30
- tweet "@#{user.screen_name} just followed me!"
31
- follow user
32
- end
26
+ favorited do |user, tweet|
27
+ reply "@#{user.screen_name} thanks for the fave!", tweet
28
+ end
29
+
30
+ followed do |user|
31
+ tweet "@#{user.screen_name} just followed me!"
32
+ follow user
33
+ end
33
34
 
34
- replies do |tweet|
35
- favorite tweet
35
+ replies do |tweet|
36
+ favorite tweet
37
+
38
+ puts "It's a tweet!"
39
+ src = tweet.text.gsub(/@echoes_bot/, "#USER#")
40
+ reply src, tweet
41
+ end
36
42
 
37
- puts "It's a tweet!"
38
- src = tweet.text.gsub(/@echoes_bot/, "#USER#")
39
- reply src, tweet
40
- end
43
+ direct_messages do |tweet|
44
+ puts "well, here i am #{tweet.text}"
45
+ puts tweet.inspect
46
+ direct_message "got it", tweet.sender
41
47
  end
42
48
 
data/lib/chatterbot.rb CHANGED
@@ -4,13 +4,6 @@ require 'twitter'
4
4
  require 'launchy'
5
5
  require 'colorize'
6
6
 
7
- #
8
- # Try and load Sequel, but don't freak out if it's not there
9
- begin
10
- require 'sequel'
11
- rescue Exception
12
- end
13
-
14
7
 
15
8
  #
16
9
  # extend Hash class to turn keys into symbols
@@ -34,33 +27,35 @@ module Chatterbot
34
27
  #
35
28
  # load in our assorted modules
36
29
  def self.load
30
+ require "chatterbot/config_manager"
37
31
  require "chatterbot/config"
38
- require "chatterbot/db"
39
32
  require "chatterbot/logging"
40
- require "chatterbot/blacklist"
41
- require "chatterbot/whitelist"
33
+ require "chatterbot/blocklist"
34
+ require "chatterbot/safelist"
42
35
  require "chatterbot/ui"
43
36
  require "chatterbot/client"
44
37
  require "chatterbot/search"
38
+ require "chatterbot/direct_messages"
45
39
  require "chatterbot/tweet"
46
40
  require "chatterbot/retweet"
47
41
  require "chatterbot/favorite"
48
42
  require "chatterbot/profile"
49
43
  require "chatterbot/reply"
50
44
  require "chatterbot/home_timeline"
51
- require "chatterbot/streaming"
52
- require "chatterbot/streaming_handler"
53
45
  require "chatterbot/followers"
54
46
  require "chatterbot/helpers"
55
47
  require "chatterbot/utils"
48
+ require "chatterbot/streaming"
56
49
 
57
50
  require "chatterbot/bot"
58
51
  end
59
52
 
53
+ # setter to track if we're being called from a helper script
60
54
  def self.from_helper=(x)
61
55
  @@from_helper = x
62
56
  end
63
57
 
58
+ # are we being called from a helper script?
64
59
  def self.from_helper
65
60
  @@from_helper
66
61
  end