weavebot-telegram
v0.1.1
Published
Generic Telegram bot framework with command registration
Downloads
2
Maintainers
Readme
@weavebot/telegram
Telegram bot framework for @weavebot/core.
Installation
npm install @weavebot/telegram @weavebot/core telegrafUsage
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
