Skip to content

Conversation

@adalon
Copy link
Collaborator

@adalon adalon commented Jul 9, 2025

No description provided.

@adalon adalon requested a review from Copilot July 9, 2025 14:01
@kzu
Copy link
Member

kzu commented Jul 9, 2025

39 passed 39 passed 9 skipped

🧪 Details on Ubuntu 24.04.2 LTS

from dotnet-retest v0.7.1 on .NET 8.0.18 with 💜 by @devlooped

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds support for sending interactive call-to-action (CTA) URL messages and related response handling across the WhatsApp client API and message abstractions.

  • Introduces a new SendCallToActionAsync extension on IWhatsAppClient with XML docs.
  • Adds CallToAction helper in MessageExtensions and a CallToActionResponse record with JSON polymorphic mapping.
  • Provides an integration test for CTA payloads in WhatsAppClientTests.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/WhatsApp/WhatsAppClientExtensions.cs New SendCallToActionAsync method and XML comments
src/WhatsApp/MessageExtensions.cs Added CallToAction extension returning CallToActionResponse
src/WhatsApp/IMessage.cs Registered CallToActionResponse for JSON deserialization
src/WhatsApp/CallToActionResponse.cs Introduced CallToActionResponse record
src/Tests/WhatsAppClientTests.cs Added SendsCallToActionAsync integration test
Comments suppressed due to low confidence (3)

src/WhatsApp/WhatsAppClientExtensions.cs:560

  • The url parameter is missing an <param> XML doc entry. Please add <param name="url">The URL the CTA button should open.</param> above the method.
    public static Task<string?> SendCallToActionAsync(this IWhatsAppClient client, string serviceId, string userNumber, string message, string buttonText, string url, CancellationToken cancellation = default)

src/Tests/WhatsAppClientTests.cs:107

  • [nitpick] The comment mentions "three buttons" but this CTA payload only includes a single URL button. Update the comment to accurately reflect the one-button CTA scenario.
        // Send an interactive message with three buttons showcasing the payload/value 

src/WhatsApp/WhatsAppClientExtensions.cs:560

  • There are no unit tests covering SendCallToActionAsync. Consider adding tests to verify that it constructs the correct payload and handles cancellation or error scenarios.
    public static Task<string?> SendCallToActionAsync(this IWhatsAppClient client, string serviceId, string userNumber, string message, string buttonText, string url, CancellationToken cancellation = default)

/// <summary>
/// Sends an interactive call to action response to the user message.
/// </summary>
public static CallToActionResponse CallToAction(this IMessage message, string text, string buttonText, string url)
Copy link
Member

Choose a reason for hiding this comment

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

[nitpick]
buttonText > action

add bool isReply = false to make it a reply (Context == message.Id) or leave it null

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

partially fixed with the action renaming for now. I'm not sure about the other one.

@adalon adalon enabled auto-merge (rebase) July 9, 2025 14:15
@adalon adalon merged commit e52da0a into main Jul 9, 2025
4 checks passed
@adalon adalon deleted the dev/adalon/cta branch July 9, 2025 14:16
@kzu kzu added the enhancement New feature or request label Jul 9, 2025
@devlooped devlooped locked and limited conversation to collaborators Aug 9, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants