messenger-platform-go-sdk icon indicating copy to clipboard operation
messenger-platform-go-sdk copied to clipboard

ButtonTemplate not working

Open seenickcode opened this issue 8 years ago • 10 comments

Users are forced to use GenericTemplate instead of ButtonTemplate because ButtonTemplate requires a 'buttons' field, not 'elements' field.

mq.Template(template.GenericTemplate{Title: title,
		Buttons: []template.Button{
			{
				Type:    template.ButtonTypePostback,
				Payload: postbackPayload,
				Title:   buttonTitle,
			},
		},
	})

seenickcode avatar Jun 23 '17 12:06 seenickcode

Hello, @seenickcode It indeed looks like facebook has changed the way it handles templates now. It requires a bit more work than I thought it would. I will eventually get this fixed, but pull requests are more than welcome :)

Thanks for reporting the issue.

maciekmm avatar Jun 24 '17 18:06 maciekmm

Great thank you.

On Sat, Jun 24, 2017 at 8:29 PM, Maciej Mionskowski < [email protected]> wrote:

Hello, @seenickcode https://github.com/seenickcode It indeed looks like facebook has changed the way it handles templates now. It requires a bit more work than I thought it would. I will eventually get this fixed, but pull requests are more than welcome :)

Thanks for reporting the issue.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/maciekmm/messenger-platform-go-sdk/issues/30#issuecomment-310856754, or mute the thread https://github.com/notifications/unsubscribe-auth/AAEoOa7hqZtCsF7KFiaxEKu9dDA26wgAks5sHVWmgaJpZM4ODfYo .

--

Mit freundlichen Grüßen, Nicholas

seenickcode avatar Jun 25 '17 19:06 seenickcode

Ok opened https://github.com/maciekmm/messenger-platform-go-sdk/pull/31

seenickcode avatar Jun 26 '17 16:06 seenickcode

Hey @maciekmm could you take a look when you get a chance? I have another PR I'm waiting to open too once this fix is complete. Thanks.

seenickcode avatar Jun 28 '17 13:06 seenickcode

@seenickcode @maciekmm any updates?

stanleyye avatar Aug 07 '17 07:08 stanleyye

@stanleyye @seenickcode 's contribution unfortunately does not meet coding standards of this repository. I am currently pretty busy and thus having no time to contribute. If you happen to implement this feature on your own please consider doing a pull request.

maciekmm avatar Aug 07 '17 16:08 maciekmm

It appears that this library is abandonware because Facebook changes its features often as the @maciekmm doesn't have time to maintain. The PR I submitted doesn't "meet coding standards" because the test coverage went down by 5.7%. I'm not sure how to submit a PR of a fork. Does this article explain a recommendation properly? http://blog.campoy.cat/2014/03/github-and-go-forking-pull-requests-and.html if so I will follow it and re-submit.

seenickcode avatar Aug 07 '17 20:08 seenickcode

I followed roughly those steps with my recent successful PR here #24.

cee-dub avatar Aug 07 '17 23:08 cee-dub

@seenickcode It doesn't even pass the remaining tests. I am okay with lowering coverage a bit for a short period of time if there are benefits to that. But I am not okay with the travis not building it correctly.

maciekmm avatar Aug 09 '17 17:08 maciekmm

That's fair and I forgot about that they were indeed failing. Will revisit this next month because too busy now unfortunately.

On Aug 9, 2017, 7:37 PM +0200, Maciej Mionskowski [email protected], wrote:

@seenickcode It doesn't even pass the remaining tests. I am okay with lowering coverage a bit for a short period of time if there are benefits to that. But I am not okay with the travis not building it correctly. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

seenickcode avatar Aug 09 '17 17:08 seenickcode