Commands
The Telegram interface implements a robust command system that handles user interactions through a type-safe, extensible architecture.
Command Architecture
Core Components
// Command Handler Interface
interface CommandHandler {
name: string;
description: string;
adminOnly?: boolean;
groupOnly?: boolean;
dmOnly?: boolean;
execute(context: CommandContext, agent: Agent): Promise<CommandResponse>;
}
// Command Context
interface CommandContext {
userId: number;
chatId: number;
args: string;
message: TelegramMessage;
telegram: Telegram;
}
// Command Response
interface CommandResponse {
text?: string;
success: boolean;
keyboard?: {
inline_keyboard: Array<Array<{
text: string;
url?: string;
callback_data?: string;
}>>;
};
}Command Registry
Available Commands
System Commands
1. Start Command
2. Help Command
3. Admin Command
Content Generation
1. Image Commands
2. Meme Command
3. Random Command
Market Data
1. DEX Command
2. Gecko Command
3. Ticker Command
Social Features
1. Tweet Command
2. Message Command
Agent Management
1. Model Command
2. Spawn Command
Command Implementation
1. Basic Command Structure
2. Command Registration
Command Execution Flow
Command Metrics
Error Handling
1. Command Errors
2. Rate Limiting
Best Practices
1. Command Design
2. Implementation
3. Security
Related Documentation
Last updated