Skip to main content
Every PraisonAI bot comes with built-in chat commands. Just type a command in your chat — no setup required.

Built-in Commands

/status

Shows agent name, model, platform, and uptime.

/new

Resets the conversation session. Starts a fresh chat with the agent.

/help

Lists all available commands (built-in + custom) with descriptions.

Quick Start

1

Install PraisonAI

pip install praisonai
2

Set Your Bot Token

export TELEGRAM_BOT_TOKEN=your_token_here
3

Start the Bot

praisonai bot telegram --token $TELEGRAM_BOT_TOKEN
4

Send a Command

Open your bot chat and type:
/status
You’ll see the agent name, model, platform, and uptime.

Platform Examples

praisonai bot telegram --token $TELEGRAM_BOT_TOKEN

Command Details

/status

Shows current bot information:
FieldDescription
AgentName of the AI agent
ModelLLM model being used
Platformtelegram, discord, slack, or whatsapp
UptimeHow long the bot has been running
RunningWhether the bot is currently active

/new

Resets the conversation:
  • Clears all previous messages from the agent’s session
  • Replies with a confirmation message
  • Next message starts a completely new conversation

/help

Lists all available commands — both built-in and custom — with their descriptions.
Commands work the same way on all platforms — Telegram, Discord, Slack, and WhatsApp. The / prefix is the default command prefix.

Custom Commands

Register your own commands using register_command(). Available on all bot adapters.
from praisonai.bots import TelegramBot
from praisonaiagents import Agent

agent = Agent(name="assistant", instructions="Be helpful")
bot = TelegramBot(token="YOUR_TOKEN", agent=agent)

# Register a custom command
async def handle_ping(message):
    return "Pong! Bot is alive."

bot.register_command("ping", handle_ping, description="Check if bot is alive")

import asyncio
asyncio.run(bot.start())
# Now /ping is available alongside /status, /new, /help

register_command() API

bot.register_command(
    name="mycommand",           # Command name (without /)
    handler=my_handler,          # Async or sync callable
    description="What it does",  # Shown in /help
    usage="/mycommand <arg>",    # Optional usage string
    channels=["telegram"],       # Optional: restrict to specific platforms
)
ParameterTypeRequiredDescription
namestrYesCommand name without / prefix
handlerCallableYesFunction to call. Receives a BotMessage argument
descriptionstrNoHuman-readable description (shown in /help)
usagestrNoUsage example string
channelslist[str]NoRestrict to specific platforms (e.g., ["telegram", "slack"]). Empty = all platforms

list_commands()

Get all registered commands:
commands = bot.list_commands()
# Returns: [ChatCommandInfo(name="status", ...), ChatCommandInfo(name="new", ...), ...]

# Filter by platform
telegram_commands = bot.list_commands(platform="telegram")

Python Usage

Start bots programmatically — built-in commands are always available:
from praisonai.bots import TelegramBot
from praisonaiagents import Agent

agent = Agent(name="assistant", instructions="Be helpful")
bot = TelegramBot(token="YOUR_TOKEN", agent=agent)

import asyncio
asyncio.run(bot.start())
# /status, /new, /help available automatically
Bot tokens should never be hardcoded. Use environment variables or a .env file to store them securely.