NotJohan
NotJohan

Reputation: 27

How to get tweets author with tweepy

I have a twitter bot which auto enters twitter giveaways, but most giveaways you need to tag and friend or 2, I have it so it follows, likes and retweets but i cannot get it to reply

if ("tag" in tweet.text or "TAG" or "reply"):
  try: 
     api.update_status('@' + tweet.author + '@example1, @example2')
  except Exception:
       pass

this does not work any ideas?

Upvotes: 2

Views: 2031

Answers (1)

Kamori
Kamori

Reputation: 356

You'll want to use tweet.author.name. Here is an example from a recent retweeting bot I made.

https://github.com/Kamori/ValorantLFM/blob/master/retweeter/valorantlfm.py#L92

Upvotes: 1

Related Questions