BotProtocol
Defined in the protocols module.AI Agent Protocol for messaging bot implementations. Bots connect agents to messaging platforms, handling:
- Message receiving and sending
- Command handling
- Webhook/polling management
- User and channel management
or: from praisonai.bots import TelegramBot # wrapper shim
bot = TelegramBot(token=”…”, agent=my_agent) await bot.start()Methods
is_running()
Whether the bot is currently running.
platform()
Platform name (telegram, discord, slack, etc.).
bot_user()
The bot’s user information.
capabilities()
Channel capabilities for feature discovery.
platform_capabilities()
Platform capabilities descriptor.
start()
Start the bot (begin receiving messages).
stop()
Stop the bot.
set_agent()
Set the agent that handles messages.
get_agent()
Get the current agent.
send_message()
Send a message to a channel.
edit_message()
Edit an existing message.
delete_message()
Delete a message.
on_message()
Register a message handler.
on_command()
Decorator to register a command handler.
send_typing()
Send typing indicator to a channel.
add_reaction()
Add a reaction emoji to a message.
remove_reaction()
Remove a reaction emoji from a message.
get_user()
Get user information.
get_channel()
Get channel information.
probe()
Test channel connectivity without starting the bot.
health()
Get detailed health status of the running bot.
Source
View on GitHub
praisonaiagents/bots/protocols.py at line 844
