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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

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

Hashes for botgen-0.0.2.tar.gz
Algorithm Hash digest
SHA256 1c76ddb67d072462193da965c4aa322ab48535db3745754a1819a6a92822d8fb
MD5 76a9ba2602dfff04d4e91b5b3876d751
BLAKE2b-256 9debf719f14a609c0f086b83411fb242261add8c68dd016fd7110cced1aa5455

See more details on using hashes here.

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

Hashes for botgen-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ba98fa6f23d53abe777367d52d352dae53df0a8071db67fea6be48e5969b262e
MD5 477113adde6bc95b4802c7c8a8348d78
BLAKE2b-256 33d74b5f6f2b54cc4bc35149f4567fd7a586eb5fce9349df44ef5401a2c3c658

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page