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 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
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-6.0.0.tar.gz
(13.1 kB
view details)
Built Distribution
File details
Details for the file deltabot-cli-6.0.0.tar.gz
.
File metadata
- Download URL: deltabot-cli-6.0.0.tar.gz
- Upload date:
- Size: 13.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ae4e07e4a91bfd8609dd452ab7d8587bbaee35fd73abfa91d6ebc517c1566a0 |
|
MD5 | 6f41b589e7c78428433a888d887499f0 |
|
BLAKE2b-256 | 30695956b8cc16ea5eab601140b805a68ee5cdf6d3fc94ac32c6a88a5d52d96a |
Provenance
File details
Details for the file deltabot_cli-6.0.0-py3-none-any.whl
.
File metadata
- Download URL: deltabot_cli-6.0.0-py3-none-any.whl
- Upload date:
- Size: 12.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ca2a6afa170818693204dcf12638a96a8d3c0ae9a737def3669d727afbb8a5b |
|
MD5 | 7938ee88a5cfdd8f514dd7caa0f31a0e |
|
BLAKE2b-256 | abc906317f3e0b69e9eff0ccd4e192d324bfdcad9f4c8ede53056dd639abefff |