skip to Main Content

How can I reply to a message after a command in Telebot API in python – Telegram API

I have this code.. import telebot #telegram API api_key = os.environ['Tele_API_key'] bot = telebot.TeleBot(api_key) @bot.message_handler(commands=['start']) def help_command(message): bot.send_message(chat.id,"send a message") @bot.message_handler(func = lambda msg: msg.text is not None and '/' not in msg.text) if message.text == "Hi": bot.send_message(chat.id,"Hello!") It sends…

VIEW QUESTION

PyTelegramBotApi – how to stop one function if other function is running? – Telegram API

I am trying to do an optional input, and have this code bot.send_chat_action(message.from_user.id, 'typing') markup = types.InlineKeyboardMarkup() markup.add(types.InlineKeyboardButton("Лечу только в одну сторону", callback_data="one_way")) msg = bot.send_message(message.from_user.id, '✅Хорошо. Теперь введите дату возвращения:', reply_markup=markup) bot.register_next_step_handler(msg, get_return_date) This code sends user a message…

VIEW QUESTION
Back To Top
Search