Skip to content

Commit

Permalink
Merge pull request #50 from lukas-becker0/lukas-becker0-patch-4
Browse files Browse the repository at this point in the history
fix(Webhooks): Types for InteractiveWebhookMessageNfmReply
  • Loading branch information
tecoad authored Sep 14, 2024
2 parents 1a5b276 + ad4eb3c commit 1e86402
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions src/types/webhooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,22 @@ export type WebhookMedia = {
*/
export type InteractiveWebhookMessageNfmReplyName = "address_message" | "flow" | string;

export type InteractiveWebhookMessageNfmReply<Name extends InteractiveWebhookMessageNfmReplyName = string> = {
name?: Name;
response_json: string;
} & Name extends "flow"
? { body: "Sent" }
: { body?: string };
export type InteractiveWebhookMessageNfmReply<Name extends InteractiveWebhookMessageNfmReplyName = string> =
(
Name extends "flow"
? { body: "Sent" }
: { body?: string }
)
&
(
Name extends "flow" | "address_message"
? { name: Name }
: { name?: Name }
)
&
{
response_json: string;
}

export interface InteractiveWebhookMessageListReply {
/**
Expand Down

0 comments on commit 1e86402

Please sign in to comment.