Thank you for your interest in contributing to TempVoice! This document provides guidelines and instructions for contributing.
- Code of Conduct
- Getting Started
- Development Workflow
- Code Style
- Project Structure
- Testing
- Submitting Changes
- Be respectful and inclusive
- Provide constructive feedback
- Focus on what is best for the community
- Show empathy towards other community members
- Node.js >= 18.0.0
- npm or yarn
- A Discord bot token for testing
- A test Discord server
-
Fork and clone the repository
git clone https://github.com/YOUR-USERNAME/tempvoice.git cd tempvoice -
Install dependencies
npm install
-
Configure environment
cp env.example .env # Edit .env with your test bot credentials -
Run the bot
npm start
-
Run linter
npm run lint
main- Production-ready codedevelop- Development branch (if applicable)feature/your-feature-name- Feature branchesfix/bug-description- Bug fix branches
-
Create a new branch
git checkout -b feature/amazing-feature
-
Make your changes
- Write clear, commented code
- Follow the existing code style
- Add JSDoc comments to functions
- Test your changes thoroughly
-
Commit your changes
git add . git commit -m "feat: add amazing feature"
Commit Message Format:
feat:- New featurefix:- Bug fixdocs:- Documentation changesstyle:- Code style changes (formatting, etc.)refactor:- Code refactoringtest:- Adding or updating testschore:- Maintenance tasks
-
Push to your fork
git push origin feature/amazing-feature
-
Create a Pull Request
- Use a clear, descriptive title
- Describe what changes you made and why
- Reference any related issues
- Use ES6+ features (arrow functions, destructuring, etc.)
- Use
constby default,letwhen reassignment is needed - No
var - Use template literals for string interpolation
- Prefer async/await over raw promises
- Variables/Functions:
camelCase - Constants:
UPPER_SNAKE_CASE - Classes:
PascalCase - Files:
camelCase.jsfor utilities,PascalCase.jsfor classes
- Keep functions small and focused (single responsibility)
- Extract magic numbers to
src/constants.js - Add comments for complex logic
- Use JSDoc for function documentation
/**
* Creates a temporary voice channel for a user
* @param {GuildMember} member - Discord guild member
* @param {VoiceChannel} triggerChannel - The channel that triggered creation
* @returns {Promise<VoiceChannel>} The created temporary channel
*/
async function createTempChannel(member, triggerChannel) {
// Implementation
}src/
├── constants.js # Application constants
├── index.js # Entry point
├── core/
│ └── initializeBot.js # Bot initialization
├── events/ # Discord event handlers
│ ├── ready.js
│ ├── interactionCreate.js
│ ├── voiceStateUpdate.js
│ └── channelUpdate.js
├── modals/ # Button/Modal interaction handlers
│ ├── name.js
│ ├── limit.js
│ └── ...
├── handlers/ # Specialized handlers
│ └── embedSender.js
└── utils/ # Utility functions
├── database.js # Database operations
├── logger.js # Logging utilities
├── rateLimit.js # Rate limiting
├── contentFilter.js # Content filtering
└── ...
- Bot starts without errors
- Channel creation works
- All buttons function correctly
- Permissions are properly applied
- Rate limiting works as expected
- Content filter blocks inappropriate names
- Auto-cleanup removes old channels
- Database persists data across restarts
We're working on adding automated tests. When submitting new features, please consider:
- Edge cases
- Error scenarios
- Permission edge cases
- Rate limit scenarios
-
Update Documentation
- Update README.md if you added features
- Add entries to CHANGELOG.md
- Update JSDoc comments
-
Test Thoroughly
- Test on a real Discord server
- Check for console errors
- Verify no regressions in existing features
-
Keep PRs Focused
- One feature/fix per PR
- Avoid mixing refactoring with new features
-
Respond to Feedback
- Be open to suggestions
- Make requested changes promptly
- Explain your reasoning if you disagree
- Initial review within a few days
- Possible requests for changes
- Merge once approved by maintainers
- Create handler in
src/modals/yourfeature.js - Follow existing modal structure
- Add translation keys to language files
- Test all interaction flows
- Create
language/xx.js(xx = language code) - Copy structure from
language/en.js - Translate all keys
- Test thoroughly
- Update README with new language
- Update schema in
src/utils/database.js - Ensure backward compatibility
- Add migration logic if needed
- Document in CHANGELOG
- Open an issue for questions
- Join discussions in Issues/PRs
- Be patient and respectful
By contributing, you agree that your contributions will be licensed under the MIT License.
Thank you for contributing to TempVoice! 🎉