python-twitter icon indicating copy to clipboard operation
python-twitter copied to clipboard

PostDirectMessage Not working

Open bishtamit-zz opened this issue 5 years ago • 3 comments

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.

bishtamit-zz avatar Jun 30 '20 18:06 bishtamit-zz

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

artoonie avatar Sep 01 '20 00:09 artoonie

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'

your-diary avatar Jan 07 '21 15:01 your-diary

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

GiovanH avatar Apr 17 '21 06:04 GiovanH