I've been trying to set the list of commands for my telegram bot but it doesn't work, here's what I'm doing:
bot = telebot.TeleBot("TOKEN")
bot.set_my_commands(commands = ['start','go','help'])
bot.set_chat_menu_button(bot.get_me().id, types.MenuButtonCommands(type = 'commands'))
can anyone help me to figure it out? Thx anyway.
You have given bot.get_me().id which gives user_id of the bot. But it needs the chat_id. So give message.chat.id.
And the bot.set_my_commands() takes a list of BotCommands. But you have given an ordinary list.
Try:
c1 = types.BotCommand(command='start', description='Start the Bot')
c2 = types.BotCommand(command='help', description='Click for Help')
c3 = types.BotCommand(command='go', description='Something')
bot.set_my_commands([c1,c2,c3])
bot.set_chat_menu_button(message.chat.id, types.MenuButtonCommands('commands'))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With