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

unable to send direct messages #735

Closed
neuwirthe opened this issue Sep 11, 2022 · 9 comments
Closed

unable to send direct messages #735

neuwirthe opened this issue Sep 11, 2022 · 9 comments

Comments

@neuwirthe
Copy link

neuwirthe commented Sep 11, 2022

rtweet 1.0.2
R 4.2.1
MacOS 12.5.1
I created a new twitter app with all the keys needed on developer.twitter.com
I set app permissions to
Read and Write and Direct message
But I am unable to send direct messages.
I get

Error: Twitter API failed [400]
Check error message at https://developer.twitter.com/en/support/twitter-api/error-troubleshooting

I used

rtweet_bot(
  api_key = Sys.getenv("RTWEET_API_KEY"),
  api_secret = Sys.getenv("RTWEET_API_SECRET"),
  access_token =  Sys.getenv("RTWEET_ACCESS"),
  access_secret =  Sys.getenv("RTWEET_ACCESS_SECRET")
) ->
  auth_bot

auth_save(auth_bot,"R_with_rtweet")

and

auth_as(auth_bot)
post_tweet("This is an rtweet test")

works, but sends a public tweet, which is annoying when doing tests

post_message("This is an rtweet test", "neuwirthe")

does not work.

I cannot send a complete reprex because that would imply sending keys and secrets.

How can I make direct messages work?

2022-09-12_00-31-42

@llrs
Copy link
Member

llrs commented Sep 12, 2022

I think the problem is that you are trying to send a message to yourself and this is not allowed in Twitter. Try sending a direct message to someone else

@neuwirthe
Copy link
Author

I create a new account which can receive direct messages from everybody.
I still get the error message.

@llrs
Copy link
Member

llrs commented Sep 13, 2022

Mmh, this time when I tried the code I got a warning which might indicate something is indeed wrong:

In addition: Warning message:
Unknown or uninitialised column: `user_id`. 

I will look to it with more detail. Thanks for the report.

llrs added a commit that referenced this issue Sep 24, 2022
@llrs
Copy link
Member

llrs commented Sep 24, 2022

Sorry, there was indeed a bug in the post_message. It should be fixed now on the devel branch.

@neuwirthe
Copy link
Author

I installed the Level version from GitHub and still get

post_message("test with rtweet", "gabineuw")

Error: Twitter API failed [400]
Check error message at https://developer.twitter.com/en/support/twitter-api/error-troubleshooting

@llrs
Copy link
Member

llrs commented Sep 26, 2022

Did you install it from the devel branch?

@neuwirthe
Copy link
Author

neuwirthe commented Sep 26, 2022 via email

@llrs
Copy link
Member

llrs commented Sep 27, 2022

In github there are several branches, if you didn't specify the devel branch you installed the default which doesn't have the fix. Did you install with something like remotes::install_github("ropensci/rtweet@devel")? Could you show the output of your packageVersion("rtweet") ? This would help me find which rtweet version have you installed.

@neuwirthe
Copy link
Author

neuwirthe commented Sep 27, 2022 via email

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

No branches or pull requests

2 participants