weavebot-telegram
Version:
Generic Telegram bot framework with command registration
50 lines (37 loc) • 894 B
Markdown
Telegram bot framework for @weavebot/core.
```bash
npm install @weavebot/telegram @weavebot/core telegraf
```
```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();
```
- Generic command registration system
- Integration with @weavebot/core processor
- Admin authorization support
- Built on Telegraf framework
MIT