Skip to content

Conversation

@grunch
Copy link
Member

@grunch grunch commented May 12, 2025

Summary by CodeRabbit

  • New Features

    • Added the ability to display a QR code for order invoices, allowing users to easily access and pay invoices by scanning the code.
    • Introduced a new action button to show the QR code directly from the order interface.
  • Improvements

    • Enhanced invoice and pending sell messages with clearer warnings, legal disclaimers, and instructions across multiple languages to help users verify order images and understand important terms.
    • Improved message formatting and added interactive buttons for better user engagement and clarity.
    • Generalized order cancellation conditions to allow cancelling any order in waiting payment status.
  • Bug Fixes

    • Removed unused parameters and variables to prevent potential warnings and streamline the user experience.
  • Chores

    • Updated dependencies for improved stability and compatibility.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented May 12, 2025

## Walkthrough

This update introduces a new asynchronous function to display QR codes for order invoices, modifies message formatting and flow for payment requests and pending sales, adds a new bot action handler for QR code display, enhances Spanish locale warnings and instructions, and updates two package dependencies.

## Changes

| Files/Groups                                   | Change Summary |
|------------------------------------------------|----------------|
| `bot/commands.ts`                              | Added `showQrCode` async function to retrieve and display a QR code for an order's invoice, updated imports, improved error handling, and performed minor cleanup of unused variables and imports; enhanced order cancellation logic for any order in waiting payment status with clearer conditional blocks. |
| `bot/messages.ts`                              | Modified `invoicePaymentRequestMessage` to remove an unused parameter and sanitize input; added `showQRCodeMessage` to generate and send QR code images as photo media groups with MarkdownV2 captions; updated message formatting and inline keyboard for payment continuation; updated export list accordingly. |
| `bot/start.ts`                                 | Added a new action handler for `showqrcode_` callback queries, integrating user validation and QR code display logic with error handling and message deletion; imported `showQrCode` command. |
| `locales/es.yaml`                              | Expanded and clarified Spanish locale messages for invoice payment requests and pending sales, adding detailed warnings, instructions, and disclaimers emphasizing image verification and user responsibility. |
| `locales/de.yaml`, `locales/en.yaml`, `locales/fa.yaml`, `locales/fr.yaml`, `locales/it.yaml`, `locales/ko.yaml`, `locales/pt.yaml`, `locales/ru.yaml`, `locales/uk.yaml` | Revised localization strings to improve clarity, add explicit multi-line warnings about invoice payment safety, emphasize image verification, include legal disclaimers, and clarify order handling instructions without changing underlying logic or control flow. |
| `package.json`                                 | Updated `axios` dependency from `^1.8.2` to fixed `1.9.0` and `lightning` from `9.8.1` to `10.25.0`. |

## Suggested reviewers

- grunch

## Poem

> 🐇 Hop, hop, a QR code in sight,  
> Scan it quick, the payment’s right!  
> Warnings clear in every tongue,  
> Safety first, the song is sung.  
> Dependencies fresh, the bot’s anew,  
> Carrots and code, just for you! 🌟🥕

Tip

⚡️ Faster reviews with caching
  • CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.

Enjoy the performance boost—your workflow just got faster.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3d04f18 and 930ad7b.

