I want create like this button. HOW?
@bot.message_handler(commands=["start", "help"])
I wrote the suggested words but they did not appear to the user like the attached image. What is the reason?
Is there something called a list in the library or something like that?
2
Answers
I found the answer by using @bot.message_handler() def welcome_message(message): c1 = types.BotCommand( command="start", description="Click to start the bot" ) # Create a command for the user to start the bot bot.set_my_commands([c1]) # Set the available commands bot.set_chat_menu_button( message.chat.id, types.MenuButtonCommands("commands")
You can talk to @BotFather and create a commands list for your bot.
How to:
(
command1 - Description
)You can actually programmatically do this as well. Please refer to the setMyCommands method.
Hope this helps!