I am trying to run the code from https://github.com/CreepyD246/Twitter-Reply-Bot/blob/main/TwitterReplyBot.py on Replit.
#Importing modules/libraries
import tweepy
import time
import os
# Initialization code
auth = tweepy.OAuthHandler(os.getenv("key2"),os.getenv("skey2"))
auth.set_access_token(os.getenv("token2"),os.getenv("stoken2"))
api = tweepy.API(auth)
# Some important variables which will be used later
bot_id = int(api.me().id_str)
#Other things after
But I get this error:
Traceback (most recent call last):
File "main.py", line 12, in <module>
bot_id = int(api.me().id_str)
AttributeError: 'API' object has no attribute 'me'
I don't find anything in the Tweepy's documentation about API.me() so what's wrong?
The Tweepy version is 4.1.0.
Tweepy v4.0.0 removed API.me.
You can use API.verify_credentials instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With