Installation and Setup
Installation and Setup
npm install multibot-telegram
// config.js module.exports = { type: 'multi', // or 'one' bots: [ { id: 1, token: 'your_bot_token_1', main: true }, { id: 2, token: 'your_bot_token_2', main: false } ], options: { commands: [ { command: 'start', description: 'Start command' }, { command: 'help', description: 'Help command' } ] } };// index.js const MultiBot = require('multibot-telegram'); const config = require('./config'); // Initialize MultiBot with the configuration const multiBot = new MultiBot(config); // Use the MultiBot instance to interact with your bots// globalManagerSetup.js (if needed) const globalManager = require('global-manager'); const { type, bots } = require('./config'); globalManager.set('type', type); globalManager.set('bots', bots);
Last updated