Commit Graph

65 Commits

Author SHA1 Message Date
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
Juan Verhook 4d500e626e interactive bots: Create your own virtual assistant 2017-01-13 07:22:04 -08:00
Maydha K dd23e09592 interactive bots: Create tic-tac-toe bot. 2017-01-12 17:26:19 -08:00
Jackson 591efe2d64 interactive bots: Add FourSquare bot and documentation. 2017-01-12 16:51:13 -08:00
royabouhamad aa14627b07 Interactive bots: Create a thesaurus bot. 2017-01-12 13:07:12 -08:00
Robert Hönig 8b6a28dfa6 Fix virtual_fs bot trying to read a directory
This commit prevents the bot from crashing when a command
like 'fs read /home' is entered. Instead, an error is
displayed.
2017-01-12 09:16:17 -08:00
Vamshi Balanaga a232060e18 docs: improve docs for contrib_bots. 2017-01-11 16:32:02 -08:00
Robert Hönig 639c4023bc Terminate run.py without throwing tracebacks.
Pressing control-c while run.py is being executed has terminated the
script, but threw an ugly traceback. To signal the user that his
method of exit was appropriate, we handle control-c calling exit(0).
2017-01-11 15:25:20 -08:00
Robert Hönig f9730e774a Rename the RestrictedClient class to BotHandlerApi
As a first step into restructuring the run.py layout to support a
worker and an API-wrapper class, we rename the RestrictedClient
class appropriately.
2017-01-11 15:25:20 -08:00
Robert Hönig 02bfb46398 Hide 'client' and 'rate_limit' from 'contrib_bots' bots.
'contribot_bots' should only provide a restricted access to the
client API, yet 'client' and 'rate_limit were fully exposed. While
not fully restricting access to those objects, this commits hides
them with prepending underscores.
2017-01-11 15:25:20 -08:00
Tim Abbott 6d3ea3f663 contrib_bots: Fix lint error in rate limiting code. 2017-01-10 15:10:17 -08:00
Robert Hönig 3efbadc37b Add a rate limit for bots in contrib_bots
To prevent bots from accidently entering an infinite message loop,
where they send messages as a reacting to their own messages,
this commit adds the RateLimit class to run.py. It specifies how
many messages can be sent in a given time interval. If this rate
is exceeded, run.py exits with an error.
Fixes #3210.
2017-01-10 13:42:40 -08:00
Uma dd8291bb50 Improved 'readme.md' file in contrib_bots/lib 2017-01-10 07:03:57 -08:00
Tim Abbott 3f8d4193da lint: Fix % comprehensions being used without a tuple. 2017-01-09 11:45:11 -08:00
Tommy Ip 7738edb62f contrib_bots: Fix bare except clause. 2017-01-08 16:25:22 -08:00
Tim Abbott 9289c75f54 contrib_bots: Wrap CommuteBot docs. 2017-01-05 14:58:06 -08:00
andrewallen00 b376875541 interactive bots: Create yoda translator bot 2017-01-05 11:24:24 -08:00
Robert Hönig f7c29f1b7f interactive bots: Create converter bot. 2016-12-29 19:28:35 +01:00
Yago González 497dc4756e interactive bots: Use dev API when in a dev setup.
Now the development API (which is inside the repo, api/) is used when the envionment is a development one.

Credits to Steve Howell (@showell) for the instructions on how to fix this.
2016-12-28 19:25:56 -08:00
Rafid Aslam 778e509464 interactive bots: Create xkcd bot. 2016-12-27 22:52:51 +01:00
Vamshi Balanaga 561562da3d Modify GitHub Issue bot to use new authentication module. 2016-12-27 11:58:36 -08:00
Vamshi Balanaga 9701d5e555 Modify GitHub comment bot to use new authentication module, and edit documentation accordingly. 2016-12-27 11:58:36 -08:00
Vamshi Balanaga 89d1f96db9 Create GitHub authentication module. 2016-12-27 11:58:36 -08:00
Rafid Aslam fd5c43341d interactive bots: Create Giphy bot 2016-12-26 09:38:50 -08:00
Rafid Aslam 947fdf0b37 contrib_bots: Expose some information about user profile
- Expose some information about user profile in `RestrictedClient`
class, like `full_name` and `email` of the user.

- Add `client` argument to `triage_message()`, now it's possible to
call bot with another method instead of calling the specified
keyword.
2016-12-26 09:38:50 -08:00
Abhay Kashyap 13a1425bb7 Created DefineBot and document and added them 2016-12-26 09:07:10 -08:00
Tommy Ip 654d9590ef interactive bots: Create Howdoi bot.
This bot allows users to search technical questions from Stack
Overflow.
2016-12-24 08:22:44 -08:00
Jackson 62f88aa776 interactive bots: Create CommuteBot. 2016-12-21 18:46:59 -08:00