Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

License Status Tests

Bot Specification Framework

botspec_banner BotSpec is a platform-independent framework for building chatbots from declarative YAML scenarios. Write your conversation flow once and run it on Telegram, MAX, and other messengers without changing your business logic.

Features

  • YAML-Based Bot Scenarios — define the bot's conversation flow in YAML.
  • Graceful UI Degradation: Messenger adapters take platform limitations into account. If the MAX messenger does not support native reply buttons, the adapter seamlessly converts them into inline buttons on its own. The logic of the scenario remains intact.
  • REST-like Router Mapping: Scenarios are divided into isolated router files with global paths. You can link files together and transition to states in other routers while completely avoiding state ID conflicts.
  • Dynamic UI with Jinja2: The built-in Jinja2 templating engine is embedded directly within YAML files.
  • Finite-State Conversation flows: states, transitions, branching and navigation between states and routers are handled by the engine.
  • Pluggable Session Storage & Isolation: User sessions are strictly separated by messaging apps.
  • Guard Pattern Actions: Complete separation of code from the interface using a special Python decorator. Functions work with standard Python data types and can control FSM transitions via return values.

Quick Start

Get your first platform-independent chatbot running in less than two minutes using the botspec CLI.

Installation

Install the framework:

pip install botspec

Initialize a New Project

Use build-in CLI tool to scaffold to production-ready project structure instantly.

botspec init my_awesome_bot

Configure Your Environment

Create and open .env file and fill your secrets:

TELEGRAM_BOT_TOKEN=Your API token

Run the Bot

About

A declarative framework for building Telegram, MAX and other chatbots using YAML scenarios.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages