Skip to content

docs: document 🦀send command (whatsapp-rust#875) - #338

Closed
jlucaso1 wants to merge 3 commits into
mainfrom
claude/eager-cerf-4ebi8w
Closed

docs: document 🦀send command (whatsapp-rust#875)#338
jlucaso1 wants to merge 3 commits into
mainfrom
claude/eager-cerf-4ebi8w

Conversation

@jlucaso1

@jlucaso1 jlucaso1 commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

Follows whatsapp-rust#875, which added a 🦀send <jid> <text> command to the demo bot in src/main.rs.\n\n## Changes\n\n- changelog/2026-06-15-send-command.mdx — new changelog entry explaining the command, its output format, and implementation notes (let-else refactor, split_once parsing, error logging)\n- quickstart.mdx — two updates:\n - Demo binary CLI flags description now mentions 🦀send alongside 🦀ping\n - "Complete example with logging" code block updated to match the real src/main.rs: adds SEND_TRIGGER constant, refactors handle_message to use the let-else guard, and adds handle_send_command\n- docs.json — registers changelog/2026-06-15-send-command at the top of the changelog tab


Generated by Claude Code


Summary by cubic

Document the new 🦀send <jid> <text> demo-bot command from whatsapp-rust#875 that relays text to any JID and reports send latency to the originating chat.
Update quickstart.mdx to match src/main.rs (add SEND_TRIGGER, handle_send_command, and a let-else guard, and remove the inaccurate “message editing” claim), add a focused changelog entry with docs.json registration, and switch both pages to second-person voice.

Written for commit bfe90ea. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Documentation
    • Updated quickstart guide with enhanced demo bot capabilities
    • Added documentation for new message relay command that sends text to specified recipients and confirms delivery time
    • Added changelog entry documenting demo bot improvements

- Add changelog/2026-06-15-send-command.mdx describing the new command
- Update quickstart.mdx demo bot description and complete example to
  include SEND_TRIGGER constant, refactored handle_message, and
  handle_send_command function
- Register the new changelog page in docs.json
@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

A new changelog entry for June 15, 2026 documents the 🦀send <jid> <text> demo-bot command. The docs.json nav is updated to include the new page, and quickstart.mdx is expanded with SEND_TRIGGER constant, refactored message handler branching, and a handle_send_command helper example.

Changes

Send Command Documentation

Layer / File(s) Summary
Changelog entry and nav registration
changelog/2026-06-15-send-command.mdx, docs.json
New MDX changelog file with frontmatter, behavioral description (relay to JID, latency reply), usage example, and implementation notes (JID FromStr validation, early returns, let … else guard). Nav entry added to the English changelog list.
Quickstart demo description and complete example
quickstart.mdx
Demo description line updated to mention 🦀send. Complete example gains PING_TRIGGER/SEND_TRIGGER constants, a refactored handler that extracts text_content and branches on each trigger, and a new handle_send_command helper that parses arguments, validates the JID, sends via client.send_message, measures elapsed time, and quotes the confirmation reply.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

  • oxidezap/whatsapp-rust-docs#322: Overhauled the quickstart bot handler style using MessageContext and ctx.reply_quoting, which is the same handler pattern extended here with the SEND_TRIGGER branch.

Poem

🐇 A crab with a message to send,
🦀send <jid> <text> — a new trend!
It parses the JID,
Measures latency hid,
Then quotes back the time at the end! 🦀

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: documenting the 🦀send command feature introduced in whatsapp-rust#875.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/eager-cerf-4ebi8w

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@changelog/2026-06-15-send-command.mdx`:
- Around line 6-10: Convert the changelog entry from third-person to
second-person voice to align with documentation standards. Rewrite the text
starting with "PR [`#875`]" on line 6 and the paragraph under "## What changed" on
line 10 to use second-person perspective (e.g., "you can now" instead of "the
example bot now"). Keep the ## What changed subheading unchanged and preserve
all technical details about the send command, JID types, and the
ctx.reply_quoting functionality while switching the narrative voice.

In `@quickstart.mdx`:
- Around line 271-272: The documentation at lines 271-272 uses third-person
voice ("The demo bot responds...") instead of the required second-person
perspective. Rewrite this prose using "you" phrasing to address the reader
directly, making it consistent with documentation standards. The same
third-person voice issue applies at lines 352-353, so rewrite that section
similarly to use second-person perspective.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 3de29ea7-c4d9-4d80-8eda-9e99e732c6ff

📥 Commits

Reviewing files that changed from the base of the PR and between a35417b and 054bd81.

📒 Files selected for processing (3)
  • changelog/2026-06-15-send-command.mdx
  • docs.json
  • quickstart.mdx

Comment thread changelog/2026-06-15-send-command.mdx Outdated
Comment thread quickstart.mdx Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 054bd81231

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread quickstart.mdx
Comment on lines +424 to +425
} else if let Some(args) = text.strip_prefix(SEND_TRIGGER) {
handle_send_command(&ctx, args).await;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Gate relay commands on non-self messages

When the relayed text itself starts with 🦀send, this branch will also run for the bot's own sent-message fanout unless the handler checks ctx.info.source.is_from_me first. A user can send one nested relay command and have the bot reinterpret its own relayed message as another command, causing unintended extra sends (or command chains) from the bot account; add a self-message guard before dispatching handle_send_command.

Useful? React with 👍 / 👎.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

1 issue found across 3 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread quickstart.mdx Outdated
jlucaso1 added 2 commits June 15, 2026 15:54
Switch third-person narration to second-person in changelog entry and
quickstart.mdx as flagged in PR #338 review.
The snippet does not demonstrate edit_message; drop the inaccurate
claim identified by cubic in PR #338 review.
@jlucaso1 jlucaso1 closed this Jun 18, 2026
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.

1 participant