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-8.1.2.tar.gz (14.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

deltabot_cli-8.1.2-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for deltabot_cli-8.1.2.tar.gz
Algorithm Hash digest
SHA256 62d10c5a524de008c12940d66813dca2e1bfcac1176df46a3f7cdc0ed1b5bf0a
MD5 5cb1effdebaaa517a40d88f8447ac773
BLAKE2b-256 3d90a70883819ccbcd047c03f652542d68bbbf816549dde7373b0153750faf77

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for deltabot_cli-8.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0c6dda131e670f8eaa8a8f7c006b7e57b0e0e90addba80b39751646520c6cf3e
MD5 9097b0ed6e1e5a08d0a8dc4658e451c3
BLAKE2b-256 2e814c470b006fb6e162fc62a199ca40cb4fa29abdc105ca4c64fa7caea904e8

See more details on using hashes here.

Supported by

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