Skip to content

Conversation

@kzu
Copy link
Member

@kzu kzu commented Jul 9, 2025

  • SendXXX is used when there isn't a clear verb we can use. In this case, CallToAction is already a verb/action so we don't need the Send prefix (just like Reply/React).
  • Calls to action can (for now?) never be a reply to anything, they are standalone messages. Remove the Context everywhere therefore, since we don't use it at all anyway in the actual sending implementation.
  • Unify naming on Action for the button text.

@kzu kzu added the enhancement New feature or request label Jul 9, 2025
@kzu
Copy link
Member Author

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

- SendXXX is used when there isn't a clear verb we can use. In this case, CallToAction is already a verb/action so we don't need the Send prefix (just like Reply/React).
- Calls to action can (for now?) never be a reply to anything, they are standalone messages. Remove the Context everywhere therefore, since we don't use it at all anyway in the actual sending implementation.
- Unify naming on Action for the button text.
@kzu kzu force-pushed the dev/CallToAction branch from 443b4d6 to dbdc85d Compare July 9, 2025 15:41
@kzu kzu requested a review from Copilot July 9, 2025 15:41
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

This PR refactors the CallToAction API to improve naming consistency and remove unused context functionality. The changes align the CallToAction naming pattern with other message types like Reply/React that don't use a "Send" prefix, and simplify the API by removing context parameters that aren't utilized.

  • Renamed SendCallToActionAsync to CallToActionAsync to follow consistent naming patterns
  • Unified parameter naming from buttonText to action across all CallToAction methods
  • Removed unused Context parameter from CallToActionResponse constructors and method calls

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
WhatsAppClientExtensions.cs Updates method name and parameter naming for CallToAction extension method
MessageExtensions.cs Removes context parameter from CallToActionResponse constructor calls and adds documentation
CallToActionResponse.cs Refactors record definition to remove context parameter and unify action parameter naming

/// <param name="Text">The content of the message calling to action.</param>
/// <param name="Action">The action button text.</param>
/// <param name="Url">The URL to navigate to when the action button is clicked.</param>
/// /// <param name="ConversationId">The conversation id where this response was generated</param>
Copy link

Copilot AI Jul 9, 2025

Choose a reason for hiding this comment

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

There are extra forward slashes in the XML documentation comment. It should be '/// ...' instead of '/// /// ...'

Suggested change
/// /// <param name="ConversationId">The conversation id where this response was generated</param>
/// <param name="ConversationId">The conversation id where this response was generated</param>

Copilot uses AI. Check for mistakes.
@kzu kzu merged commit 841ac63 into main Jul 9, 2025
7 checks passed
@kzu kzu deleted the dev/CallToAction branch July 9, 2025 15:47
@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.

2 participants