T
T
tatsuki12021-09-03 14:59:41
Bots
tatsuki1, 2021-09-03 14:59:41

I have the same button names but different message, how to solve it?

Greetings. I am writing for a fan of the bot, and I decided to make mini information for one large project in sump. So, I have buttons for VK, Discord, Forum, and 3 server names, and for each name there are 3 links, I made Phoenix, I select it, I click on VK, the link is thrown, I select Tucson, I select VK, Phoenixa's link is thrown, although it is worth another link. That's what I'm getting at, how to make sure that the links are different, and the first link is not thrown.
ps I understand it was not clear, but as it is, if necessary, I will attach the code to the PM

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Krostelev, 2021-09-04
@tatsuki1

The bot does exactly what you described.

elif message.text == 'VK':
            bot.send_message(message.chat.id, 'Держите вашу ссылку: https://vk.com/arizona1phoenix')

Yes, there are still options with VK, but they simply won’t reach them anymore, they will stop at the first one.
To get started, I advise you to read the basics of programming, how conditional operators work. And by your code it is clear that you do not know what you are doing.
As you tighten up the basics, I advise you to switch to the Inline keyboard. With it, it will be much easier to solve your problem.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question