Closed leoheck closed 6 years ago
Here you are...
user_id = <recipient's user id>
message_text = <you DM text>
event = '{"event":{"type":"message_create","message_create":{"target":{"recipient_id":"%s"},"message_data":{"text":"%s"}}}}' % (user_id, message_text)
r = api.request('direct_messages/events/new', event)
print(r.status_code)
Added to examples... https://github.com/geduldig/TwitterAPI/blob/master/examples/direct_message.py
Hi, I am playing with your API, and it is really cool. I have a question. Do you have any examples of how to send direct messages? Thank you.