我的电报机器人可以与特定用户 (python) 互动吗?

Can my telegram bot interact with a specific user (python)?

我正在编写一个机器人,目的是惹恼我在 Telegram 中的一个朋友。我希望它只回复他。

例如:

有什么方法可以指定这样的限制吗?

因为你使用了相应的标签,我假设你使用的是python-telegram-bot库。在这种情况下,Filters.user that you can use in combination with MessageHandler 只回复一个特定用户:

dispatcher.add_handler(
    MessageHandler(
        Filters.user(your_friends_user_id),
        lambda update, _: update.effective_message.reply_text('Shut up!')
    )
)