This pull request introduces several improvements to project configuration, documentation, and workflow automation. The most significant changes include the addition of standardized GitHub issue templates, updates to the .npmignore and code formatting rules, enhancements to the README.md for clarity and best practices, and improved workflow configuration for CI/CD processes.
GitHub Issue Templates and Project Configuration:
Added standardized GitHub issue templates for bug reports, enhancements, and improvements, making it easier for contributors to report and track issues. [1][2][3]
Disabled blank issues in the GitHub issue configuration to enforce use of the provided templates.
Documentation Updates:
Overhauled the README.md with updated installation instructions, best practices, clearer dependency requirements, and improved examples for using the AudioManager. Also updated for compatibility with discord.js/voice v0.19. [1][2]
Added FrauJulian as the CODEOWNER and clarified contributor information. [1][2]
Project Ignore and Formatting Rules:
Updated .npmignore and added .prettierignore to better control which files are published and formatted, and improved .prettierrc formatting settings for consistency. [1][2][3]
Added .gitattributes to explicitly set line endings and language for TypeScript and JavaScript files.
Workflow and Automation Enhancements:
Improved GitHub Actions workflows for build validation and deployment, including better trigger configuration and naming. [1][2]
Updated .husky/pre-commit to use stricter formatting and lint checks.
Refined eslint.config.cjs for clearer rules, improved comments, and better maintainability. [1][2][3]
Minor correction to .github/dependabot.yml formatting.
These changes collectively improve the project's maintainability, contributor experience, and consistency across development and deployment workflows.
This pull request introduces several improvements to project configuration, documentation, and workflow automation. The most significant changes include the addition of standardized GitHub issue templates, updates to the `.npmignore` and code formatting rules, enhancements to the `README.md` for clarity and best practices, and improved workflow configuration for CI/CD processes.
**GitHub Issue Templates and Project Configuration:**
* Added standardized GitHub issue templates for bug reports, enhancements, and improvements, making it easier for contributors to report and track issues. [[1]](diffhunk://#diff-8d28bc04ebe9c5d58fca939112999ab695ba755a882c908296ff7bd65bec42deR1-R42) [[2]](diffhunk://#diff-6beb416586c4731c5c2194db41281446efceebf9f99cdbe2fa569d4a50e2d06fR1-R29) [[3]](diffhunk://#diff-e881e7f01b34bcce6a796b0ff086b14f08ce724fe991126c8fa31bb989a5b3a8R1-R39)
* Disabled blank issues in the GitHub issue configuration to enforce use of the provided templates.
**Documentation Updates:**
* Overhauled the `README.md` with updated installation instructions, best practices, clearer dependency requirements, and improved examples for using the `AudioManager`. Also updated for compatibility with `discord.js/voice` v0.19. [[1]](diffhunk://#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5L7-R75) [[2]](diffhunk://#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5L76-R125)
* Added `FrauJulian` as the CODEOWNER and clarified contributor information. [[1]](diffhunk://#diff-fcf14c4b7b34fe7a11916195871ae66a59be87a395f28db73e345ebdc828085bR1) [[2]](diffhunk://#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5L76-R125)
**Project Ignore and Formatting Rules:**
* Updated `.npmignore` and added `.prettierignore` to better control which files are published and formatted, and improved `.prettierrc` formatting settings for consistency. [[1]](diffhunk://#diff-34958b02363eec9a904716f0b4a8782b021c6b33b2e8599019e36c88e045240bL1-R29) [[2]](diffhunk://#diff-b640b344ee7f3f03d2a443795a5d0708ef50e2e6e34214109ab2aad13ad6ba98R1-R5) [[3]](diffhunk://#diff-663ade211b3a1552162de21c4031fcd16be99407aae5ceecbb491a2efc43d5d2L2-R3)
* Added `.gitattributes` to explicitly set line endings and language for TypeScript and JavaScript files.
**Workflow and Automation Enhancements:**
* Improved GitHub Actions workflows for build validation and deployment, including better trigger configuration and naming. [[1]](diffhunk://#diff-5730f8ad7af8f3d30fe5dc771f6566c3a7d7a5816a065cc619f20205fe1d1a92L1-R1) [[2]](diffhunk://#diff-929f4dcc9d4e06367b01c3bc6b6d990297bb422233f4ec493605150ed8e1812cR4)
* Updated `.husky/pre-commit` to use stricter formatting and lint checks.
* Refined `eslint.config.cjs` for clearer rules, improved comments, and better maintainability. [[1]](diffhunk://#diff-ade92dc557e1c37f3e97d3323edfba82ec5ae154ff4325ddd06962631a5c2666L3-L17) [[2]](diffhunk://#diff-ade92dc557e1c37f3e97d3323edfba82ec5ae154ff4325ddd06962631a5c2666L31-R39) [[3]](diffhunk://#diff-ade92dc557e1c37f3e97d3323edfba82ec5ae154ff4325ddd06962631a5c2666L66-L89)
* Minor correction to `.github/dependabot.yml` formatting.
These changes collectively improve the project's maintainability, contributor experience, and consistency across development and deployment workflows.
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {{contents: read}}
## Workflow does not contain permissions
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {{contents: read}}
[Show more details](https://github.com/FrauJulian/Discord-Audio-Stream/security/code-scanning/2)
copilot-pull-request-reviewer[bot]
(Migrated from github.com)
left a comment
Copy Link
Copy Source
Pull request overview
This PR refactors the AudioManager class and updates project configuration to improve maintainability, contributor experience, and 24/7 audio streaming reliability. The changes include a complete rewrite of the audio streaming implementation, updated documentation for discord.js/voice v0.19 compatibility, and standardized GitHub issue templates.
Key changes:
Major refactoring of AudioManager with improved resource management, FFmpeg process control, and automatic connection renewal
Updated dependency management: moved core dependencies to peerDependencies and bumped Node.js requirement to 22.12.0
## Pull request overview
This PR refactors the AudioManager class and updates project configuration to improve maintainability, contributor experience, and 24/7 audio streaming reliability. The changes include a complete rewrite of the audio streaming implementation, updated documentation for discord.js/voice v0.19 compatibility, and standardized GitHub issue templates.
Key changes:
- Major refactoring of AudioManager with improved resource management, FFmpeg process control, and automatic connection renewal
- Updated dependency management: moved core dependencies to peerDependencies and bumped Node.js requirement to 22.12.0
- Added GitHub issue templates, improved documentation, and enhanced code formatting/linting configuration
### Reviewed changes
Copilot reviewed 19 out of 28 changed files in this pull request and generated 8 comments.
<details>
<summary>Show a summary per file</summary>
| File | Description |
| ---- | ----------- |
| src/audio-manager.ts | Complete refactor with FFmpeg process management, proper resource cleanup, and async/await patterns |
| package.json | Updated dependencies, moved @discordjs/voice to peerDependencies, bumped Node.js requirement to 22.12.0 |
| set-version.js | Added automated versioning script using day-of-year timestamp format |
| README.md | Updated installation instructions, API documentation, and best practices for v0.19 compatibility |
| eslint.config.cjs | Cleaned up comments and formatting for better maintainability |
| .prettierrc | Changed tabWidth from 2 to 4 and printWidth from 140 to 120 |
| .npmignore | Reorganized ignore patterns with better grouping |
| .husky/pre-commit | Changed from auto-fixing to strict validation checks |
| .github/workflows/*.yml | Added workflow_dispatch trigger and improved naming |
| .github/ISSUE_TEMPLATE/*.yaml | Added standardized templates for bugs, enhancements, and improvements |
| .gitattributes | Enforced CRLF line endings for TypeScript/JavaScript files |
| CODEOWNERS | Added FrauJulian as code owner |
</details>
---
💡 <a href="/FrauJulian/Discord-Audio-Stream/new/master/.github/instructions?filename=*.instructions.md" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Add Copilot custom instructions</a> for smarter, more guided reviews. <a href="https://docs.github.com/en/copilot/customizing-copilot/adding-repository-custom-instructions-for-github-copilot" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Learn how to get started</a>.
Enforcing CRLF line endings for source files will cause issues for contributors on Unix-based systems (Linux/macOS) where LF is standard. Consider using eol=lf or removing the eol directive to let Git handle line endings automatically based on each contributor's system settings.
*.ts text linguist-language=TypeScript
*.tsx text linguist-language=TypeScript
*.mts text linguist-language=TypeScript
*.cts text linguist-language=TypeScript
*.js text linguist-language=JavaScript
*.jsx text linguist-language=JavaScript
*.mjs text linguist-language=JavaScript
*.cjs text linguist-language=JavaScript
Enforcing CRLF line endings for source files will cause issues for contributors on Unix-based systems (Linux/macOS) where LF is standard. Consider using `eol=lf` or removing the eol directive to let Git handle line endings automatically based on each contributor's system settings.
```suggestion
*.ts text linguist-language=TypeScript
*.tsx text linguist-language=TypeScript
*.mts text linguist-language=TypeScript
*.cts text linguist-language=TypeScript
*.js text linguist-language=JavaScript
*.jsx text linguist-language=JavaScript
*.mjs text linguist-language=JavaScript
*.cjs text linguist-language=JavaScript
```
Corrected spelling of 'Practise' to 'Practice'. In this context (noun), 'practice' is the correct spelling.
> **Recommended best Practice:**
Corrected spelling of 'Practise' to 'Practice'. In this context (noun), 'practice' is the correct spelling.
```suggestion
> **Recommended best Practice:**
```
Invalid version format. Package versions must follow semantic versioning (semver) format. The placeholder "DDDhhmm" will cause npm publish to fail. This should be replaced by the set-version.js script before publishing.
"version": "0.7.0",
Invalid version format. Package versions must follow semantic versioning (semver) format. The placeholder "DDDhhmm" will cause npm publish to fail. This should be replaced by the set-version.js script before publishing.
```suggestion
"version": "0.7.0",
```
Use nullish coalescing operator (??) instead of ternary for more precise null/undefined handling. The current code treats 0 as falsy when it could be a valid value. Change to this.renewMs = renewMs ?? 5400000;
this.renewMs = renewMs ?? 5400000;
Use nullish coalescing operator (??) instead of ternary for more precise null/undefined handling. The current code treats 0 as falsy when it could be a valid value. Change to `this.renewMs = renewMs ?? 5400000;`
```suggestion
this.renewMs = renewMs ?? 5400000;
```
Duplicate audioPlayer.stop() calls on lines 163 and 167. The first call with parameter true and the second without parameters both stop the player. Remove one of these duplicate operations.
Duplicate audioPlayer.stop() calls on lines 163 and 167. The first call with parameter `true` and the second without parameters both stop the player. Remove one of these duplicate operations.
Empty catch block silently swallows all errors during disposal. At minimum, log errors for debugging purposes or add a comment explaining why errors are intentionally ignored.
} catch (err) {
console.error('Error during AudioManager.Dispose:', err);
}
Empty catch block silently swallows all errors during disposal. At minimum, log errors for debugging purposes or add a comment explaining why errors are intentionally ignored.
```suggestion
} catch (err) {
console.error('Error during AudioManager.Dispose:', err);
}
```
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
This pull request introduces several improvements to project configuration, documentation, and workflow automation. The most significant changes include the addition of standardized GitHub issue templates, updates to the
.npmignoreand code formatting rules, enhancements to theREADME.mdfor clarity and best practices, and improved workflow configuration for CI/CD processes.GitHub Issue Templates and Project Configuration:
Documentation Updates:
README.mdwith updated installation instructions, best practices, clearer dependency requirements, and improved examples for using theAudioManager. Also updated for compatibility withdiscord.js/voicev0.19. [1] [2]FrauJulianas the CODEOWNER and clarified contributor information. [1] [2]Project Ignore and Formatting Rules:
.npmignoreand added.prettierignoreto better control which files are published and formatted, and improved.prettierrcformatting settings for consistency. [1] [2] [3].gitattributesto explicitly set line endings and language for TypeScript and JavaScript files.Workflow and Automation Enhancements:
.husky/pre-committo use stricter formatting and lint checks.eslint.config.cjsfor clearer rules, improved comments, and better maintainability. [1] [2] [3].github/dependabot.ymlformatting.These changes collectively improve the project's maintainability, contributor experience, and consistency across development and deployment workflows.
Workflow does not contain permissions
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {{contents: read}}
Show more details
Pull request overview
This PR refactors the AudioManager class and updates project configuration to improve maintainability, contributor experience, and 24/7 audio streaming reliability. The changes include a complete rewrite of the audio streaming implementation, updated documentation for discord.js/voice v0.19 compatibility, and standardized GitHub issue templates.
Key changes:
Reviewed changes
Copilot reviewed 19 out of 28 changed files in this pull request and generated 8 comments.
Show a summary per file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
@@ -0,0 +6,4 @@*.js text eol=crlf linguist-language=JavaScript*.jsx text eol=crlf linguist-language=JavaScript*.mjs text eol=crlf linguist-language=JavaScript*.cjs text eol=crlf linguist-language=JavaScriptEnforcing CRLF line endings for source files will cause issues for contributors on Unix-based systems (Linux/macOS) where LF is standard. Consider using
eol=lfor removing the eol directive to let Git handle line endings automatically based on each contributor's system settings.@@ -11,0 +13,4 @@> your music never stops playing due to ffmpeg or Discord, with as little effort as possible.> **Recommended best Practise:**> Create a global Map<GuildId, AudioManager> (Map<KEY, OBJ>) list. When the feature is used on a guild, add a newCorrected spelling of 'Practise' to 'Practice'. In this context (noun), 'practice' is the correct spelling.
@@ -77,2 +88,3 @@### Fields and Methods of AudioManager#### Properties#### FieldsSyntax error in type declaration. There's a misplaced comma in 'renewInMs, number'. Should be 'renewInMs: number'.
Corrected spelling of 'Promis' to 'Promises'.
@@ -91,0 +54,4 @@"eslint --fix","prettier --write"],"*.{json,md,yml,yaml}": [Invalid version format. Package versions must follow semantic versioning (semver) format. The placeholder "DDDhhmm" will cause npm publish to fail. This should be replaced by the set-version.js script before publishing.
@@ -56,3 +41,1 @@this.DestroyConnection(false);if (this.IsActive) {this.CreateConnection(true);public OverrideVoiceAudioDataModel(audioData: VoiceAudioDataModel): void {Use nullish coalescing operator (??) instead of ternary for more precise null/undefined handling. The current code treats 0 as falsy when it could be a valid value. Change to
this.renewMs = renewMs ?? 5400000;Duplicate audioPlayer.stop() calls on lines 163 and 167. The first call with parameter
trueand the second without parameters both stop the player. Remove one of these duplicate operations.Empty catch block silently swallows all errors during disposal. At minimum, log errors for debugging purposes or add a comment explaining why errors are intentionally ignored.