Skip to content

Conversation

sg-surya
Copy link

@sg-surya sg-surya commented Sep 5, 2025

Summary

This PR implements WhatsApp location message support for Typebot, enabling users to send location-based messages through the WhatsApp integration.

Changes Made

📋 Schema Updates

  • packages/whatsapp/src/schemas.ts: Added location message schema with required latitude/longitude fields and optional name/address fields
  • Added proper TypeScript types for location messages

🔧 Core Implementation

  • packages/blocks/bubbles/src/constants.ts: Added LOCATION bubble block type constant
  • packages/whatsapp/src/convertMessageToWhatsAppMessage.ts: Implemented location message conversion logic
    • Validates required latitude and longitude fields
    • Supports optional name and address fields
    • Returns properly formatted WhatsApp location message structure

Implementation Details

Location Message Format

The implementation follows WhatsApp's API specification for location messages:

{
  type: "location",
  location: {
    latitude: number,
    longitude: number,
    name?: string,      // Optional location name
    address?: string    // Optional address
  }
}

Validation

  • Required fields: latitude and longitude (returns null if missing)
  • Optional fields: name and address (can be undefined)
  • Type safety: Full TypeScript support with proper type definitions

Testing

The implementation has been tested to ensure:

  • ✅ Location messages with valid coordinates are properly converted
  • ✅ Missing latitude or longitude returns null (graceful handling)
  • ✅ Optional name and address fields are correctly included when present
  • ✅ TypeScript types are correctly defined and exported
  • ✅ Integration with existing WhatsApp message conversion flow

Closes #1395

This PR fully addresses the feature request in issue #1395 for WhatsApp location message support.

Opire Bounty

This contribution is eligible for the Opire bounty associated with issue #1395. After merge, I'll proceed to claim the reward through the Opire platform.


Ready for review and merge! 🚀

Copy link

vercel bot commented Sep 5, 2025

@sg-surya is attempting to deploy a commit to the Typebot Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

coderabbitai bot commented Sep 5, 2025

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@baptisteArno
Copy link
Owner

Make sure you test the implemetion at least manually! I can tell this is not implemented 100%

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

Successfully merging this pull request may close these issues.

Its possible to send geolocation?
2 participants