V
V
vadimeasy2021-10-06 10:47:27
Python
vadimeasy, 2021-10-06 10:47:27

How to name a button in a telegram bot so that it works as a command?

Hello, I have a bot in which the function is implemented by the team. Is it possible to add a name for the team. The button looks like this: 615d5420c7e49432869200.png
And it is necessary for the fucking bot to send /WhatsApp, and in the menu the button should be like Write to WA. Tell me how to do it?

def number(message):
    bot.send_message(message.chat.id, f'Вот твоя ссылка: http://api.whatsapp.com/send/?phone={message.text}')

@bot.message_handler(commands=['WhatsApp'])
def welcom(message):
        bot.send_message(message.chat.id, 'Отправь номер телефона')
        bot.register_next_step_handler(message, number)

This is a function.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
robprane, 2021-10-06
@robprane

This is implemented via callback_data in InlineKeyboardButton. In ReplyKeyboardMarkup, this will not work.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question