rehabstudio / fbmessenger

A python library to communicate with the Facebook Messenger API's
Other
115 stars 50 forks source link

Is there a way to send local file? #85

Open master0v opened 2 years ago

master0v commented 2 years ago

Would you like assistance or advice?

advice

Issue description

Would like to send a file from a local filesystem.

file = attachments.File(url="file://./file.txt")
client.send(file.to_dict(), recipient_id=user_id, messaging_type='RESPONSE')

Steps to reproduce

the above code returns "(#100) file://./file.txt should represent a valid URL)" also tried other variations of file:// syntax as well as simply ./file.txt and file.txt

Traceback or other info

Thanks!

master0v commented 2 years ago

according to this doc, the API supports it https://developers.facebook.com/docs/messenger-platform/reference/attachment-upload-api/

gaetan1903 commented 2 years ago

this repository seems to be no longer maintained.

you can try the framework Ampalibe for creating bot messenger