Answer the question
In order to leave comments, you need to log in
How to put a telegram bot on VDS node.js that works on webhook?
Hello, I’ve been sitting here for 3 hours already, I drank 4 mugs of coffee and google hard! The last thing I write here, because the problem is really urgent.
I have a bot that doesn't want to work with telegram at all. Is there somewhere on the Internet a guide for installing a node.js bot on a VPS / VDS server, or anywhere, as long as it works! Help me please!
const TeleBot = require('telebot');
const bot = new TeleBot({
token: 'Токен', // Required. Telegram Bot API token.
webhook: { // Optional. Use webhook instead of polling.
url: 'https://vm1945277.nvme.had.yt', // HTTPS url to send updates to.
host: 'localhost', // Webhook server host.
port: 443, // Server port.
maxConnections: 40 // Optional. Maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery
}
});
bot.on('text', (msg) => msg.reply.text(msg.text));
bot.start();
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question