feat: add /nuke slash command#32
Conversation
Adds an admin-only /nuke command that clones the current channel (with all permissions, overwrites, topic, nsfw, rate limit, category, and auto-archive duration) and then deletes the old channel — appearing as a fresh chat while preserving the channel's configuration. - Admin-gated via hasAdminRole (ADMIN_ROLE_ID), matching /wipe. - Confirm/cancel buttons with a 15s timeout before any destructive action. - Detects bot-related channels (WELCOME_CHANNEL_ID, HONEYPOT_CHANNEL_ID) and surfaces an extra warning naming the affected features, since the new channel ID will break anything referencing the old one. - Transactional error handling: if the clone fails the original channel is left untouched; if the delete fails after a successful clone, the admin is told to remove the old channel manually. - Position is restored via setPosition so the clone sits in the same spot. - Final outcome is reported in the new channel (the ephemeral reply dies with the deleted channel).
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 12 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (5)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (5 files)
Reviewed by hy3-20260706:free · Input: 76.6K · Output: 9.7K · Cached: 118.4K |
|
Hey @Nivmizz7 — PR #32 ( All CI checks pass: 3 CodeAnt suggestions were reviewed and replied to — all are false positives or non-actionable style preferences (details in the inline replies). No code changes needed. What /nuke does:
Post-merge verification:
|
User description
Summary
/nuke, an admin-only slash command that clones the current channel (carrying over all permissions/overwrites, topic, nsfw, rate limit, parent category, and auto-archive duration) and then deletes the old channel — appearing as a fresh chat while preserving configuration.hasAdminRole(ADMIN_ROLE_ID), matching the/wipepattern.WELCOME_CHANNEL_IDorHONEYPOT_CHANNEL_ID, the confirm warning names the affected features and warns that the new channel ID will break them.setPositionso the clone sits in the same spot.Design notes
/wipecommand structure exactly:executeNuke(interaction)insrc/commands/nukeCommand.js, confirm/cancel buttons,createCardEmbed, sharedcolors.warning.getAffectedBotFeatures(channelId)is exported and unit-tested so the bot-channel warning logic is covered without needing a live Discord interaction.guild.channels.createclone options against discord.js v14.26.4 typings (CategoryCreateChannelOptions) and the official permissions guide (permission overwrites can be passed as aCollectiondirectly from the old channel's cache).Test plan
npm test— 9/9 pass (4 env + 2 honeypot + 3 nuke helper tests)node --checksyntax sweep passes on all JS filesADMIN_ROLE_IDfor gating and existing channel IDs for the bot-channel warning/nukein a test channel, confirm clone carries permissions, confirm old channel is deleted, confirm position is preserved/nukein the welcome channel, confirm the bot-channel warning appears naming "welcome messages (WELCOME_CHANNEL_ID)"CodeAnt-AI Description
Add a confirmable
/nukecommand to replace a channel in placeWhat Changed
/nukefor admins to clone the current text channel with its permissions, settings, and position, then delete the old channel/nukein the command listImpact
✅ Faster channel resets✅ Fewer accidental channel deletions✅ Clearer warnings for bot-linked channels💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.