Thanks for your interest in improving the Discord Giveaway Bot. This document explains how to set up the project, the conventions the codebase follows, and how to get a change merged.
By participating you agree to abide by our Code of Conduct.
- Bugs: open a Bug report.
- Ideas: open a Feature request.
- Questions and support: use Discussions.
- Security issues: do not open a public issue. Follow SECURITY.md.
Please search existing issues first to avoid duplicates, and never include your bot token, database credentials, or other secrets in logs or screenshots.
Requirements:
- Node.js 22.x (LTS)
- MariaDB (locally via Docker or a server)
- A Discord application with a bot token
npm install
cp .env.example .env # then fill in DISCORD_TOKEN, CLIENT_ID, DATABASE_URL
npm run prisma:generate
npm run prisma:migrate # requires a reachable database
npm run deploy # register slash commands (uses GUILD_ID for fast dev deploy)
npm run dev # start with --watchA local MariaDB for testing can be started via Docker:
docker run -d --name giveaway-mariadb \
-e MARIADB_ROOT_PASSWORD=root -e MARIADB_DATABASE=giveaway_bot \
-p 3308:3306 mariadb:11Then set DATABASE_URL="mysql://root:root@localhost:3308/giveaway_bot" in .env.
The bot is JavaScript (ESM, "type": "module") on discord.js v14 with Prisma.
Please match the existing style:
- Commands:
export default { data: SlashCommandBuilder, async execute(client, interaction) } - Events:
export default { name, once?, async execute(client, ...args) } - Components:
export default { customId | prefix, async execute(client, interaction) } - Ephemeral replies: always use
flags: MessageFlags.Ephemeral, never the deprecatedephemeral: true. - i18n: every user-facing string goes through
t(guildId, key, vars)and must exist in all locale files (src/locales/en.json,de.json,fr.json,es.json).en.jsonis the default and the source of truth for keys. - Style: single quotes, semicolons,
async/await. - Security: validate all user input server-side, keep least-privilege intents and permissions intact, and never log secrets. See SECURITY.md for the full model.
Run the same checks CI runs, so the build stays green:
npm run i18n:check # locale key parity across en/de/fr/es
npm run smoke # smoke test
node --check src/index.js
npx prisma validateIf your change touches behavior, commands, config, or env variables, update the
relevant docs in the same change: README.md, CHANGELOG.md, and the
documentation at
docu.msk-scripts.de.
- Keep pull requests focused. One logical change per PR is easier to review.
- Write clear commit messages in English. Do not attach any AI attribution
or
Co-Authored-Bytrailers. - Reference related issues (for example
Fixes #123) in the PR description. - Fill out the pull request template and confirm the checklist.
This project is not open source. By contributing you agree that your contributions are made under the terms of the repository LICENSE, and that you have the right to submit them.