Answer the question
In order to leave comments, you need to log in
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
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 questionAsk a Question
731 491 924 answers to any question