python-zulip-api/zulip_bots
PIG208 4bc0c607c1 bots: Find external packaged bots via 'zulip_bots.registry' entry_point.
Now we will be able to execute `zulip-run-bot` with the `-r` argument
to search for and run bots from the `zulip_bots.registry` entry_point.

Each entry point should have the name correspond to the bot name,
and have the value be the bot module. E.g, an Python package for a
bot called "packaged_bot" should have an `entry_points` setup like
the following:

setup(
    ...
    entry_points={
        "zulip_bot.registry":[
            "packaged_bot=packaged_bot.packaged_bot"
        ]
    }
    ...
)

whose file structure may look like this:

packaged_bot/
├───packaged_bot/
|   ├───packaged_bot.py  # The bot module
|   ├───test_packaged_bot.py
|   ├───packaged_bot.conf
|   └───doc.md
└───setup.py  # Register the entry points here

Add test case.
2021-07-29 11:08:31 -07:00
..
zulip_bots bots: Find external packaged bots via 'zulip_bots.registry' entry_point. 2021-07-29 11:08:31 -07:00
architecture.md zulip_bots: Update README.md. 2017-11-14 09:51:09 -08:00
README.md zulip_bots: Consolidate game-playing bots. 2018-01-22 11:30:31 -05:00
setup.py bots: Find external packaged bots via 'zulip_bots.registry' entry_point. 2021-07-29 11:08:31 -07:00

Zulip bots

This directory contains the source code for the zulip_bots PyPI package.

The Zulip documentation has guides on using Zulip's bot system and writing your own bots.

Directory structure

zulip_bots  # This directory
├───zulip_bots  # `zulip_bots` package.
│   ├───bots/  # Actively maintained and tested bots.
│   ├───bots_unmaintained/  # Unmaintained, potentially broken bots.
│   ├───game_handler.py  # Handles game-related bots.
│   ├───lib.py  # Backbone of run.py
│   ├───provision.py  # Creates a development environment.
│   ├───run.py  # Used to run bots.
│   ├───simple_lib.py  # Used for terminal testing.
│   ├───test_lib.py  # Backbone for bot unit tests.
│   ├───test_run.py  # Unit tests for run.py
│   └───terminal.py  # Used to test bots in the command line.
└───setup.py  # Script for packaging.