📒 Files selected for processing (1)
  • bot/commands.ts (5 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • bot/commands.ts
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: ci_to_main
  • GitHub Check: Analyze (javascript)
  • GitHub Check: ci_to_main
✨ Finishing Touches
  • 📝 Generate Docstrings

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:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • 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. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • 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 src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

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

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai 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

Documentation and Community

  • 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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (5)
locales/ru.yaml (1)

58-58: Remove trailing whitespace
YAMLlint flagged trailing spaces in this file (line 58). Please remove any trailing spaces to satisfy YAML syntax rules.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 58-58: trailing spaces

(trailing-spaces)

locales/fa.yaml (2)

39-50: Verify Persian Markdown formatting and placeholder consistency

This block introduces critical safety warnings. Please confirm:

  1. All *…* markers render correctly in the Telegram client (e.g., ensure parentheses and punctuation are escaped for MarkdownV2 if needed).
  2. Placeholder names (${order.amount}, ${currency}, ${order.fiat_amount}, ${rate}, ${days}) exactly match the code that injects them.
  3. Terminology consistency for “sats” vs “ساتوشی” across all Persian locale entries—consider unifying the term.

52-60: Check legal disclaimer translation and punctuation

The new multi-line disclaimer mirrors other locales, but please verify:

  • Sentence endings use consistent Persian punctuation (periods, commas).
  • The warning about developers/dispute resolvers aligns exactly with the English source.
  • References to /disclaimer and command styling match other parts of the file.
locales/de.yaml (2)

37-49: Validate German Markdown syntax and placeholders

This invoice request segment uses bold/italic markers (*…*) and inline emojis. Please ensure:

  1. All special characters (quotes, emojis, parentheses) are correctly escaped under MarkdownV2.
  2. Placeholders (${order.amount}, ${currency}, ${order.fiat_amount}, ${rate}, ${days}) match the code.
  3. The phrasing (“Ein Benutzer möchte…”) is consistent with other locales in tone and structure.

52-62: Confirm German disclaimer and cancellation instructions

The pending sell block adds legal disclaimers and command hints. Please check:

  • Punctuation consistency at line ends.
  • Accuracy of “/disclaimer” reference and that responsibility waiver matches source.
  • Uniformity of channel placeholder ${channel} formatting.
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7fda9f8 and 3d04f18.

📒 Files selected for processing (11)
  • bot/commands.ts (5 hunks)
  • locales/de.yaml (1 hunks)
  • locales/en.yaml (1 hunks)
  • locales/es.yaml (1 hunks)
  • locales/fa.yaml (1 hunks)
  • locales/fr.yaml (1 hunks)
  • locales/it.yaml (1 hunks)
  • locales/ko.yaml (1 hunks)
  • locales/pt.yaml (1 hunks)
  • locales/ru.yaml (1 hunks)
  • locales/uk.yaml (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • locales/fr.yaml
  • locales/it.yaml
🚧 Files skipped from review as they are similar to previous changes (2)
  • bot/commands.ts
  • locales/es.yaml
🧰 Additional context used
🪛 YAMLlint (1.35.1)
locales/ru.yaml

[error] 58-58: trailing spaces

(trailing-spaces)

🔇 Additional comments (10)
locales/ko.yaml (2)

38-48: Approve enhanced invoice payment warning in Korean
The updated invoice_payment_request includes clear, multi-line warnings prompting the user to verify the order image against the QR code, matching other locales and supporting the new QR code display feature. Placeholders (${order.amount}, ${currency}, ${order.fiat_amount}, ${rate}, ${days}) are correctly positioned.


51-60: Approve added disclaimers in pending sell message
The pending_sell message now reminds users to remember the image, disclaims developer/arbitrator liability, and notes terms acceptance—consistent with other languages and the new QR code functionality.

locales/en.yaml (2)

39-50: Approve invoice payment request improvements
The English invoice_payment_request was enhanced with explicit reputation info and cautionary steps (verify image, view QR code) and aligns with MarkdownV2 formatting. Placeholders and formatting look correct.


52-62: Approve updated pending sell instructions
The pending_sell text now concisely reminds users to recall the image, disclaims liability, and confirms terms acceptance. It aligns with UX requirements for QR code display.

locales/pt.yaml (2)

36-47: Approve Portuguese invoice payment warnings
The invoice_payment_request in Portuguese mirrors the English enhancements: buyer details, strong warnings to recheck images, and guidance to decide next steps. Variables and Markdown emphasis are correctly applied.


49-60: Approve Portuguese pending sell disclaimers
The pending_sell message now includes image-verification reminders, liability disclaimers, and terms acceptance—consistent with other locales and the new QR display feature.

locales/uk.yaml (2)

36-47: Approve Ukrainian invoice payment request enhancements
The invoice_payment_request has been updated with reputation context and prominent multi-line warnings to verify images before payment, matching the UX improvements. Variables and formatting appear correct.


49-60: Approve Ukrainian pending sell message updates
The pending_sell section now reminds users to remember the image, disclaims developer/arbitrator liability, and notes terms/privacy acceptance—aligned with other locales and new QR code features.

locales/ru.yaml (2)

36-47: Approve Russian invoice payment request changes
The Russian invoice_payment_request now uses “Пользователь хочет купить…” phrasing, includes buyer reputation and strong warnings to re-check the image before payment, aligning with other translations.


49-60: Approve Russian pending sell disclaimer updates
The pending_sell update adds image-memory prompts, liability disclaimers, and terms acceptance—consistent with the QR code UX and other locales.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 58-58: trailing spaces

(trailing-spaces)

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.

3 participants