chatterbot 1.0.2 → 2.0.0.pre
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +2 -2
- data/LICENSE.txt +18 -9
- data/README.markdown +83 -65
- data/bin/chatterbot-register +0 -1
- data/chatterbot.gemspec +3 -10
- data/examples/class_bot.rb +0 -1
- data/examples/echoes_bot.rb +2 -2
- data/examples/search_bot.rb +1 -1
- data/examples/streaming_bot.rb +21 -15
- data/lib/chatterbot.rb +7 -12
- data/lib/chatterbot/blocklist.rb +61 -0
- data/lib/chatterbot/bot.rb +118 -13
- data/lib/chatterbot/client.rb +52 -20
- data/lib/chatterbot/config.rb +92 -215
- data/lib/chatterbot/config_manager.rb +49 -0
- data/lib/chatterbot/direct_messages.rb +46 -0
- data/lib/chatterbot/dsl.rb +157 -78
- data/lib/chatterbot/followers.rb +4 -0
- data/lib/chatterbot/handler.rb +29 -0
- data/lib/chatterbot/helpers.rb +14 -3
- data/lib/chatterbot/home_timeline.rb +5 -8
- data/lib/chatterbot/logging.rb +0 -17
- data/lib/chatterbot/profile.rb +0 -1
- data/lib/chatterbot/reply.rb +6 -11
- data/lib/chatterbot/retweet.rb +2 -6
- data/lib/chatterbot/safelist.rb +33 -0
- data/lib/chatterbot/search.rb +26 -16
- data/lib/chatterbot/skeleton.rb +7 -38
- data/lib/chatterbot/streaming.rb +26 -33
- data/lib/chatterbot/tweet.rb +0 -1
- data/lib/chatterbot/ui.rb +9 -2
- data/lib/chatterbot/utils.rb +13 -0
- data/lib/chatterbot/version.rb +1 -1
- data/spec/blocklist_spec.rb +170 -0
- data/spec/bot_spec.rb +83 -8
- data/spec/client_spec.rb +61 -7
- data/spec/config_manager_spec.rb +59 -0
- data/spec/config_spec.rb +33 -158
- data/spec/direct_messages_spec.rb +115 -0
- data/spec/dsl_spec.rb +95 -53
- data/spec/handler_spec.rb +27 -0
- data/spec/helpers_spec.rb +7 -11
- data/spec/home_timeline_spec.rb +42 -31
- data/spec/logging_spec.rb +0 -34
- data/spec/reply_spec.rb +10 -34
- data/spec/search_spec.rb +65 -6
- data/spec/spec_helper.rb +25 -1
- data/spec/streaming_spec.rb +56 -58
- data/spec/whitelist_spec.rb +10 -10
- data/specs.watchr +2 -4
- data/templates/skeleton.txt +148 -12
- metadata +20 -22
- data/bin/chatterbot-blacklist +0 -65
- data/bin/chatterbot-status +0 -55
- data/examples/loop_bot.rb +0 -44
- data/lib/chatterbot/blacklist.rb +0 -61
- data/lib/chatterbot/db.rb +0 -79
- data/lib/chatterbot/streaming_handler.rb +0 -96
- data/lib/chatterbot/whitelist.rb +0 -32
- data/spec/blacklist_spec.rb +0 -116
- data/spec/db_spec.rb +0 -53
- data/spec/streaming_handler_spec.rb +0 -78
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7333d751e027fb23ffd45e3df6a2602d271af411
|
4
|
+
data.tar.gz: 29e07ecf21574c314f0603a16b6f7b65cf2af4ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 92e31e5c24e929fe2ecca7e9a8f01b1bfdc9dfb56754817bd44ce3dcf29a2bf3beb5c8e1a259059e31b4bb1d6f005e1c5f795ac573cef52478711005dd55c2b2
|
7
|
+
data.tar.gz: ae42ada56f4635ea488e3996e3f7643aa5fcac79fd724a88512e0b4c39d3683189a3f9b21803411227464265981fb051f2697750ba23b4d7b74e38ea25e9eb9a
|
data/.travis.yml
CHANGED
data/LICENSE.txt
CHANGED
@@ -1,13 +1,22 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
The MIT License (MIT)
|
2
|
+
Copyright © 2015 Colin Mitchell, http://muffinlabs.com
|
3
3
|
|
4
|
-
|
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
|
-
|
7
|
-
|
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
|
-
|
11
|
-
|
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
|
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
|
-
|
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
|
-
|
73
|
-
|
74
|
-
|
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("
|
95
|
-
|
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
|
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
|
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
|
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
|
-
|
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
|
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
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
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)
|
334
|
-
|
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
|
|
data/bin/chatterbot-register
CHANGED
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 = ["
|
21
|
+
s.licenses = ["MIT"]
|
22
22
|
|
23
|
-
|
24
|
-
|
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"])
|
data/examples/class_bot.rb
CHANGED
data/examples/echoes_bot.rb
CHANGED
@@ -19,14 +19,14 @@ puts "Loading echoes_bot.rb"
|
|
19
19
|
##
|
20
20
|
exclude "http://"
|
21
21
|
|
22
|
-
|
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
|
29
|
+
src = tweet.text.gsub(/@echoes_bot/, "#USER#")
|
30
30
|
|
31
31
|
# send it back!
|
32
32
|
reply src, tweet
|
data/examples/search_bot.rb
CHANGED
data/examples/streaming_bot.rb
CHANGED
@@ -19,24 +19,30 @@ puts "Loading echoes_bot.rb using the streaming API"
|
|
19
19
|
|
20
20
|
exclude "http://", "https://"
|
21
21
|
|
22
|
-
|
22
|
+
blocklist "mean_user, private_user"
|
23
23
|
|
24
|
-
streaming
|
25
|
-
favorited do |user, tweet|
|
26
|
-
reply "@#{user.screen_name} thanks for the fave!", tweet
|
27
|
-
end
|
24
|
+
streaming true
|
28
25
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
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
|
-
|
35
|
-
|
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
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
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/
|
41
|
-
require "chatterbot/
|
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
|