小编Rea*_*Rea的帖子

如何解决此错误:AttributeError:'NoneType'对象没有属性'reply_text'?

我有一个按钮,它应该返回ask_wikipedia函数,所以我使用了CallbackQueryHandler,但是当我想调用ask_wikipedia函数时,我收到一个属性错误!为什么?我该如何修复它?

def Click_Button(update, context) :
    query = update.callback_query
    if query.data == "Research":
        ask_wikipedia(update, context)

query_handler = CallbackQueryHandler(Click_Button)

dispatcher.add_handler(query_handler)



def ask_wikipedia(update, context)  :
    update.message.reply_text('What do you want to know about ? ')
    return About


Run Code Online (Sandbox Code Playgroud)

当我点击按钮时出现此错误

AttributeError: 'NoneType' object has no attribute 'reply_text'
Run Code Online (Sandbox Code Playgroud)

我该如何解决它?

python attributeerror telegram python-telegram-bot telegram-bot

5
推荐指数
1
解决办法
6096
查看次数