Skip to content

Conversation

@kzu
Copy link
Member

@kzu kzu commented Apr 8, 2025

In most use cases, we'd have a Message from the user at hand. Therefore, it significantly simplifies things if we can just Reply/React/MarkRead/Send back to the sender of the message, so we add extension method overloads.

Also, since attempting to use SendAsync(number, "hello") is an obvious mistake that's too easy to make (the payload should be an object matching expected payloads from WhatsApp API), we add an analyzer that flags this as a compilation error so it can never happen. Ideally, we'd like to exclude a string from being acceptable as an object, but this is the next best thing :).

@kzu kzu added the enhancement New feature or request label Apr 8, 2025
@kzu kzu force-pushed the dev/overloads branch from 7aff92b to adcc393 Compare April 8, 2025 22:41
@kzu kzu enabled auto-merge (rebase) April 8, 2025 22:41
@kzu
Copy link
Member Author

kzu commented Apr 8, 2025

16 passed 16 passed 2 skipped

🧪 Details on Ubuntu 24.04.2 LTS

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

@kzu kzu force-pushed the dev/overloads branch 2 times, most recently from 09cb342 to 5baa5b2 Compare April 8, 2025 22:44
In most use cases, we'd have a Message from the user at hand. Therefore, it significantly simplifies things if we can just Reply/React/MarkRead/Send back to the sender of the message, so we add extension method overloads.

Also, since attempting to use SendAsync(number, "hello") is an obvious mistake that's too easy to make (the payload should be an object matching expected payloads from WhatsApp API), we add an analyzer that flags this as a compilation error so it can never happen. Ideally, we'd like to exclude a string from being acceptable as an `object`, but this is the next best thing :).
@kzu kzu merged commit acb3005 into main Apr 8, 2025
7 checks passed
@kzu kzu deleted the dev/overloads branch April 8, 2025 22:46
@devlooped devlooped locked and limited conversation to collaborators May 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