Library to speedup Delta Chat bot development
Project description
deltabot-cli for Python
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
Release history Release notifications | RSS feed
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-2.0.0.tar.gz
(19.4 kB
view details)
Built Distribution
File details
Details for the file deltabot-cli-2.0.0.tar.gz
.
File metadata
- Download URL: deltabot-cli-2.0.0.tar.gz
- Upload date:
- Size: 19.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | df9b7d071436d1a4b7de2f2183dc149877676960b088a9dc7fcf0a0693cafffb |
|
MD5 | 0a5f09673e5ca775efad3ceb6096c0d9 |
|
BLAKE2b-256 | 986b6e6718449355692383ef3fef73a005a3dab2885778eb5323143108c32381 |
Provenance
File details
Details for the file deltabot_cli-2.0.0-py3-none-any.whl
.
File metadata
- Download URL: deltabot_cli-2.0.0-py3-none-any.whl
- Upload date:
- Size: 20.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 95387ec3d9c0df4b3b33350ea3a569cf1afb8d934377b6e13d55b230f3f5bd1d |
|
MD5 | 7ac8420d20534ee0f5cfd5c8637f71c9 |
|
BLAKE2b-256 | 7acdc3c0f667fe03a8907267ba583c2845c4ad135f134b2834c4ff111fbe130d |