Metadata-Version: 2.4
Name: deltabot-cli
Version: 9.1.0
Summary: Library to speedup Delta Chat bot development
Author-email: adbenitez <adb@arcanechat.me>
Project-URL: Homepage, https://github.com/deltachat-bot/deltabot-cli-py
Keywords: deltachat,bot,deltabot-cli
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python :: 3
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: deltachat2[full]>=1.0.2
Requires-Dist: appdirs>=1.4.4
Requires-Dist: rich>=12.6.0
Provides-Extra: dev
Requires-Dist: black; extra == "dev"
Requires-Dist: isort; extra == "dev"
Requires-Dist: prospector[with-mypy]; extra == "dev"
Provides-Extra: docs
Requires-Dist: Sphinx>=9.1.0; extra == "docs"
Dynamic: license-file

<p align="center"><img height="150px" width="auto" src="https://github.com/deltachat-bot/deltabot-cli-py/raw/main/docs/_static/logo.svg"></p>
<h1 align="center">deltabot-cli for Python</h1>

<p align="center">
  <a href="https://pypi.org/project/deltabot-cli">
    <img src="https://img.shields.io/pypi/v/deltabot-cli.svg" alt="Latest Release">
  </a>
  <a href="https://github.com/deltachat-bot/deltabot-cli-py/actions/workflows/python-ci.yml">
    <img src="https://github.com/deltachat-bot/deltabot-cli-py/actions/workflows/python-ci.yml/badge.svg" alt="CI">
  </a>
  <a href="https://github.com/psf/black">
    <img src="https://img.shields.io/badge/code%20style-black-000000.svg" alt="Code style: black">
  </a>
</p>

Library to speedup Delta Chat bot development.

With this library you can focus on writing your event/message processing logic and let us handle the
repetitive process of creating the bot CLI.

## Install

```sh
pip install deltabot-cli
```

## Usage

Example echo-bot written with deltabot-cli:

```python
from deltachat2 import MessageData, events
from deltabot_cli import BotCli

cli = BotCli("echobot")

@cli.on(events.RawEvent)
def log_event(bot, accid, event):
    bot.logger.info(event)

@cli.on(events.NewMessage)
def echo(bot, accid, event):
    msg = event.msg
    bot.rpc.send_msg(accid, msg.chat_id, MessageData(text=msg.text))

if __name__ == "__main__":
    cli.start()
```

If you run the above script you will have a bot CLI, that allows to configure and run a bot.
A progress bar is displayed while the bot is configuring, and logs are pretty-printed.

For more examples check the [examples](https://github.com/deltachat-bot/deltabot-cli-py/blob/main/examples) folder.
