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

dm command no longer works #405

Closed
mandeluna opened this issue Oct 12, 2018 · 11 comments
Closed

dm command no longer works #405

mandeluna opened this issue Oct 12, 2018 · 11 comments

Comments

@mandeluna
Copy link

The dm command gives the following error

/usr/local/bin/t: Sorry, that page does not exist.

I am pretty sure this is happening because Twitter changed the DM REST endpoints.

I'm not much of a ruby expert but I looked at the gemspec and it says that there is a dependency on 6.1.0 of the Twitter REST client. It does look up-to-date with the latest direct_messages events API.

In cli.rb there is a call to client.create_direct_message but I can't tell if it's calling the new API or the deprecated API.

I also know this is an old project and I'm not looking for someone to fix it for me, just suggestions on what I can do to fix it myself. I've been poking through the code for a few hours and I'm not getting anywhere.

Thanks

@autodidacticon
Copy link
Contributor

autodidacticon commented Mar 28, 2019

Looks like the path is wrong in the public twitter gem. It is correct in master. You can build the gem locally and install it and it appears to work.

Update: 6.2 will break some stuff btw. At the very least make sure youre authorized.

@galenfarrel
Copy link

mandeluna, autodidacticon, did either of you get the direct messaging working? Can you provide help in detail?

@mandeluna
Copy link
Author

I haven't had time to look into this.

@autodidacticon
Copy link
Contributor

@galenfarrel Pull down git://github.com/sferik/twitter.git and build / install master. That will temporarily resolve this issue until the gem is updated.

@galenfarrel
Copy link

@autodidacticon Thanks for your response. I'm new to ruby, and github. Will you explain what you mean by "Pull down" and "build / install"? I've already downloaded the t and installed it with the command "gem install twitter"...

@autodidacticon
Copy link
Contributor

In a separate directory:
git clone https://github.com/sferik/twitter.git
and then
gem build twitter.gemspec
gem install twitter-6.2.0.gem

@galenfarrel
Copy link

galenfarrel commented Jul 30, 2019

This caused the output to changed, but has not fixed the issue. Any ideas?

C:\Users............\twitter-master>t dm @.................... hi
C:/Ruby26-x64/bin/t: event.message_create.target.recipient_id: '..................' is not a valid Long
Run t authorize to authorize.

C:\Users.............\twitter-master>t accounts
.......................
--------------------------- (active)

And simliarly,
C:\Users.........>t dm @......... hi
C:/Ruby26-x64/bin/t: event.message_create.target.recipient_id: '..............' is not a valid Long
Run t authorize to authorize.

C:\Users......>t account
.........................
--------------------------- (active)

And if I enter the full t dm command, I get
C:\Users.............\twitter-master>t dm USER MESSAGE @............ hi
ERROR: "t dm" was called with arguments ["USER", "MESSAGE", "@.................", "hi"]
Usage: "t dm USER MESSAGE"
which is the same as it was before applying your fix.

@autodidacticon
Copy link
Contributor

You need to invoke dm with the userId of the account. You can retrieve that with the whoIs command.

@galenfarrel
Copy link

@autodidacticon This is the ticket, it's working now. Thanks a heap for the help!

@onoakino
Copy link

onoakino commented Apr 10, 2020

I'm on t version 3.1.0 and I'm getting an error below when I try to send a DM. Note that I'm already authorized. I can post a twitter update fine, I can stream updates etc, but I can't successfuly send a Direct Message. Here's the command line output error:

`Miming-MacBook-Pro:~ miming$ t dm userIdOfAFriend hello

/Users/miming/.rbenv/versions/2.7.1/bin/t: Sorry, that page does not exist`

@jasalt
Copy link

jasalt commented Jun 13, 2020

Got it to work by upgrading twitter gem to 7.0.0, but that additionally needs a workaround for authentication to work (on mac) #402 (comment).

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

5 participants