Skip to main content

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
Facebook
Twilio (SMS)
Whatsapp

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

botgen-0.0.2.tar.gz (5.5 kB view hashes)

Uploaded Source

Built Distribution

botgen-0.0.2-py3-none-any.whl (7.3 kB view hashes)

Uploaded Python 3

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