python-zulip-api icon indicating copy to clipboard operation
python-zulip-api copied to clipboard

Bots: Add default (and other) command dispatch

Open neiljp opened this issue 7 years ago • 2 comments

This is an alternative implementation of #66 based on discussion in #integrations regarding perceived issues (@showell, @timabbott)

I avoided amending existing bots and instead added a demonstration as a 'helloworld_defaults' bot, which demonstrates the increasing features in subsequent commits:

  • empty ("") and "about" command responses
  • "commands" (uses default commands and those passed in)
  • "help" (default commands, and those passed in with help text)
  • allowing dispatch of all commands through the system
  • a decorator which can be applied to functions, to indicate the command name and help text, and which causes the function to be dispatched if the command matches.

I attempted to develop things in tandem in the test system, but am not fully satisfied with the current system (as per the comments in test_helloworld_defaults).

There is no doc.md file as yet for the new bot, though I can add this easily.

I'm completely open to renaming aspects of the system, but functionally it appears to work fine in tests and with zulip_bot_output.py (or did until I rebased, and now have some kind of storage error? @roberthoenig?)

neiljp avatar Nov 25 '17 06:11 neiljp

Heads up @neiljp, we just merged some commits that conflict with the changes your made in this pull request! You can review this repository's recent commits to see where the conflicts occur. Please rebase your feature branch against the upstream/master branch and resolve your pull request's merge conflicts accordingly.

zulipbot avatar Nov 29 '17 18:11 zulipbot

Heads up @neiljp, we just merged some commits that conflict with the changes your made in this pull request! You can review this repository's recent commits to see where the conflicts occur. Please rebase your feature branch against the upstream/master branch and resolve your pull request's merge conflicts accordingly.

zulipbot avatar Dec 08 '17 18:12 zulipbot