Hotfix for Staff Management & Ping Protection modules#193
Conversation
There was a problem hiding this comment.
Pull request overview
Hotfix bundle for the Staff Management and Ping Protection modules. It tightens permission checks, adds a Discord-limits fallback for localized confirmation modals, fixes a crash in the Ping Protection command file, makes the Reviews config behave correctly when no channel is set, retags the Staff Management module, and drops JSON.parse/JSON.stringify wrappers that the author considers unnecessary.
Changes:
- Add length-based fallback locale keys/values for destructive-confirmation modals (Ping Protection and Staff Management), and add the corresponding strings to
locales/en.json. - Move/repair staff-permission checks (
issueInfraction,issueSuspension,promoteUser) tosupervisorlevel using the general configuration, givereviews.jsonanelementToggle, and switch the Staff Management module tag toadministration. - Remove
JSON.parse/JSON.stringifyaroundsuspendedRoles,targetRoles, and embed templates; close the brokensubcommandsobject inping-protection.js.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| modules/ping-protection/events/interactionCreate.js | Adds length checks and fallback locale keys for the deletion modal. |
| modules/ping-protection/commands/ping-protection.js | Adds a closing brace meant to fix a startup crash in the subcommands object. |
| modules/staff-management-system/staff-management.js | Reworks permission checks, drops JSON (de)serialization around role arrays and embed templates. |
| modules/staff-management-system/events/interactionCreate.js | Adds modal-length fallbacks; drops JSON.parse on targetRoles. |
| modules/staff-management-system/events/botReady.js | Replaces JSON parsing of suspendedRoles with an Array.isArray check. |
| modules/staff-management-system/commands/staff-management.js | Removes unused JSON.parse on the profile embed template. |
| modules/staff-management-system/commands/duty.js | Adds modal-length fallbacks for the "void all" confirmation modal. |
| modules/staff-management-system/configs/reviews.json | Marks enableReviews as the elementToggle field. |
| modules/staff-management-system/module.json | Retags the module from moderation to administration. |
| locales/en.json | Adds fallback locale strings for both modules. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Either Claude that reviewed previously was yapping about JSON.parse/stringify wasn't needed was lying, or copilot is lying. Though Copilot sounds more confident so I am trusting copilot here lol |
Resolves conflict in staff-management.js (kept with-testing's template clone block). Also takes with-testing's commands/ping-protection.js, since the hotfix's brace/list change there targeted the old public structure and broke when combined with the synced version (its functional fix lives in interactionCreate.js, which merged cleanly). All hotfix fixes verified intact.
This PR consists of a hotfix for multiple bugs in my 2 modules - these bugs are fairly critical.
Besides it being a hotfix, it prepares the SMG module for the V2 development.
Bug fixes in this PR:
I think this is a fairly urgent PR, but take your time as personal life is still the biggest priority ^^