Skip to content

Instantly share code, notes, and snippets.

@veob
veob / setwebhook.js
Created January 30, 2020 10:21 — forked from imdkbj/setwebhook.js
Setup to listen telegram multiple bots on webhooks.
const axios = require('axios');
const apiurl = 'https://api.telegram.org/bot';
const serveraddress = 'https://yourdomain.com';
const tokens = ['3445345345:454545-iY_wE6wj_aKDJwKLXk', '453454545:gffgfgzbcfjhsdbflhjdsfvhjlvdsf'];
//set webhook
//you can make this as call as way you want.
webhookURL(tokens, 50, 8443, 'tgram');
async function webhookURL(bot_tokens, max_connections, port, from) {