我如何在 tweepy 中提及某人?

How do I mention someone in tweepy?

我试图提及自己作为测试,但它不起作用。有人可以帮忙吗?

api.update_status(api.get_user(myaccountusername))

您需要将提及(使用用户 screen_name)定义为推文的一部分

api.update_status(f'@user1 @user2  check this out')

调用 api.get_user(myaccountusername) returns 完整的用户对象

User(_api=<tweepy.api.API object at 0x101cb39a0>, _json={'id': 3300744875, 
'id_str': '3300744875', 'name': 'Beppe Catanese', 'screen_name': 
'beppecatanese', 'location': 'Amsterdam, The Netherlands', 'profile_location': 
None, 'description': 
etc.. 
etc...