Skip to main content

Library to speedup Delta Chat bot development

Project description

deltabot-cli for Python

Latest Release CI Code style: black

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

pip install deltabot-cli

Usage

Example echo-bot written with deltabot-cli:

from deltachat2 import MsgData, 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, MsgData(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 folder.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

deltabot_cli-6.2.0.tar.gz (13.4 kB view details)

Uploaded Source

Built Distribution

deltabot_cli-6.2.0-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file deltabot_cli-6.2.0.tar.gz.

File metadata

  • Download URL: deltabot_cli-6.2.0.tar.gz
  • Upload date:
  • Size: 13.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.3

File hashes

Hashes for deltabot_cli-6.2.0.tar.gz
Algorithm Hash digest
SHA256 86a07e795f04a9d639bb1417ef8017d969a1b363bd55c84e984c5cc67f1a55d5
MD5 a8d0c66a42b727dd7052a935c43546e7
BLAKE2b-256 69b4f92ca898604a93c7c54ce2cb9ecb4d1e65d388dec58daba956e653b71d66

See more details on using hashes here.

File details

Details for the file deltabot_cli-6.2.0-py3-none-any.whl.

File metadata

  • Download URL: deltabot_cli-6.2.0-py3-none-any.whl
  • Upload date:
  • Size: 12.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.3

File hashes

Hashes for deltabot_cli-6.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e759c739ce64e35c87a04d7bae3a43b853b7d5f6617e061af74be3fa7af88adb
MD5 74aeb27317efcd0ea388241dde1b304c
BLAKE2b-256 fa997df8d07c5d6f0e80dddded5d4b49eef2b1a689fd71b5be234e2f07b7af90

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page