refactor: clean code#110
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors several interaction managers to use more specific internal collection names (instead of the generic interactions) and adds startup logging after loading manager data. It also updates tooling/runtime requirements (pnpm/Node) and refreshes dependencies in the lockfile.
Changes:
- Rename manager backing collections from
interactionsto domain-specific names (commands,buttons,modals, etc.) and addlogger.infoload summaries. - Update package/tooling requirements (Node engine, pnpm version) and bump package version.
- Update dependency versions (e.g.,
i18next,tsdown, and related transitive deps) and adjust the publish workflow pnpm action version.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/managers/SelectMenuManager.ts | Rename internal collection to selectMenus and log loaded count. |
| src/managers/ModalManager.ts | Rename internal collection to modals and log loaded count. |
| src/managers/EventManager.ts | Rename internal collection to events and log loaded count. |
| src/managers/ContextMenuManager.ts | Rename internal collection to contextMenus and log loaded count. |
| src/managers/CommandManager.ts | Rename internal collection to commands and log loaded count. |
| src/managers/ButtonManager.ts | Rename public collection field to buttons and log loaded count. |
| src/managers/AutoCompleteManager.ts | Rename internal collection to autoCompletes and log loaded count (message wording needs adjustment). |
| pnpm-workspace.yaml | Add pnpm workspace-level allowBuilds configuration (may require packages:). |
| pnpm-lock.yaml | Refresh lockfile for updated dependencies/tooling. |
| package.json | Bump version, raise Node engine requirement, update pnpm and dependency versions. |
| .github/workflows/publish-npm.yml | Update pnpm action setup to v6. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| this.autoCompletes = await requiredFiles<AutoCompleteStructure>(this.directoryPath); | ||
| this.setManagerLoaded(); | ||
|
|
||
| logger.info(`Loaded ${this.autoCompletes.size} auto complete`); |
| export class ButtonManager extends BaseManager<ButtonStructure> { | ||
| public interactions: Collection<StructureCustomId, ButtonStructure> = new Collection(); | ||
| public buttons: Collection<StructureCustomId, ButtonStructure> = new Collection(); | ||
|
|
Comment on lines
+3
to
11
| "version": "1.7.3", | ||
| "type": "module", | ||
| "description": "A framework for simplifying the creation of discord bots", | ||
| "author": "Tweenty_", | ||
| "license": "ISC", | ||
| "packageManager": "pnpm@10.33.2", | ||
| "packageManager": "pnpm@11.0.8", | ||
| "engines": { | ||
| "node": ">=20.19.0" | ||
| "node": ">=24.0.0" | ||
| }, |
Comment on lines
+1
to
+2
| allowBuilds: | ||
| unrs-resolver: true |
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



No description provided.