Open francescosave opened 1 week ago
In fastAPI server add telegram add_handler manage.
With telegram bot library use a messagehandler in add_handler method.
In messagehandler add None (is equal a filters.ALL) and callback function
For documentation: https://docs.python-telegram-bot.org/en/v21.3/telegram.ext.messagehandler.html
Application = Application.builder().token('YOUR TOKEN').build() Application.add_handler(CommandHandler('start', start)) Application.add_handler(MessageHandler(filters.ALL,hanle_message)) Application.run_polling()
calback start reply when use /start command in telegram calback hanle_message reply when write any message in telegram
how to do it in php?
In fastAPI server add telegram add_handler manage.
With telegram bot library use a messagehandler in add_handler method.
In messagehandler add None (is equal a filters.ALL) and callback function
For documentation: https://docs.python-telegram-bot.org/en/v21.3/telegram.ext.messagehandler.html
calback start reply when use /start command in telegram calback hanle_message reply when write any message in telegram