E
E
ExVood2021-07-31 11:54:14
Bots
ExVood, 2021-07-31 11:54:14

How to make a start command to a bot?

Hello. I need to make the bot give a text message when the /start command is given. It seems possible through manybot but I can’t figure out how to do it. Tell me please. We need a simple bot that responds to start.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Michael, 2021-07-31
@lob4Noff

One way for Python , using the telebot module (installation - pip install pyTelegramBotAPI)
1) If you don't have a bot, create one using "Bot Father" ( https://t.me/BotFather )
2) Having a token, create *.py file, and paste the following template there for the simplest answer:

import telebot

token = '' #Вставьте Ваш токен, полученный от BotFather
bot = telebot.TeleBot(token)


@bot.message_handler(commands=['start']) #Для команды /start, можете изменить на любую другую
def start_join(message):
    bot.send_message(message.chat.id, text="Приветствую!")

bot.polling(none_stop=True) #Чтобы бот работал бесперебойно, пока запущена программа

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question