Skip to content

Instantly share code, notes, and snippets.

@roberthoenig
Last active January 14, 2017 15:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roberthoenig/4ef5169b2d5797cd2562f274b6b23cbc to your computer and use it in GitHub Desktop.
Save roberthoenig/4ef5169b2d5797cd2562f274b6b23cbc to your computer and use it in GitHub Desktop.
Discuss the next phase and development goals for Zulip bots

Note

The ideas mentioned here mostly originated from discussions on the Zulip chat Feel free to discuss their implementation there, or add improvements of these ideas, or new ideas in the comments.

Structuring proposals

Rename contrib_bots

Problem

To me, contrib_bots sounds like contribute bots, which is definitely adequate for GCI. It is, however, not a precise description of contrib_bots distinction from bots (which is the limited API).

Proposal

We could rename contrib_bots to something like bots_limited, limited_bots, etc.

Structure of bots

Right now, the structure of bots is a little unclear; some have an additional folder while some only have a singular .py file. To make things consistent, I propose:

  • One directory python, containing all <bot>.py files.
  • One directory help, containing for each bot:
  • A file <bot>_help.md (for user docs)
  • A file <bot>_info.txt (displayed when executing the bot)
  • One directory config, containing for each bot:
  • A file <bot>_config.md, the config file for run.py
  • One directory assets, containing for each bot:
  • One directory <bot> (can be left empty, but should exist), containing:
  • All images, dependencies and additional resources the bot needs to function

Code of bots

  • Since contrib_bots are supposed to be simple and lightweight, a single .py file should be sufficient for each bot. If needed, additional, bot specific small libraries and frameworks can be added in the bot's assets.

  • A bot's <bot>.py should be as lightweight as possible. Outsource list of names, numbers, etc. in the the assets directory for your bot. The info message, which is right now present in every <bot>.py should be outsources into <bot>_info.txt in the help directory, run.py should fetch those messages when executing a bot and print them to the console.

Feature proposals

Medium size goals

Manager bot

Disclaimer: this might be an overkill. Simpler solutions like a command-line run-bot script are probably preferable.

Problem

Right now, executing bots via running run.py <bot> --config-file <config-file> is a bit tedious. This procedure makes running multiple bots at once even harder, since the command needs to be reexecuted for every single bot.

Proposal

The idea of a manager bot has already been up in the chat, with people working on PRs for such a feature. A nice feature would be a "manager-bot", that executes, overviews and handles all the "worker bots". The manager bot could

  • be run with a single config file that contains API keys for every worker bot one wants to execute.
  • handle communication between bots
  • implement global security measures, e.g. rate limiting
Questions
  • Should the manager bot simply execute multiple instances of run.py (simple solution), or be built on run.py?

Game bots

Games are fun. So are game bots. For Zulip users who want to play a little, we have started to propose and create game bots, like the tic-tac-toe bot.

Proposal

To simplify and standardize their development, a central game bot manager would be of use. The game manager could provide a set of functions for game bots, like set_info(), set_state(), game_over(), etc.

For motivated contributors

Extend the game manager to support multiplayer games with 2 (or N?) Players.

Button support

Problem

Currently, bots have no graphical support, they can solely be accessed via chat. This makes accessing them harder, especially for new Zulipor infrequent Zulip users who don't read through all the docs.

######Solution Next to the compose box (or somewhere else), add a little interface for accessing bots. The interface should be accessible by all bots (or just selected bots?), meaning that a bot could register a new button/text-field there.

Big goals

Run bots via the Zulip interface

Problem

Right now, the bots in contrib_bots are idle, even though they add some great features (who wouldn't want to know what 13.2 acres are in square-feet?). This is mainly due to the, after all, developer focused run.py.

Solution

The manager bot mentioned early would already make deploying bots easier. In addition to that, one could implement a graphical interface in settings to quickly add/remove bots.

Questions
  • Should such an interface be accessible to the adminstrator only, or should we let users individually decide which bots to use and which not? What about a combination of both?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment