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 deltabot_cli import BotCli, events

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.misc_send_text_message(accid, msg.chat_id, 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-3.0.0.tar.gz (20.9 kB view details)

Uploaded Source

Built Distribution

deltabot_cli-3.0.0-py3-none-any.whl (21.4 kB view details)

Uploaded Python 3

File details

Details for the file deltabot-cli-3.0.0.tar.gz.

File metadata

  • Download URL: deltabot-cli-3.0.0.tar.gz
  • Upload date:
  • Size: 20.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.1

File hashes

Hashes for deltabot-cli-3.0.0.tar.gz
Algorithm Hash digest
SHA256 0c934187be6a5c3a63bc4b19996c12f7bfc0dc990d9af749f4f8e3a67eeedc79
MD5 93cb613692cc125bebbf42627bc4efd4
BLAKE2b-256 9d5d2a87bf2446dbd5075b21e33c57010441a895b7a9b30fe9bbd1dca4d412cd

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for deltabot_cli-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 46df99a78ae2881176003135ae82abb133065084da67a898dbf57d9e9ff1e510
MD5 4474ae84ae87354af96729649868a2d6
BLAKE2b-256 bab05dfc70c6a6fa254b1665fcce3568bf44362286a3d94a36b50c36e1328ce5

See more details on using hashes here.

Provenance

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