Python 客户端按下inlinekeyboardbutton后如何调用函数?

Python 客户端按下inlinekeyboardbutton后如何调用函数?,python,python-telegram-bot,Python,Python Telegram Bot,在客户端用callback\u data1按下inlinekeyboard按钮后,我需要调用Add()函数 我该怎么做 query = update.callback_query if (query.data == '1'): # call Add() function 使用回调查询处理程序 from telebot import * bot = TeleBot(token) @bot.callback_query_handler(func=lambda quer

在客户端用
callback\u data
1按下
inlinekeyboard按钮后,我需要调用
Add()
函数

我该怎么做

query = update.callback_query

    if (query.data == '1'):
        # call Add() function

使用回调查询处理程序

from telebot import *

bot = TeleBot(token)

@bot.callback_query_handler(func=lambda query: 1 == query.data)
def add(query):
    pass