hello,
i made an ebook bot(randomization bot) and i managed to get all the code right but i have been getting this problem when i run the bot where it basically says that there are problems with the authentication of the twitter.api. My access tokens are put in correctly. Does anyone know what the problem could be??
Whatâs the exact error message and API endpoint youâre using? Are you sure your access tokens have the right permissions? (Read & Write if youâre tweeting)
Also, itâs a good idea to make sure your bot is easily identifiable as a bot, in your Twitter Name with a
emoji (it seems to be a popular convention) and in your description, pointing to the owner (your own account) thereâs a lot of good advice on https://botwiki.org/ in case you havenât come across that yet.
File âebooks.pyâ, line 158, in
handle_stats = api.GetUser(screen_name=user)
File â/app/.heroku/python/lib/python3.6/site-packages/twitter/api.pyâ, line 2868, in GetUser
resp = self._RequestUrl(url, âGETâ, data=parameters)
File â/app/.heroku/python/lib/python3.6/site-packages/twitter/api.pyâ, line 4959, in _RequestUrl
raise TwitterError(âThe twitter.Api instance must be authenticated.â)
twitter.error.TwitterError: The twitter.Api instance must be authenticated.
Thatâs the message error it gives me. And I have read and write permission activated.
And I dont know how changing the name and description can fix it but that might just be my naivete. Thanks
Looks like something is going wrong in how youâre authenticating - i canât really tell what exactly
Are you using https://github.com/tommeagher/heroku_ebooks/blob/master/ebooks.py by any chance?
If you are, a common error is replacing âMY_CONSUMER_KEYâ etc in the code, rather than setting up environment variable properly.
(Changing the name and description of your bot has nothing to do with your error but is generally good practice)
i am using that github. how do i set up the environment variable properly?
It really depends on what the code is running on, and how and where youâre deploying it (your laptop, heroku, something else)
Make sure youâre following https://github.com/tommeagher/heroku_ebooks/blob/master/README.md
It might be faster to get help in the botmaker https://botmakers.org/ slack or in the git repo Issues!
1 Like
system
closed
#7
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.