UNPKG

weavebot-telegram

Version:

Generic Telegram bot framework with command registration

50 lines (37 loc) 894 B
# @weavebot/telegram Telegram bot framework for @weavebot/core. ## Installation ```bash npm install @weavebot/telegram @weavebot/core telegraf ``` ## Usage ```typescript import { TelegramBot } from '@weavebot/telegram'; import ContentProcessor from '@weavebot/core'; const processor = new ContentProcessor(); const bot = new TelegramBot({ botToken: process.env.TELEGRAM_BOT_TOKEN, processor: processor, authorizedAdmins: ['123456789'] }); // Register custom commands bot.registerCommand('mycommand', { command: 'mycommand', description: 'My custom command', async execute(context) { return { success: true, message: 'Command executed!' }; } }); // Start the bot bot.start(); ``` ## Features - Generic command registration system - Integration with @weavebot/core processor - Admin authorization support - Built on Telegraf framework ## License MIT