python-zulip-api/contrib_bots/bots/define
derAnfaenger 9b67e94ba8 bots: Fix unit tests not running in Vagrant.
`test-bots` would not run in Vagrant, displaying
the error "ValueError: no such test method in <class
'bots_test_lib.BotTestCase'>: runTest" This was due to
the `BotTestCase` class inheriting from the TestCase
class, even though it was not a unit test on its own.

This commit removes the inheritance of TestCase and
specifies `test_define` as the `runTest` method in
`TestDefineBot`.
2017-05-24 19:44:22 -07:00
..
assets contrib bots: Rename bots to follow a consistent pattern. 2017-03-14 13:29:19 -07:00
__init__.py tests: Add contrib_bots/test-bots file. 2017-05-24 13:13:03 -07:00
define.py bots: Switch define bot to use send_reply. 2017-05-23 17:02:03 -07:00
readme.md contrib bots: Rename bots to follow a consistent pattern. 2017-03-14 13:29:19 -07:00
test_define.py bots: Fix unit tests not running in Vagrant. 2017-05-24 19:44:22 -07:00

DefineBot

  • This is a bot that defines a word that the user inputs. Whenever the user inputs a message starting with '@define', the bot defines the word that follows.

  • The definitions are brought to the website using an API. The bot posts the definition of the word to the stream from which the user inputs the message. If the user inputs a word that does not exist or a word that is incorrect or is not in the dictionary, the definition is not displayed.

  • For example, if the user says "@define crash", all the meanings of crash appear, each in a separate line.

Correct Word

  • If the user enters a wrong word, like "@define cresh" or "@define crish", then an error message saying no definition is available is displayed.

Wrong Word