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

Add Function for Adding a Video From Attachment ID #123

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

acucciniello
Copy link

- facebook allows for you to upload a file and serve it from them
- this function allows you to use a video from an attachment rather than trying to upload it from where ever it is hosted
- this could save load times for all videos being served

	- facebook allows for you to upload a file and serve it from them
	- this function allows you to use a video from an attachment rather than trying to upload it from where ever it is hosted
	- this could save load times
@stojanovic stojanovic self-assigned this Sep 21, 2018
@stojanovic
Copy link
Member

Thanks and sorry for the late reply. I'll test this during the weekend and merge it.

@stojanovic
Copy link
Member

@acucciniello looks good, but can you add a test for this? If you don't know how to do that I can help.

@acucciniello
Copy link
Author

@stojanovic Sorry for the massive delay, I am just getting back to this. What are some tests you would need to make?

@acucciniello
Copy link
Author

@stojanovic In order to get an attachment id, I need to call the facebook API with a page access token. Without that I cannot make an image or a video. Do you have a page access token that works for testing?

@stojanovic
Copy link
Member

Sorry for the late reply. No need to invoke the Facebook API from the tests, let's just add a simple unit tests to make sure that we don't break this functionality in future. For example, invoke the video template and confirm that JSON structure is what you expect it to be. Also, try to invoke it without an attachment ID and check if the error is expected.

You can see similar examples here: https://github.com/claudiajs/claudia-bot-builder/blob/master/spec/facebook/facebook-format-message-spec.js.

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.

3 participants