Commit Graph

92 Commits

Author SHA1 Message Date
Tim Abbott ed82f6f3d0 contrib_bots: Fix lint errors in virtual_fs.py. 2017-05-23 21:35:09 -07:00
neiljp a859dadd29 contrib_bots: Clean up and document virtual_fs bot. 2017-05-23 21:04:34 -07:00
Abhijeet Kaur aa576d83b0 Refactor: Make StateHandler() function independent.
This refactor makes the nested class 'StateHandler' in the
file /contrib_bots/bot_lib.py independent class. It previously
was nested in 'run_message_handler_for_bot' function.

This is done to write a cleaner test file for contrib_bots using
mock library.
2017-05-23 20:42:09 -07:00
Theodore Chen 42f9cdcc78 bots: Fix googlesearch bot exceptions and add readme. 2017-05-23 20:18:24 -07:00
derAnfaenger 74069561f1 bots: Fix converter bot.
The converter bot depended on past.utils.old_div,
which is not supported anymore. Updating the code
to use the // operator, which provides the same
functionality.
2017-05-23 20:13:29 -07:00
neiljp fb9ea6b0d9 contrib_bots: Update xkcd bot to use send_reply.
This enables private message usage.
2017-05-23 18:43:43 -07:00
neiljp 62ac170880 contrib_bots: Remove triage_message() from help bot.
This completes removing triage_message from the tree.
2017-05-23 18:30:39 -07:00
neiljp 8b25766ff2 contrib_bots: Switch encrypt bot to use send_reply. 2017-05-23 17:32:51 -07:00
neiljp d766687632 bots: Switch define bot to use send_reply. 2017-05-23 17:02:03 -07:00
neiljp fe1fc45a9e bots: Fix help bot replies in private chat, including 3+ users.
Also deduplicates the code.
2017-05-23 14:38:49 -07:00
Theodore Chen d2090306ad bots: Add helloworld example bot. 2017-05-23 13:15:21 -07:00
neiljp 13649d8846 Factor out send_reply functionality into bot_lib 2017-05-23 12:40:08 -07:00
neiljp 66d8464d2c Update Wikipedia bot to reply to multiple user private chats. 2017-05-23 08:17:35 -07:00
Tim Abbott 454421e098 bot_lib: Fix indentation. 2017-05-23 08:17:22 -07:00
derAnfaenger 2e298d89ab bots: Strip leading whitespaces from bot queries. 2017-05-22 19:13:42 -07:00
derAnfaenger e74714f6ac bots: Clarify message handling for @-mentions. 2017-05-22 19:13:42 -07:00
derAnfaenger b90a5f60e2 bots: Allow empty bot queries.
This commit allows bots to be adressed with empty queries,
that is, by just @-mentioning them. @-mentioning is now the
only way to adress a bot.
2017-05-22 19:13:42 -07:00
Elliott Jin 759d4450c3 bots: Allow symlinks in bot paths provided to run.py.
run.py requires that the location of the provided bot matches the location
of run.py.  However, run.py previously failed in the case where the location
included a symlink.
2017-05-22 16:52:29 -07:00
Aditya Bansal acfb7c902a pep8: Add compliance with rule E261 to bots/define/define.py. 2017-05-07 23:21:50 -07:00
Yago González eb3304bf37 bots: Move Google search bot and fix bugs.
Now this bot follows our latest structure for contrib_bots.

Switched the dependencies instructions, to install "google" rather than
"google-api-python-client".

