set_my_commands usage example? #3800
Answered
by
harshil21
Melistraza
asked this question in
Q&A
-
Is there any explanation how to define command from code source? With telegram.Bot.set_my_commands Let's imagine we have simple bot from telegram.ext import Application
from telegram.ext import CommandHandler
def run_polling():
application = Application.builder().token(TELEGRAM_TOKEN).build()
application.add_handler(CommandHandler('start', start))
application.run_polling()
if __name__ == "__main__":
run_polling() I have tried a lot of different approaches and tried to get |
Beta Was this translation helpful? Give feedback.
Answered by
harshil21
Jul 15, 2023
Replies: 1 comment 2 replies
-
you are looking for telegram.ext.Application.post_init |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You'll find that exact code snippet in https://docs.python-telegram-bot.org/en/stable/telegram.ext.applicationbuilder.html#telegram.ext.ApplicationBuilder.post_init