I use Tweepy to reply to certain Tweets as a bot on Twitter. I would like the reply to be addressed only to the author of the Tweet and not to any other users that may be mentioned in it.
Currently I use this to reply:
reply_status = api.update_status(status = 'tweet content', in_reply_to_status_id = tweet.id, auto_populate_reply_metadata=True)
This call replies to all users mentioned in the original tweet. I've noticed there is an exclude_reply_user_ids=
option in the update_status
function. This however requires a list of user IDs to exclude.
- How do I get a list of user IDs mentioned in a Tweet?
- Is there a simpler way to reply only to the author?
I would like to avoid having to write the username at the beginning of the Tweet, which I would need to do if I didn't use auto_populate_reply_metadata=True
(see this).