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

fix(Webhooks): Types for InteractiveWebhookMessageNfmReply #50

Merged
merged 2 commits into from
Sep 14, 2024

Conversation

lukas-becker0
Copy link
Contributor

Using InteractiveWebhookMessageNfmReply is broken because the type unions are not being combined correctly.

// Works now:

const interactiveWebhookMessageNfmFlowReply: InteractiveWebhookMessageNfmReply<"flow"> = {
	body: "Sent",
	name: "flow",
	response_json: "..."
}

const interactiveWebhookMessageNfmAddressReply: InteractiveWebhookMessageNfmReply<"address_message"> = {
	// optional in this case
	body: "...",
	name: "address_message",
	response_json: "..."
}


const interactiveWebhookMessageNfmUnknownReply: InteractiveWebhookMessageNfmReply<"apparently-there-are-other-types"> = {
	// optional in this case
	body: "...",
	// optional in this case
	name: "apparently-there-are-other-types",
	response_json: "..."
}

@tecoad tecoad marked this pull request as ready for review September 14, 2024 17:31
@tecoad tecoad merged commit 1e86402 into MarcosNicolau:main Sep 14, 2024
1 check passed
@tecoad
Copy link
Collaborator

tecoad commented Sep 14, 2024

Thanks @lukas-becker0 !

Copy link

🎉 This PR is included in version 1.14.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

2 participants