D
D
Dvorak2016-08-17 17:59:01
Node.js
Dvorak, 2016-08-17 17:59:01

How to correctly set a welcome message for a Telegram bot?

Hello. I am writing a bot for telegram. I noticed that for all bots, when the message "/start" is displayed, a list of available commands is displayed. Can this be somehow set in the settings via BotFather? Or should I write something like this?

const TelegramBot = require('node-telegram-bot-api'),
      token = '',
      app = new TelegramBot(token, {polling:true});

app.on('message', (msg) => {
  switch(msg.text) {
    case '/start':
      //здесь код для отправки сообщения, содержащего все команды
    break;
  };
});

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
misc1, 2016-08-17
@allishappy

Telegram simply sends the /start command to the bot, and it must process it itself. Those. your choice is correct.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question