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 Text Quick Replies #76

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

Conversation

siueric0010
Copy link

Hello! I added text quick replies to my version. I have tested it and it works for my situation. I believe there may be some modifications to make it cleaner.

But basically it takes in a list of replies (which the user presses) in response to a text message. There is an optional payload list for the developer and if the developer decides to not use a payload, then the payload is simply the reply.

Copy link

@AndrewYinLi AndrewYinLi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, would love to see quick replies implemented

"title":reply,
"payload":reply
})
if payload != None:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't this just be an else?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's true. I changed it to an else. Thanks for your suggestion!

})

return self.send_message(recipient_id, {
"text": message,
Copy link

@AndrewYinLi AndrewYinLi Oct 18, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to get this working in a local fork of Pymessenger, and I'm encountering an error stating that message from line 422 isn't defined. Should message be messageToReplyTo because I don't see that argument being used anywhere?

Copy link
Author

@siueric0010 siueric0010 Oct 18, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah sorry about that. I fixed the message to be messageToReplyTo. I also added a default message for the function. I tested the function with whitespace and empty strings, which apparently does not send the quick replies (because it requires a concrete message to reply to).

Copy link
Author

@siueric0010 siueric0010 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove redundant if statement and added a default messageToReplyTo

@creativeJoe007
Copy link

Can I rework this feature?

@creativeJoe007
Copy link

Hello, Instead of making an API for this purpose alone I decided to make an API that would allow users manually add their payload themselves.

Eradicating issues that may arise with making the API satisfy everyone's individual use case.

You can check it out here (#85)

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