Skip to main content

Welcome Contributors

Thank you for your interest in contributing to PFP Checker! This open-source Discord bot is built with Rust and tracks profile pictures, usernames, and server icons. We welcome contributions of all kinds: bug fixes, new features, documentation improvements, and more.

Code of Conduct

By participating in this project, you are expected to uphold our Code of Conduct:
  • Be respectful: Treat all contributors with respect and professionalism
  • Be constructive: Provide helpful feedback and suggestions
  • Be collaborative: Work together to improve the project

Getting Started

To start contributing to PFP Checker, follow these steps:
1

Fork the repository

Visit the GitHub repository and click the “Fork” button to create your own copy.
2

Clone your fork

git clone https://github.com/YOUR-USERNAME/pfp-checker.git
cd pfp-checker
3

Create a feature branch

git checkout -b feature/your-feature-name
Use descriptive branch names like feature/add-cooldown-tracking or fix/database-connection-leak.
Before making significant changes, consider opening an issue to discuss your ideas with the maintainers.

Development Workflow

Once you’ve set up your development environment (see Setup Guide), follow this workflow:

Making Changes

  1. Write your code: Make your changes in your feature branch
  2. Write or update tests: Ensure your changes are covered by tests
  3. Test your changes: Run the test suite to verify everything works
    cargo test
    
  4. Format your code: Use Rust’s standard formatter
    cargo fmt
    
  5. Run the linter: Check for common issues and code quality
    cargo clippy
    
  6. Update documentation: If you’ve changed functionality, update relevant documentation

Code Quality Standards

  • Follow standard Rust style conventions
  • Use meaningful variable and function names
  • Comment complex sections of code
  • Keep functions small and focused
  • Avoid unwrap() in production code - use proper error handling

Submitting Changes

1

Commit your changes

git add .
git commit -m "Add feature: brief description"
Write clear, concise commit messages that explain the “why” behind your changes.
2

Push to your fork

git push origin feature/your-feature-name
3

Submit a pull request

  1. Go to the original repository on GitHub
  2. Click “New Pull Request”
  3. Select your fork and branch
  4. Describe your changes in detail
  5. Link any related issues using Fixes #123 or Closes #123

Pull Request Process

When you submit a pull request:
  1. Include tests: If adding functionality, include appropriate tests
  2. Update documentation: Update README.md or other docs if needed
  3. Await review: A maintainer will review your PR and may request changes
  4. Address feedback: Make any requested changes promptly
  5. Merge: Once approved, a maintainer will merge your PR
Pull requests are typically reviewed within a few days. Be patient and responsive to feedback.

Testing Approach

PFP Checker uses Rust’s built-in testing framework:
  • Unit tests: Test individual functions and modules
  • Integration tests: Test component interactions
  • Database tests: Use temporary databases for testing queries
Run all tests:
cargo test
Run specific tests:
cargo test test_name
Run tests with output:
cargo test -- --nocapture

Database Migrations

If your contribution requires database schema changes:
1

Create a new migration

sqlx migrate add your_migration_name
This creates a new SQL file in the migrations/ directory with a timestamp prefix.
2

Edit the migration file

Write your SQL schema changes in the generated file. Include both forward migrations and any necessary rollback logic in comments.
3

Test the migration

sqlx database reset --database-url sqlite:database.sqlite
This drops the database, recreates it, and runs all migrations.
4

Update queries

If you’ve changed the schema, update any affected SQLx queries in the codebase.
Always test migrations thoroughly. Database changes can cause data loss if not handled properly.
See the Database Guide for more details on the schema and migration workflow.

What to Contribute

Here are some ways you can contribute:

Bug Fixes

  • Fix issues listed in the GitHub issue tracker
  • Resolve compiler warnings or clippy suggestions
  • Improve error handling and edge cases

New Features

  • Add new Discord commands
  • Implement tracking for additional Discord entities
  • Add statistics and analytics features
  • Improve the automatic update scheduler

Documentation

  • Improve inline code documentation
  • Add examples to README.md
  • Write tutorials or guides
  • Fix typos or clarify existing docs

Performance

  • Optimize database queries
  • Reduce memory usage
  • Improve response times

Code Quality

  • Refactor complex functions
  • Add missing tests
  • Improve error messages
  • Reduce code duplication

Getting Help

If you have questions or need assistance:
  • Open an issue: For bugs, feature requests, or questions
  • Check existing issues: Someone may have already asked your question
  • Read the documentation: Review the Architecture and Setup guides
  • Review the code: The codebase is well-organized and documented
Don’t hesitate to ask questions! The maintainers are happy to help contributors get started.

Recognition

All contributors will be:
  • Listed in the project’s contributors page on GitHub
  • Acknowledged in release notes for their contributions
  • Part of an open-source community building useful tools

Next Steps

Setup Guide

Set up your development environment

Architecture

Learn about the codebase structure

Database Schema

Understand the database design

GitHub Repository

View the source code

Build docs developers (and LLMs) love