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-3.2.1.tar.gz
(28.7 kB
view hashes)
Built Distribution
Close
Hashes for deltabot_cli-3.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86d291f3e2b3ec2b71c8e87dd823c08b9be7f0eecf7b3b0ef38d00284f847768 |
|
MD5 | ea0f3123f54046c56a2ce98cc5d3e057 |
|
BLAKE2b-256 | e961343815b5a24bc8b354521616729d8159b2ba2af063867eeab1c48e40209e |