Skip to content

feat: add Telegram Bot API documentation support#18

Open
bojanstef wants to merge 1 commit intoamantus-ai:mainfrom
bojanstef:feature/add-telegram-support
Open

feat: add Telegram Bot API documentation support#18
bojanstef wants to merge 1 commit intoamantus-ai:mainfrom
bojanstef:feature/add-telegram-support

Conversation

@bojanstef
Copy link
Copy Markdown

@bojanstef bojanstef commented Feb 28, 2026

Summary

  • Adds core.telegram.org as an explicit exception in ALLOWED_EXCEPTIONS so Telegram's developer documentation passes URL validation
  • Covers the full Telegram Bot API reference (e.g. https://core.telegram.org/bots, https://core.telegram.org/bots/api)
  • Adds test coverage for the new exception alongside the existing ones

Test plan

  • Verify https://core.telegram.org/bots passes isValidDocumentationUrl
  • Verify https://core.telegram.org/bots/api passes isValidDocumentationUrl
  • Run npm test — all existing tests continue to pass

@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Feb 28, 2026

@bojanstef is attempting to deploy a commit to the Amantus Machina Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Feb 28, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 014f026 and a0ff01e.

📒 Files selected for processing (2)
  • src/constants.ts
  • src/utils/__tests__/url-utils.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/constants.ts

Walkthrough

Added a new TELEGRAM entry to ALLOWED_EXCEPTIONS in src/constants.ts with fields pattern: 'https://core.telegram.org/', name: 'Telegram Bot API', example: 'https://core.telegram.org/bots', and category: 'Messaging Platforms'. Added tests in src/utils/__tests__/url-utils.test.ts verifying https://core.telegram.org/, https://core.telegram.org/bots, and https://core.telegram.org/bots/api are valid documentation URLs and that lookalike domains (e.g., https://core.telegram.org.evil.com) are rejected. No other production logic was modified.

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


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.

Copy link
Copy Markdown

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

🧹 Nitpick comments (1)
src/utils/__tests__/url-utils.test.ts (1)

169-173: Add a lookalike-domain negative case for regression safety.

Consider asserting that similar-but-invalid hosts are rejected (e.g., core.telegram.org.evil.com) to guard future changes to exception matching.

🧪 Suggested test addition
       it('should validate Telegram Bot API', () => {
         expect(isValidDocumentationUrl('https://core.telegram.org/')).toBe(true);
         expect(isValidDocumentationUrl('https://core.telegram.org/bots')).toBe(true);
         expect(isValidDocumentationUrl('https://core.telegram.org/bots/api')).toBe(true);
+        expect(isValidDocumentationUrl('https://core.telegram.org.evil.com/bots')).toBe(false);
       });
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/utils/__tests__/url-utils.test.ts` around lines 169 - 173, Add a negative
lookalike-domain test to the existing Telegram Bot API spec: update the test
that calls isValidDocumentationUrl to also assert that a similar-but-invalid
host like 'https://core.telegram.org.evil.com' (or another subdomain-suffix
trick) returns false, ensuring isValidDocumentationUrl rejects lookalike domains
and preventing regression in the exception-matching logic.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/utils/__tests__/url-utils.test.ts`:
- Around line 169-173: Add a negative lookalike-domain test to the existing
Telegram Bot API spec: update the test that calls isValidDocumentationUrl to
also assert that a similar-but-invalid host like
'https://core.telegram.org.evil.com' (or another subdomain-suffix trick) returns
false, ensuring isValidDocumentationUrl rejects lookalike domains and preventing
regression in the exception-matching logic.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 7c31090 and 014f026.

📒 Files selected for processing (2)
  • src/constants.ts
  • src/utils/__tests__/url-utils.test.ts

Add core.telegram.org as an explicit exception in ALLOWED_EXCEPTIONS
so that Telegram's developer documentation (bots, API reference, etc.)
passes URL validation. Includes test coverage for the new exception.
@bojanstef bojanstef force-pushed the feature/add-telegram-support branch from 014f026 to a0ff01e Compare February 28, 2026 20:45
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