Contributions to the Capinetta RP Bot System are welcome and accepted under the MIT license. Whether you’re fixing a bug, proposing a new feature, or improving documentation, this guide covers everything you need: code standards, branch conventions, the pull request process, and how to engage with maintainers.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Capinetta-RP/capinetta-discord-bot/llms.txt
Use this file to discover all available pages before exploring further.
Because this system was originally built for a specific FiveM/GTA Roleplay community (Capi Netta RP), some features are tailored to that context. When contributing new functionality, please keep changes broadly applicable so the system remains useful to other communities who adopt it.
Code of Conduct
By participating in this project, you agree to the following standards:- Be respectful and constructive with all contributors.
- Accept constructive criticism gracefully.
- Focus on what is best for the community.
- Spam, harassment, discrimination, and inappropriate content are not tolerated.
Getting Started
Fork the repository
Fork the project on GitHub at https://github.com/Capinetta-RP/capinetta-discord-bot.
Create a feature branch
Set up your development environment
Follow the Quickstart guide to install dependencies, configure your
.env file, and run npx prisma db push to sync your local database schema.Make your changes
Write code that follows the Code Standards below. Keep commits focused and atomic.
Commit with a descriptive message
This project follows Conventional Commits:Commit types:
feat, fix, docs, style, refactor, perf, test, choreCode Standards
Language and Runtime
- Language: JavaScript (Node.js v18+). TypeScript is not required but type annotations via JSDoc comments are encouraged for complex utilities.
- Runtime: Requires Node.js
>=18.0.0and npm>=9.0.0as specified inpackage.json.
Naming and Style
- Indentation: 4 spaces — no tabs.
- Strings: Use double quotes for Discord message content; single quotes are acceptable in logic code. Be consistent within a file.
Async / Await
Always useasync/await. Avoid raw .then() callback chains — they make error handling harder to reason about.
Error Handling
Wrap all Discord API calls and database queries intry/catch. Log errors via the project’s structured logger.js utility — never swallow exceptions silently, and never expose raw stack traces to end users.
Discord.js Patterns
Prisma ORM
Define explicit field types and relations. Avoid using looseJson columns for structured data — create proper models with typed fields and indexes.
No Hardcoding
All configurable values — channel IDs, role IDs, thresholds, tokens — belong inconfig.js sourced from .env. Never hardcode credentials or environment-specific values directly in source files.
Comments
Document non-obvious logic with inline comments. Use JSDoc blocks for exported functions:Branch Naming
| Pattern | Purpose |
|---|---|
feature/description | New features |
fix/description | Bug fixes |
docs/description | Documentation-only changes |
refactor/description | Code restructuring without behavior change |
Pull Request Checklist
PR Checklist — expand before submitting
PR Checklist — expand before submitting
Before opening your PR for review, confirm all of the following:
- Code follows the style guidelines above (camelCase, 4-space indent, async/await)
- No hardcoded tokens, IDs, role IDs, or passwords anywhere in the diff
-
.env.exampleupdated if any new environment variables were introduced -
prisma/schema.prismaupdated andnpx prisma db pushruns without errors if database schema was changed - Commands work as expected in a test Discord server with appropriate permissions
- No regressions in existing commands (test common flows: tickets, warn, history, etc.)
- PR description clearly explains what changed and why
- Relevant documentation updated (inline comments, README section, or docs page)
Reporting Bugs
Check existing issues
Search GitHub Issues before opening a new one — your bug may already be tracked.
Reproduce on a separate branch
Confirm the bug is reproducible in isolation, not caused by a local configuration problem.
Open a new issue with full details
Include the following in your report:
- Node.js version:
node --version - Database: MariaDB/MySQL version
- Discord.js version: from
node_modules/discord.js/package.json - OS: e.g., Ubuntu 22.04, Windows 11
- Error message and full stack trace
- Steps to reproduce (numbered list)
- Expected behavior vs actual behavior
- Logs — paste relevant output from
pm2 logsor console
Suggesting Features
Open a GitHub Discussion for feature ideas rather than a GitHub Issue. In your discussion, include:- Use case: what problem does this solve for an RP community?
- Expected behavior: how should it work from the user’s perspective?
- Discord.js API references: link relevant docs if the feature depends on a specific API
- Alternatives considered: other approaches you thought about
Testing
Before submitting a PR, verify your changes manually:- Test all affected commands in a real Discord server with appropriate bot permissions.
- Confirm no existing functionality is broken (tickets, warn, history, etc.).
- Validate edge cases and permission boundaries.
Code Review Process
- The maintainer reviews the PR and may request changes or ask questions about design decisions.
- Once approved, the PR is merged into
main. - Changes are included in the next release and the
CHANGELOG.mdis updated.
