I am using tweepy and I defined a new method to attach media to DM which is as follows:
@property
def send_media(self):
""" :reference: https://dev.twitter.com/rest/reference/post/direct_messages/new
:allowed_param:'user', 'screen_name', 'user_id', 'text'
"""
return bind_api(
api=self,
path='/direct_messages/events/new.json',
method='POST',
payload_type='media',
allowed_param=['user', 'screen_name', 'user_id', 'text','attachement'],
require_auth=True
)
I am sending parameters of attachment in this way:
api.send_media(user_id =status.direct_message['sender_id'], text =response, attachment={'type':'media','media_id': mediaID})
But my bot only says the text and no image is attached.
help please