Thank you for your interest in contributing to Discord.py Masterclass. This guide will help you understand how to contribute effectively to this project.
- Code of Conduct
- How Can I Contribute?
- Development Setup
- Coding Guidelines
- Commit Guidelines
- Pull Request Process
- Documentation Guidelines
This project is governed by our Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to the project maintainers.
Before creating bug reports, please check existing issues to avoid duplicates. Include these details in your bug report:
- Clear and descriptive title
- Steps to reproduce the problem
- Specific examples and code snippets
- Expected vs. actual behavior
- Python version, discord.py version, and OS information
Feature suggestions should include:
- Clear title and detailed description
- Explanation of why the feature would be useful
- Examples of how it would be used
Documentation improvements include:
- Fixing typos or grammatical errors
- Adding missing documentation
- Improving existing explanations
- Adding more examples
Code contributions are welcome in these areas:
- Adding new examples
- Improving existing examples
- Fixing bugs
- Implementing new features
- Improving code quality and performance
- Python 3.9 or higher
- Git
- uv (package manager)
-
Fork the repository and clone your fork:
git clone https://github.com/YOUR_USERNAME/discord.py-masterclass.git cd discord.py-masterclass -
Add upstream remote:
git remote add upstream https://github.com/FallenDeity/discord.py-masterclass.git
-
Install dependencies:
uv sync --locked --all-extras --dev
-
Set up pre-commit hooks (recommended):
uv run pre-commit install
- Follow PEP 8 with 120 character line length
- Use Black for code formatting
- Use isort for import sorting
- Code must pass Ruff linting checks
- Include type hints where applicable
Run these commands before submitting:
uv run black .
uv run isort .
uv run ruff check .Or use pre-commit hooks:
uv run pre-commit run --all-files-
Naming Conventions
- snake_case for functions and variables
- PascalCase for class names
- UPPER_CASE for constants
-
Documentation
- Add docstrings to functions and classes
- Include type hints in function signatures
- Comment complex logic
-
Discord.py Standards
- Use application commands where appropriate
- Implement proper error handling
- Use cogs for command organization
- Follow existing example patterns
-
Example Requirements
- Self-contained and runnable
- Well-commented
- Beginner-friendly when possible
-
Update your fork:
git fetch upstream git checkout master git merge upstream/master
-
Create a feature branch:
git checkout -b feature/your-feature-name
-
Make your changes and run quality checks:
uv run pre-commit run --all-files
-
Test documentation build (if applicable):
uv run mkdocs build
-
Commit and push:
git add . git commit -m "feat: your descriptive commit message" git push origin feature/your-feature-name
- Go to the original repository on GitHub
- Click "New Pull Request"
- Select your fork and branch
- Fill out the PR template with:
- Clear description of changes
- Related issue numbers (if applicable)
- Testing steps
- Use clear, concise language
- Include practical code examples
- Maintain consistent formatting
- Test all code examples
- Link to relevant discord.py documentation
- Create a new
.mdfile in thedocs/directory - Add it to
mkdocs.ymlin thenavsection - Follow existing documentation structure
- Include practical examples
- Questions: Open a Discussion
- Bugs: Open an Issue
By contributing, you agree that your contributions will be licensed under the MIT License.