bear / python-twitter

A Python wrapper around the Twitter API.
Apache License 2.0
3.41k stars 957 forks source link

PostDirectMessage Not working #673

Open bishtamit-zz opened 4 years ago

bishtamit-zz commented 4 years ago

I am trying to send a direct message but it is not sending and giving error:

{'errors': [{'code': 214, 'message': "event.message_create.target.recipient_id: 'go message go' is not a valid Long"}]}

It was working before but now it is giving this error.

600 checked this issue but it is of no help.

artoonie commented 4 years ago

I'm seeing this too, looks like we need to change the endpoint to '%s/direct_messages/events/list.json' and filter out received messages?

https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/sending-and-receiving/api-reference/list-events

I don't see a way to only list sent messages anymore.

Edit: looks like kyu has this in progress: https://github.com/bear/python-twitter/pull/665/files

your-diary commented 3 years ago

Any updates?

I'm also given an error.

Traceback (most recent call last):
  File "/home/user/2.py", line 61, in <module>
    tw.twitter_client.PostDirectMessage('hello', screen_name = 'some_user')
  File "/usr/lib/python3.9/site-packages/twitter/api.py", line 3044, in PostDirectMessage
    created_at=data['event']['created_timestamp'],
KeyError: 'event'
GiovanH commented 3 years ago

Seem to still be experiencing this same issue, though not consistently.