Skip to content

Polish Telegram connect flow messaging and restore /start#399

Merged
techeng322 merged 1 commit into
mainfrom
techengme/myc-5004-telegram-bot-connect-flow-lacked-email-verification-leaked
Jul 9, 2026
Merged

Polish Telegram connect flow messaging and restore /start#399
techeng322 merged 1 commit into
mainfrom
techengme/myc-5004-telegram-bot-connect-flow-lacked-email-verification-leaked

Conversation

@techeng322

@techeng322 techeng322 commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Restores /start (shows a welcome/status message for already-connected users) after an earlier removal, and updates its wording from "verified" to "connected" to match the new flow's terminology.
  • Fallback and success messages now mention YouTube-link moments, not just photos/videos.
  • Consolidated all Telegram bot message strings (previously scattered as local consts per file) into consts.ts.

Test plan

  • pnpm vitest run — 1472/1472 passing
  • pnpm exec tsc --noEmit — no new type errors introduced

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Updated Telegram connection and verification messages for a clearer, more consistent experience.
    • Added clearer guidance when sending content, including support for photo/video captions and YouTube links.
  • Bug Fixes

    • Improved error messages for invalid email and verification code replies.
    • Refined the successful connection flow so users now see a more polished confirmation message.

…mmand

Restores /start (welcome/status message for already-connected users) after
an earlier removal, updates its wording to match the new "connect" (not
"verify") terminology, mentions YouTube-link moments in the fallback and
success messages, and consolidates all Telegram bot message strings into
consts.ts.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
in-process-api Ready Ready Preview Jul 9, 2026 3:11am

Request Review

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Telegram user-facing message strings are consolidated into shared constants and a telegramConnectedMessage helper in consts.ts. Consumer files (connectTelegramToAccount, promptTelegramEmail, verifyTelegramCode) now import and use these instead of local strings. handleStart and onNewMention wording is also updated, with corresponding test expectations revised.

Changes

Telegram Message Constants and Usage

Layer / File(s) Summary
Shared message constants and helper
src/lib/telegram/chat/consts.ts
Adds TELEGRAM_NOT_CONNECTED_MESSAGE, TELEGRAM_INVALID_EMAIL_MESSAGE, TELEGRAM_CODE_SENT_MESSAGE, TELEGRAM_INVALID_CODE_MESSAGE constants and telegramConnectedMessage(username) helper.
Email/code verification flow uses shared constants
src/lib/telegram/chat/connectTelegramToAccount.ts, src/lib/telegram/chat/promptTelegramEmail.ts
Removes locally defined message strings and posts imported constants for invalid email, code sent, and not-connected states.
verifyTelegramCode success/error messaging
src/lib/telegram/chat/verifyTelegramCode.ts, src/lib/telegram/chat/__tests__/verifyTelegramCode.test.ts
Uses TELEGRAM_INVALID_CODE_MESSAGE for validation/auth failures and a shared connectedMessage from telegramConnectedMessage(pending.username) for both success branches; test expectation updated to match new success text.
Start command and mention handler wording updates
src/lib/telegram/chat/commands/handleStart.ts, src/lib/telegram/chat/handlers/onNewMention.ts, src/lib/telegram/chat/handlers/__tests__/onNewMention.test.ts
Updates greeting text in handleStart and expands the fallback prompt in onNewMention to mention YouTube links; tests updated accordingly.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant verifyTelegramCode
  participant Privy
  participant consts

  User->>verifyTelegramCode: submit code
  verifyTelegramCode->>Privy: authenticatePrivyPasswordless
  Privy-->>verifyTelegramCode: auth result
  verifyTelegramCode->>consts: telegramConnectedMessage(pending.username)
  consts-->>verifyTelegramCode: connectedMessage
  verifyTelegramCode->>User: thread.post(connectedMessage)
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the Telegram connect flow messaging updates and the /start-related change.
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.
✨ 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 techengme/myc-5004-telegram-bot-connect-flow-lacked-email-verification-leaked

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

