Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can AutoGPT post on Twitter also without Twitter-API /API-Key #2213

Closed
1 of 2 tasks
Bubble007 opened this issue Apr 17, 2023 · 17 comments
Closed
1 of 2 tasks

Can AutoGPT post on Twitter also without Twitter-API /API-Key #2213

Bubble007 opened this issue Apr 17, 2023 · 17 comments

Comments

@Bubble007
Copy link

Bubble007 commented Apr 17, 2023

⚠️ Search for existing issues first ⚠️

  • I have searched the existing issues, and there is no existing issue for my problem

GPT-3 or GPT-4

  • I am using Auto-GPT with GPT-3 (GPT-3.5)

Steps to reproduce 🕹

I made a little lovely AutoBot to work on a existing Twitter-account. I would like, if the bot could read and post on Twitter like human without API. But up to now he didn't get it. Is there a way?

Current behavior 😯

The Bot tried to send post with API. He couldn't and get an error. He has no API-Key, only the login-information for human user, but can't work with that.

Expected behavior 🤔

The bot can read and post on Twitter like human without API.

Your prompt 📝

# Paste your prompt here
@sjnt1
Copy link

sjnt1 commented Apr 17, 2023

Why dont you just get yourself a twitter API? They have a free option and you get it instantly, atleast for now the free version can both read and send tweets.

AutoGPT can now send tweets using the command send_tweet. Update to latest stable version of AutoGPT, Get your API keys and tokens, smash them in your .env file and you should be able to post on twitter with your existing twitter account. Will not be long until they add other functions i think.

I have no idea its its possible to get autogpt to login like a human but i doubt it. It cant browse twitter profiles with the browse command

@nostrodamus2023
Copy link

the twitter post feature seems to be not working. unless it only works with paid dev lvl 2 accounts.

@Bubble007
Copy link
Author

Bubble007 commented Apr 17, 2023 via email

@sjnt1
Copy link

sjnt1 commented Apr 17, 2023

Np. No as long as it dont spam tweets its ok and you shouldnt get banned. If you get that problem you can always use this method: #943 (reply in thread) and adjust the timer to whatever you want. Can be a bit tricky to set up.

@Bubble007
Copy link
Author

Bubble007 commented Apr 18, 2023 via email

@Bubble007
Copy link
Author

Bubble007 commented Apr 18, 2023 via email

@sjnt1
Copy link

sjnt1 commented Apr 18, 2023

Go to developer portal on twitter. Then you have to "create an app" in the developer portal. I think maybe you have to start a project to start an app, but i have an app without an project and that works for me.

Then go to your app and if you scan the page you shall se that there is an option to switch from "settings" to "keys and tokens"
This is right under the name of your app at the top of the page.

You shall find your keys and tokens there. You might have to regenerate or generate keys but you do everything on that page.

@Bubble007
Copy link
Author

To make everything right, I now got the credentials from the Twitter api and also entered them in the .env file and also reinstalled the AutoGPT in the latest version.

But the bot does not get access to Twitter - error message:

"NEXT ACTION: COMMAND = send_tweet ARGUMENTS = {'text': 'The Holy Bot says: '}
SYSTEM: Command send_tweet returned: Error: 'Forbidden' object has no attribute 'reason'".

@sjnt1
Copy link

sjnt1 commented Apr 18, 2023

Do you have autogpt v 2.0.1? https://github.com/Significant-Gravitas/Auto-GPT/releases/tag/v0.2.1

That version did so that autogpt did not work for me until i installed git from here https://git-scm.com/ . Dont forget to restart your computer. I also had some issues with the env.env file but i think that was just me doing it the wrong way. If you follow instructions in readme you should be fine.

@sjnt1
Copy link

sjnt1 commented Apr 18, 2023

Nvm you dont have the same issue i had so not sure that will fix your problem. I got the unknown command error .

You have some forbidden object stuff going on i see. From there its latin for me :)

@Bubble007
Copy link
Author

Thanks for the hints!
What coul be wrong?

  • I have git installed, it seems to work - is there a difference from where I installed it?
  • one stupid question: must I perhaps put the twitter-credentials in brackets in the .env-file?
  • is a free api-account of twitter not enough?
  • I got the warning at programm-start:"Warning: The file 'AutoGpt.json' does not exist. Local memory would not be saved to a file."

@sjnt1
Copy link

