I am coding an Python Telegram Bot with python-telegram-bot. I created a custom inline menu.
I want that the User could press a button and will get an picture. The send_photo function needs an instance of bot an update.
But I don't know how to pass that on to the CallBackQuery handler.
Does anyone have an idea how to solve it?
The send photo function:
def gvu(bot, update):
bot.send_photo(update.message.chat_id, photo=open('botpic/gvu.jpg', 'rb'))
The Handler in Main Routine:
updater.dispatcher.add_handler(CallbackQueryHandler(pattern="1", callback=gvu))
return self.callback(dispatcher.bot, update, **optional_args)
The error:
TypeError: callback_handler() got an unexpected keyword argument 'chat_data'