Skip to content

ignore non-command messages#2

Merged
nett00n merged 2 commits intomainfrom
fix/ignore-non-command-messages-in-group-chats
Dec 15, 2025
Merged

ignore non-command messages#2
nett00n merged 2 commits intomainfrom
fix/ignore-non-command-messages-in-group-chats

Conversation

@nett00n
Copy link
Copy Markdown
Contributor

@nett00n nett00n commented Dec 15, 2025

Summary by CodeRabbit

  • Bug Fixes

    • Bot no longer sends a default help message in group or supergroup chats for non-command messages; private chat help prompts remain unchanged
  • Chores

    • Container runtime package installation now skips maintainer scripts during CA certificate installation (no user-visible behavior change)

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Dec 15, 2025

Walkthrough

Message handling in the bot now ignores non-command messages in group and supergroup chats while still sending the help prompt in private chats. The Dockerfile runtime stage installation of CA certificates was changed to add the --no-scripts flag to apk to prevent maintainer scripts from running.

Changes

Cohort / File(s) Summary
Message handling
internal/bot/bot.go
In handleMessage, added an early return to skip non-command messages for group and supergroup chat types; help prompt is now sent only for private chats.
Runtime image install
Dockerfile
In the runtime stage, changed apk --no-cache add ca-certificates to apk --no-cache --no-scripts add ca-certificates to prevent maintainer scripts from running during package installation.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Small, focused changes across two files (one behavioral, one build/runtime tweak).
  • Areas to check:
    • internal/bot/bot.go: ensure chat type values match runtime Telegram library enums and no side effects for bot admins in groups.
    • Dockerfile: verify no required maintainer scripts are needed for CA certificate installation in this base image.

Poem

🐰 I hop through code and tidy trails,
In groups I hush my tiny wails,
But in a private, cozy nook,
I offer help — a friendly look.
Paws on keys, I celebrate these tweaks! 🥕

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title 'ignore non-command messages' accurately reflects the primary change in the changeset, which modifies the bot to ignore non-command messages in group/supergroup chats while retaining handling for private chats.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/ignore-non-command-messages-in-group-chats

📜 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 fb65ef4 and 17105cd.

📒 Files selected for processing (1)
  • Dockerfile (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build
🔇 Additional comments (1)
Dockerfile (1)

23-23: Verify that --no-scripts doesn't break CA certificate installation.

The --no-scripts flag is a good security practice to prevent arbitrary code execution during package installation. However, confirm that CA certificates are properly installed and function without post-install scripts, particularly for SSL/TLS validation in the runtime environment.

Please verify:

  1. That the --no-scripts flag is supported in alpine:latest
  2. That CA certificates are properly installed and functional after application startup

You can test this by running the container and verifying HTTPS connections work as expected.


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.

@nett00n nett00n merged commit 435ec65 into main Dec 15, 2025
2 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