Added all the search terms to the query (not only the first one).
2017-03-17 13:03:06 -07:00
Tim Abbott a32dc12a4f lint: Fix PEP8 lint error in googlesearch.py. 2017-03-17 12:15:43 -07:00
royabouhamad 5aff3c7bf6 interactive bots: create a google bot. 2017-03-17 11:54:21 -07:00
Abhijeet Kaur c921736db2 contrib bots: Better error handling response in thesaurus. 2017-03-14 13:29:19 -07:00
Abhijeet Kaur 36bbad3c14 contrib bots: john bot can reply back in the same chat.
No need to create an extra "VirtualHelp" stream.
2017-03-14 13:29:19 -07:00
Abhijeet Kaur d90906c521 contrib bots: Edit code for uniformity.
Add one function (get_bot_botname_response()) that generates response
from the given input and replies back to the handle_message with the final
content of response to be sent. Also add code to bots(except followup) to
reply to private messages along with stream messages.
2017-03-14 13:29:19 -07:00
Abhijeet Kaur 57d026f4c9 contrib bots: Rename bots to follow a consistent pattern.
Files renamed with few changes to accomodate the change in
path name of files. Fix few "at-mention bot" errors in docs.
2017-03-14 13:29:19 -07:00
Abhijeet Kaur 6e28bc20c6 contrib bots: Rename bots to follow a consistent pattern.
Files renamed without any changes.
2017-03-14 13:29:19 -07:00
Umair Khan 3b05937e86 capitalization: Fix API Key in documentation. 2017-03-08 23:36:36 -08:00
Abhijeet Kaur b8341280e8 doc updates: Remove triage_message function from contrib-bots. 2017-03-07 22:23:11 -08:00
Abhijeet Kaur d2929b04ca Remove triage_message() function from all the contrib-bots.
To make all bots consistent add shared function in bot_lib.py
to check if this bot is called. All bots respond to at-mention of
the bot instead of their specific names.
2017-02-17 06:51:48 -08:00
Abhijeet Kaur b22e9a0dbf bug fix: Fix errors in "john" bot in contrib_bots.
Fix outdated code in "john.py" to use "OutputAdapter" module
in Chatterbot. Typecast Chatterbot response to string.
2017-02-10 06:44:03 -08:00
Abhijeet Kaur 87e8d9036f contrib_bots: Restructure bots to follow a consistent structure.
Now all the bots that are stored in contrib_bots are in the
same file/directory format.
The format is specified here #3427. Add tests.py file for encrypt_bot as well.
Fixes #3427.
2017-02-10 06:44:03 -08:00
Abhijeet Kaur ef72cf5c7c bug fix: Fix wikipedia bot in case no results are found.
Incorrect Index access in wikipedia.py resulted in IndexError and
wikipedia bot to crash for few queries. This causes the bug to be fixed.
Replaced url to avoid 2 redirects and enhance performance.
Fixes: #3508.
2017-02-09 12:20:51 -08:00
sinwar 71247048b4 bots: Use requests instead of unirest for Yoda bot.
Fixes #3500.
2017-02-06 22:07:38 -08:00
Yago González 1535739222 contrib_bots: Fix typos and repetitions in the readme. 2017-01-27 16:39:19 -08:00
Tim Abbott 4e171ce787 lint: Clean up E126 PEP-8 rule. 2017-01-23 22:06:13 -08:00
Tim Abbott de99f48ce7 lint: Clean up E401 PEP-8 rule. 2017-01-23 21:36:39 -08:00
Tim Abbott d6e38e2a5c lint: Clean up E123 PEP-8 rule. 2017-01-23 21:34:26 -08:00
Tim Abbott 9640a9e864 lint: Clean up E712 PEP-8 rule. 2017-01-23 21:11:18 -08:00
Tim Abbott e5daec46ec lint: Clean up E306 PEP-8 rule. 2017-01-23 21:05:08 -08:00
Tim Abbott e9158dd520 lint: Clean up E121 PEP-8 rule. 2017-01-23 21:02:39 -08:00
Tim Abbott 22d1aa396b lint: Clean up W503 PEP-8 warning. 2017-01-23 20:50:04 -08:00
Tim Abbott bde2da7dfd lint: clean up PEP-8 W391 rule. 2017-01-23 20:39:02 -08:00
Steve Howell b37203cc83 Fix lint error w/ClientDummy. 2017-01-22 05:51:33 -08:00
Robert Hönig bef93959d3 Restructure converter bot.
Apply the new layout for 'contrib_bots' bots to the converter bot
to make it an exemplary model for new bots.
2017-01-22 05:42:46 -08:00
Robert Hönig 4415d6085f Restructure contrib_bots bots to new layout.
In order to make the layout of all bots consistent, this commit
moves each bot into a folder with its name and modifies 'run.py'
so that only bots with such a structure can be executed. 'lib'
gets renamed to 'bots'.
2017-01-22 05:42:46 -08:00
ParthMahawar c0fdc451a0 interactive bots: create EncryptBot bot 2017-01-17 09:13:33 -08:00
Robert Hönig effaa75625 Improve virtual_fs.py bot.
This commit fixes a bug with deleting directories,
prettifies the program's path output, and adds the
commands 'cd' (without 'cd ..') , 'rmdir' and 'pwd'.
2017-01-17 08:00:56 -08:00
Steve Howell 44233cef4b Extract contrib_bots/bot_lib.py from run.py.
Splitting out some of the bot functions into a library
will make it easier for heavily customized bots to have
their own version of run.py, instead of the shared one
that we use for everyone now.  If they use bot_lib.py
directly, they will still most likely conform to
the "Handler" interface as long as they call
run_message_handler_for_bot.

Most bots should continue to use contrib_bots/run.py
for now.
2017-01-14 12:44:50 -08:00
Robert Hönig b8fbfe305f Remove superfluous comment in triage_message(). (#3291) 2017-01-13 10:21:45 -08:00