python-telegram-bot: AttributeError: 'ExtBot' 对象没有属性 'reply_to'

问题描述 投票:0回答:1

我想回答我的消息或其他用户,但我坚持错误。

await context.bot.reply_to(update.message, "NO.") AttributeError: 'ExtBot' 对象没有属性 'reply_to'

我试图通过 update.message 获取消息

async def lockdown(update: telegram.Update, context: ext.ContextTypes):
    sender_id = update.message.from_user.id
    if sender_id == 7472:
        print("YEA")  
    else:
        await context.bot.reply_to(update.message, "NO.")
python python-telegram-bot
1个回答
0
投票

没错。

ExtBot
类没有名为
reply_to
的方法。您可能正在寻找
Message.reply_text
Bot.send_message
.

请务必阅读PTB教程并查看示例


免责声明:我目前是

python-telegram-bot
.

的维护者
© www.soinside.com 2019 - 2024. All rights reserved.