Skip to content

feat: pin and unpin commands#83

Merged
toto04 merged 2 commits intomainfrom
pin
Apr 11, 2026
Merged

feat: pin and unpin commands#83
toto04 merged 2 commits intomainfrom
pin

Conversation

@lorenzocorallo
Copy link
Copy Markdown
Member

No description provided.

@lorenzocorallo lorenzocorallo requested a review from toto04 April 11, 2026 14:48
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 11, 2026

Warning

Rate limit exceeded

@lorenzocorallo has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 0 minutes and 31 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 0 minutes and 31 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b20c1406-3871-43f6-ad4e-eafe8a4720ec

📥 Commits

Reviewing files that changed from the base of the PR and between 10f3071 and c2efd0f.

📒 Files selected for processing (1)
  • src/commands/pin.ts

Walkthrough

A new pin command module is added and registered with the command collection. The implementation provides two group-scoped commands (pin and unpin) that allow administrators to pin and unpin messages with permission validation and error handling.

Changes

Cohort / File(s) Summary
Pin Command Integration
src/commands/index.ts
Import and register pin command in the commands collection.
Pin Command Implementation
src/commands/pin.ts
New command module exporting pin and unpin commands. Validates replied message existence, checks bot administrator status and can_pin_messages capability, then calls Telegram API to pin/unpin with appropriate success/error feedback.
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title 'feat: pin and unpin commands' directly and clearly describes the main change: adding two new commands (pin and unpin) for message pinning functionality.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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


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
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: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/commands/pin.ts`:
- Around line 18-21: The early return that blocks handling replies when
repliedTo.from is missing should be removed; instead, allow processing based
solely on repliedTo.message_id (which is sufficient for the pin/unpin API
calls). Locate the checks that reference repliedTo.from (both the block at the
top and the similar block around lines 49-52) and either remove the return or
replace it with a non-fatal logger.warn that preserves flow, ensuring the /pin
and /unpin handlers use repliedTo.message_id to perform the Telegram API calls
even when repliedTo.from is undefined.
- Line 67: The confirmation message for the unpin flow incorrectly says "✅
Message pinned"; update the text used in the unpin handler so the success reply
reflects unpining. Locate the call using ephemeral(context.reply(fmt(({ n }) =>
n`✅ Message pinned`)), 10_000) in src/commands/pin.ts (the unpin branch/handler)
and change the message to indicate a successful unpin (e.g., "✅ Message
unpinned") so the ephemeral confirmation from context.reply/ephemeral/ fmt
matches the action.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 58b97d55-cbef-4346-80f1-b02ec1b7faaf

📥 Commits

Reviewing files that changed from the base of the PR and between 7bcc36f and 10f3071.

📒 Files selected for processing (2)
  • src/commands/index.ts
  • src/commands/pin.ts

Comment thread src/commands/pin.ts Outdated
Comment thread src/commands/pin.ts Outdated
@toto04 toto04 enabled auto-merge (squash) April 11, 2026 14:54
@toto04 toto04 merged commit a351fb7 into main Apr 11, 2026
2 checks passed
@toto04 toto04 deleted the pin branch April 11, 2026 14:54
@lorenzocorallo lorenzocorallo mentioned this pull request Apr 11, 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.

2 participants