Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added functionality to add attachments #208

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

p1ho
Copy link

@p1ho p1ho commented May 28, 2019

Original Issue: #90

Added ability to attach file in cli

you can do >/a <absolute-path-to-file> (/attach works too) to upload a file to a thread.

image

Different file types are taken care of:

  • audio
  • video
  • image
  • file

if a file is not accepted by facebook, it will log a deny message.

How does this work?

This works by first uploading the file to https://upload.messenger.com/ajax/mercury/upload.php, if it succeeds with no errors, it will return a body with the id of the file you uploaded.

You can then append this id to the form data and POST it to https://www.messenger.com/messaging/send/ (the same endpoint where messages are sent)

Notes

  • If a file is not allowed (e.g., .exe files), it will log a denied message
  • Because of a bug with showing file attachments (even if it's sent by other people), it's harder to tell that this works, but if you open messenger in a browser, you can see that the files are uploaded correctly. Fix handling image attachments and animated images in current conversation #162
  • This does not address image copied in clipboard

p1ho and others added 4 commits May 29, 2019 12:07
Updated getDisplayName() to help distinguish where messages start when the fb-messenger-cli user writes consecutive messages that all wrap around the screen.
…n powershell

Powershell users will have to disable colors in group convos or change
their color scheme
@Alex-Rose
Copy link
Owner

Hey @p1ho this is pretty cool! Sorry for the late reply, I'll give it a shot and hopefully FB didn't change their API too much so this still works

@p1ho
Copy link
Author

p1ho commented Aug 8, 2019

Awesome! Excited to hear your feedback! I've also added a screenshot of it working above.

@p1ho
Copy link
Author

p1ho commented Apr 15, 2020

@Alex-Rose
Hello, just added a minor commit for the merge conflict.
I just tested, the functionality still worked on my machine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants