command4bot
is a general purpose library for command-based iteraction made for bots.
pip install command4bot
from command4bot import CommandsManager
mgr = CommandsManager()
@mgr.command
def greet(payload):
return f"Hello, {payload}!"
mgr.exec('greet John') # 'Hello, John!'
- 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
https://command4bot.readthedocs.io/en/latest/
- Support for commands need interaction