How to show options in telegram bot?

孤街浪徒 提交于 2019-12-12 07:28:56

问题


I want to write a bot telegram.How to put possible option in my bot.I insert a picture of sample bot with this functionality.


回答1:


For that, you have to talk to BotFather.

  1. In the Telegram App, open the chat with BotFather.

  2. Send him /setcommands. He will present you with a list of your bots.

  3. Pick the bot for which you want to set the command menu.

  4. Compose and send the command list. Using your image as an example, these 4 lines should do:

start - Description 1
menu - Description 2
help - Description 3
stop - Description 4

Note that each line should start with lowercase, and no slashes. There should also be spaces around the - sign.

Once you complete this process, exit and kill the Telegram App. Re-open it, go to the chat with your target bot, type a / (or tab on the / button next to the text field), the command menu should come up.



来源:https://stackoverflow.com/questions/34457568/how-to-show-options-in-telegram-bot

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!