Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个问题,如何编辑全局文字但仅限于一个用户?我的意思是,假设一条消息,我如何才能在不使用“if user.id == 111:”的情况下只为一个人编辑消息,我正在寻找一种方法来做到这一点,就像通过机器人作为管理员一样,它在 Telebot,蟒蛇
也许你应该尝试像这样平滑:
@bot.message_handler(func=lambda message: message.chat.id == <userid>) def <yourFuncName>(message): answer = 'Your changed text' bot.edit_message_text(chat_id=message.chat.id, message_id=message.message_id, text=answer)