On this page
Quick Start
En pocos minutos tendras tu bot funcionando.
1. Obtener Credenciales
- API ID/Hash: my.telegram.org
- Bot Token: @BotFather
2. Crear el Bot
bot.js
const Zerogram = require('zerogramjs'); const bot = new Zerogram( API_ID, API_HASH, 'bot:TOKEN' ); await bot.init(); bot.command('start', async (ctx) => { await ctx.reply('Hola! Soy tu bot'); });
3. Ejecutar
Bash
node bot.jsComandos con Argumentos
JavaScript
bot.command('echo', async (ctx, args) => { await ctx.reply(args.join(' ')); });