command4bot

A general purpose library for command-based iteraction made for bots


Keywords
command, bot
License
MIT
Install
pip install command4bot==0.4.1

Documentation

Command For Bot

PyPI PyPI - Wheel PyPI - Python Version

Run Tests codecov

Libraries.io dependency status for GitHub repo GitHub last commit PyPI - Downloads

Check Code Style pre-commit Code style: black Imports: isort

command4bot is a general purpose library for command-based iteraction made for bots.

Installation

pip install command4bot

Quick Start

from command4bot import CommandsManager

mgr = CommandsManager()

@mgr.command
def greet(payload):
    return f"Hello, {payload}!"

mgr.exec('greet John')  # 'Hello, John!'

Features

  • Register command with a simple decorator
  • Managing command open and closed status with ease
  • Automatically manage command's dependency (a.k.a. context) with its status
  • Fallback handlers if no command found

Documentation

⚠️ The documentation is still working in progress!

https://command4bot.readthedocs.io/en/latest/

Todo

  • Support for commands need interaction