src/lib/telegram/chat/__tests__/verifyTelegramCode.test.ts

Oops! Something went wrong! :(

ESLint: 9.39.4

TypeError: Converting circular structure to JSON
--> starting at object with constructor 'Object'
| property 'configs' -> object with constructor 'Object'
| property 'flat' -> object with constructor 'Object'
| ...
| property 'plugins' -> object with constructor 'Object'
--- property 'react' closes the circle
Referenced from: /.eslintrc.json
at JSON.stringify ()
at /node_modules/.pnpm/@eslint+eslintrc@3.3.5/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2255:45
at Array.map ()
at ConfigValidator.formatErrors (/node_modules/.pnpm/@eslint+eslintrc@3.3.5/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2246:23)
at ConfigValidator.validateConfigSchema (/node_modules/.pnpm/@eslint+eslintrc@3.3.5/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2277:84)
at ConfigArrayFactory._normalizeConfigData (/node_modules/.pnpm/@eslint+eslintrc@3.3.5/node_modules/@eslint/

... [truncated 446 characters] ...

c/dist/eslintrc.cjs:3261:25)
at ConfigArrayFactory._normalizeObjectConfigDataBody (/node_modules/.pnpm/@eslint+eslintrc@3.3.5/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3199:25)
(node:2) ESLintRCWarning: You are using an eslintrc configuration file, which is deprecated and support will be removed in v10.0.0. Please migrate to an eslint.config.js file. See https://eslint.org/docs/latest/use/configure/migration-guide for details. An eslintrc configuration file is used because you have the ESLINT_USE_FLAT_CONFIG environment variable set to false. If you want to use an eslint.config.js file, remove the environment variable. If you want to find the location of the eslintrc configuration file, use the --debug flag.
(Use node --trace-warnings ... to show where the warning was created)

src/lib/telegram/chat/commands/handleStart.ts

Oops! Something went wrong! :(

ESLint: 9.39.4

TypeError: Converting circular structure to JSON
--> starting at object with constructor 'Object'
| property 'configs' -> object with constructor 'Object'
| property 'flat' -> object with constructor 'Object'
| ...
| property 'plugins' -> object with constructor 'Object'
--- property 'react' closes the circle
Referenced from: /.eslintrc.json
at JSON.stringify ()
at /node_modules/.pnpm/@eslint+eslintrc@3.3.5/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2255:45
at Array.map ()
at ConfigValidator.formatErrors (/node_modules/.pnpm/@eslint+eslintrc@3.3.5/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2246:23)
at ConfigValidator.validateConfigSchema (/node_modules/.pnpm/@eslint+eslintrc@3.3.5/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2277:84)
at ConfigArrayFactory._normalizeConfigData (/node_modules/.pnpm/@eslint+eslintrc@3.3.5/node_modules/@eslint/

... [truncated 446 characters] ...

c/dist/eslintrc.cjs:3261:25)
at ConfigArrayFactory._normalizeObjectConfigDataBody (/node_modules/.pnpm/@eslint+eslintrc@3.3.5/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3199:25)
(node:2) ESLintRCWarning: You are using an eslintrc configuration file, which is deprecated and support will be removed in v10.0.0. Please migrate to an eslint.config.js file. See https://eslint.org/docs/latest/use/configure/migration-guide for details. An eslintrc configuration file is used because you have the ESLINT_USE_FLAT_CONFIG environment variable set to false. If you want to use an eslint.config.js file, remove the environment variable. If you want to find the location of the eslintrc configuration file, use the --debug flag.
(Use node --trace-warnings ... to show where the warning was created)

src/lib/telegram/chat/connectTelegramToAccount.ts

Oops! Something went wrong! :(

ESLint: 9.39.4

TypeError: Converting circular structure to JSON
--> starting at object with constructor 'Object'
| property 'configs' -> object with constructor 'Object'
| property 'flat' -> object with constructor 'Object'
| ...
| property 'plugins' -> object with constructor 'Object'
--- property 'react' closes the circle
Referenced from: /.eslintrc.json
at JSON.stringify ()
at /node_modules/.pnpm/@eslint+eslintrc@3.3.5/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2255:45
at Array.map ()
at ConfigValidator.formatErrors (/node_modules/.pnpm/@eslint+eslintrc@3.3.5/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2246:23)
at ConfigValidator.validateConfigSchema (/node_modules/.pnpm/@eslint+eslintrc@3.3.5/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2277:84)
at ConfigArrayFactory._normalizeConfigData (/node_modules/.pnpm/@eslint+eslintrc@3.3.5/node_modules/@eslint/

... [truncated 446 characters] ...

c/dist/eslintrc.cjs:3261:25)
at ConfigArrayFactory._normalizeObjectConfigDataBody (/node_modules/.pnpm/@eslint+eslintrc@3.3.5/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3199:25)
(node:2) ESLintRCWarning: You are using an eslintrc configuration file, which is deprecated and support will be removed in v10.0.0. Please migrate to an eslint.config.js file. See https://eslint.org/docs/latest/use/configure/migration-guide for details. An eslintrc configuration file is used because you have the ESLINT_USE_FLAT_CONFIG environment variable set to false. If you want to use an eslint.config.js file, remove the environment variable. If you want to find the location of the eslintrc configuration file, use the --debug flag.
(Use node --trace-warnings ... to show where the warning was created)

  • 5 others

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.

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

🧹 Nitpick comments (1)
src/lib/telegram/chat/commands/handleStart.ts (1)

9-9: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Keep the /start reply aligned with the shared connected-message copy.

This still says users can send “photos and captions,” while the centralized connected message now says photos, videos, or YouTube links. That leaves /start out of sync with the rest of the flow.

♻️ Suggested fix
-  const text = `Hello ${artistUsername || telegramUsername}, Your telegram has been connected! You can now send photos and captions to post them on In Process.`;
+  const text = `Hello ${artistUsername || telegramUsername}, Your Telegram is now connected. You can now send photos, videos, or YouTube links to create moments on In Process.`;
🤖 Prompt for 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.

In `@src/lib/telegram/chat/commands/handleStart.ts` at line 9, The /start reply in
handleStart is still using the old connected-message text and is out of sync
with the shared copy. Update the message built in handleStart to match the
centralized connected-message wording used elsewhere, including photos, videos,
or YouTube links, and keep the greeting structure with
artistUsername/telegramUsername unchanged.
🤖 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.

Nitpick comments:
In `@src/lib/telegram/chat/commands/handleStart.ts`:
- Line 9: The /start reply in handleStart is still using the old
connected-message text and is out of sync with the shared copy. Update the
message built in handleStart to match the centralized connected-message wording
used elsewhere, including photos, videos, or YouTube links, and keep the
greeting structure with artistUsername/telegramUsername unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1912399f-0b3b-403a-a80b-9b65a1016a52

📥 Commits

Reviewing files that changed from the base of the PR and between cd391b4 and 7066549.

📒 Files selected for processing (8)
  • src/lib/telegram/chat/__tests__/verifyTelegramCode.test.ts
  • src/lib/telegram/chat/commands/handleStart.ts
  • src/lib/telegram/chat/connectTelegramToAccount.ts
  • src/lib/telegram/chat/consts.ts
  • src/lib/telegram/chat/handlers/__tests__/onNewMention.test.ts
  • src/lib/telegram/chat/handlers/onNewMention.ts
  • src/lib/telegram/chat/promptTelegramEmail.ts
  • src/lib/telegram/chat/verifyTelegramCode.ts

@techeng322 techeng322 merged commit fe2027f into main Jul 9, 2026
3 checks passed
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