我想回答我的消息或其他用户,但我坚持错误。
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.")
ExtBot
类没有名为 reply_to
的方法。您可能正在寻找 Message.reply_text
或 Bot.send_message
.
免责声明:我目前是
python-telegram-bot
.的维护者