Python based developer toolkit to build bots
Project description
Python-based open source developer tool for building chat bots, apps and custom integrations for major messaging platforms.
This repository is inspired by the javascript library Botkit and the BotFramework SDK concepts.
Adapters
You can connect major plataforms using the same bot core code by setting different adapters. Adapter is a interface between your bot and message plataforms.
| Adapter | Docs | Availability |
|---|---|---|
| Web | 0.0.1 | |
| Slack | ||
| Telegram | ||
| Twilio (SMS) | ||
Usage
Installation
pip install botgen
Copy and paste the code below to a file called run.py
# run.py
from botgen import Bot
from botgen import BotMessage
from botgen import BotWorker
from botgen.adapters import WebAdapter
adapter = WebAdapter()
bot = Bot(adapter=adapter)
async def hello(bot_worker: BotWorker, message: BotMessage):
await bot_worker.say("hello from bot")
bot.hears(pattern="hello", event="message", handler=hello)
bot.start()
So you can run the project using:
python run.py
Then start a conversation:
curl -L -X POST 'http://localhost:8080/api/messages' -H 'Content-Type: application/json' -d '{
"user": "dummy",
"text": "hello",
"type": "message"
}'
How to contribute
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file botgen-0.0.2.tar.gz.
File metadata
- Download URL: botgen-0.0.2.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.11.8 Linux/6.5.0-1015-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c76ddb67d072462193da965c4aa322ab48535db3745754a1819a6a92822d8fb
|
|
| MD5 |
76a9ba2602dfff04d4e91b5b3876d751
|
|
| BLAKE2b-256 |
9debf719f14a609c0f086b83411fb242261add8c68dd016fd7110cced1aa5455
|
File details
Details for the file botgen-0.0.2-py3-none-any.whl.
File metadata
- Download URL: botgen-0.0.2-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.11.8 Linux/6.5.0-1015-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ba98fa6f23d53abe777367d52d352dae53df0a8071db67fea6be48e5969b262e
|
|
| MD5 |
477113adde6bc95b4802c7c8a8348d78
|
|
| BLAKE2b-256 |
33d74b5f6f2b54cc4bc35149f4567fd7a586eb5fce9349df44ef5401a2c3c658
|