sjnt1 commented Apr 18, 2023

I dont know man.

As long as you are talking about git and not github i dont think it matters from where you downloaded it.

Not stupid question, but not brackets.

yes it should be enough. I send tweets trough free api. Dont know enough to answer what auth (api key v1 or 2) is being used, havent read up on that enough yet.

I did a quick search on your last issue with the autogpt.json message, and the soloution?

Install git.

from here: https://git-scm.com/

and restart your computer.

@Bubble007
Copy link
Author

Thanks a lot.
The issue with the autogpt.json message is gone with the new git installation.
But Twitter is not to surrender :-)

@sjnt1
Copy link

sjnt1 commented Apr 18, 2023

Have noe idea whats causing the twitter malfunction. Only thing i can think off is that maybe you mixed up the keys? I did that once and revoked all keys and put them in again. Make sure keys are keys and tokens are tokens, and that stuff gets put in the right place. What if you set the execute_local commands to True? I did that not sure if that had anything to do with it working

@rankofootball
Copy link

I had the same error and fixed that int the project settings -> user authentication settings:

App permissions: Read and write and Direct message
Type of App: Web App, Automated App or Bot
Fill in the rest of required info

Then regenerate the token.

@Bubble007
Copy link
Author

Thanks again to all!

I have also done everything well, but still have not come further. The bot tries hard, but still gets the error messages and ends up in an ensdlos loop.

This is what it looks like at the core :

2023-04-19 18:42:07,216 INFO NEXT ACTION: COMMAND = send_tweet ARGUMENTS = {'text': 'Be reminded of his overwhelming love with these remarkable religious quotes. "God loves each of us as if there were only one of us" - St. Augustine of Hippo "The best and most beautiful things in this world cannot be seen or even heard, but must be felt with the heart." - Helen Keller'}
2023-04-19 18:42:12,913 INFO -=-=-=-=-=-=-= COMMAND AUTHORIZED BY USER -=-=-=-=-=-=-=-=
2023-04-19 18:42:13,767 INFO SYSTEM: Command send_tweet returned: Error: 'Forbidden' object has no attribute 'reason'.

2023-04-19 18:45:25,101 INFO - Use the 'execute_shell' command to log out of the Twitter account.\n- Use the 'execute_shell' command to log back in to the Twitter account.\n- Use the 'send_tweet' command to post a quote on the Twitter account.
2023-04-19 18:45:25,617 INFO CRITICISM: I need to make sure that the Twitter account login credentials are correct.
2023-04-19 18:45:25,964 INFO NEXT ACTION: COMMAND = execute_shell ARGUMENTS = {'command_line': 'twurl accounts'}
2023-04-19 18:45:36,525 INFO -=-=-=-=-=-= COMMAND AUTHORIZED BY USER -=-=-=-=-=-=-=
2023-04-19 18:45:37,276 INFO SYSTEM: Command execute_shell returned: STDOUT:
b''
STDERR:
b'The command "twurl" is either misspelled or could not be found.\r\n'
2023-04-19 18:45:52,816 INFO THOUGHTS: The 'execute_shell' command returned an error. I will try again with the correct command.

2023-04-19 18:45:53,683 INFO - Use the 'execute_shell' command to log out of the Twitter account.\n- Use the 'execute_shell' command to log back in to the Twitter account.\n- Use the 'send_tweet' command to post a quote on the Twitter account.
2023-04-19 18:45:54,266 INFO CRITICISM: I need to make sure that the command I use is correct.
2023-04-19 18:45:54,618 INFO NEXT ACTION: COMMAND = execute_shell ARGUMENTS = {'command_line': 'twurl authorize --consumer-key <consumer_key> --consumer-secret <consumer_secret> --access-token <access_token> --access-token-secret <access_token_secret>'}
2023-04-19 18:46:14,723 INFO -=-=-=-=-=-= COMMAND AUTHORIZED BY USER -=-=-=-=-=-=-=
2023-04-19 18:46:15,420 INFO SYSTEM: Command execute_shell returned: STDOUT:
b''
STDERR:
b'Syntax error.\r\n'

@Bubble007
Copy link
Author

I Made a new issue for this problem to make it more clear for every one: Twitter - Command send_tweet returned: Error: 'Forbidden' object has no attribute 'reason'". #2588

Thanks every one here for their engagement up to this point :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants