Cardian is a Discord-native card game system built for fair, replayable gameplay with a clean, button-driven UI.
Status: Early development
Expect balance tweaks, UI polish, and occasional breaking changes.
- Games: Blackjack, Poker, Pyramid
- Modes: Casual, Ranked, Custom, SVS (Server vs Server)
- AI personalities (5): None, Cautious, Extreme, Contradicting, Grandmaster
- Controls: Buttons and dropdowns, no typing required
- Integrity: Anti-farming, match logging, monthly resets
Bot setup
cd cardian_botcp .env.example .env- Edit
.envwith your credentials npm install- Deploy slash commands:
node src/deploy-commands.js - Start with PM2:
pm2 start ecosystem.config.cjs - Save PM2 process list:
pm2 save
Website setup (separate service)
cd websitecp .env.example .env- Edit
.envwith your credentials npm install- Start with PM2:
pm2 start src/index.js --name cardian-web - Save PM2 process list:
pm2 save
| Command | Description |
|---|---|
/cardian |
Main hub and navigation |
/play |
Start a casual game |
/ranked |
Play competitive matches |
/custom |
Custom game configurations |
/variant |
View game variants |
/profile |
View player stats |
/achievements |
View achievements |
/mod |
Moderator tools (restricted) |
/dev |
Developer tools (restricted) |
Environment variables
See .env.example for all required and optional variables.
After changing environment variables:
pm2 restart all --update-env
Data storage
- User data:
./data/users.json - SVS data:
./data/svs.json - Integrity logs:
./data/integrity_logs.json - Farm flags:
./data/farm_flags.json - Backups:
./backups/
- Terms of Service:
/docs/tos.md - Privacy Policy:
/docs/privacy.md - Transparency:
/docs/transparency.md - Data Deletion:
/docs/deletion.md
Detailed documentation for each game:
- Wiki Index
- Blackjack
- Poker
- Pyramid
- Gin Rummy (Experimental - Patreon only)
- Mao (Experimental - Patreon only)
Cardian is source-available under the Cardian Source-Available License (CSAL) v1.0 (see LICENSE).
You can run and modify it, but you can’t use it to provide a competing hosted bot/service.
If Cardian is discontinued (repo archived or no maintenance activity for 12 months), it becomes open source under the MIT License (see OPEN_SOURCE_LICENSE).
License summary (CSAL v1.0)
| Permissions | Limitations | Conditions |
|---|---|---|
| Run and modify Cardian | No competing hosted bot/service | Keep LICENSE and notices |
| Fork and redistribute | No trademark/branding rights | Mark significant changes |
| Self-host for your own servers | No warranty | Include license in distributions |
| Open source on discontinuation | MIT applies after discontinuation |
Does Cardian store messages or scan DMs?
No. Cardian does not store message content as part of normal operation.
Can Cardian be self-hosted?
Yes. Self-hosting for your own Discord servers is allowed under the CSAL license.
Can I run a hosted Cardian service for other people?
No. The CSAL license blocks competing hosted bot/services.
Why are some anti-abuse details not public?
Because people farm. Some thresholds and enforcement tuning stay private so Ranked and SVS stay playable.
What happens if the project dies?
If Cardian is discontinued (repo archived or no maintenance activity for 12 months), it becomes open source under MIT. See OPEN_SOURCE_LICENSE.
Common dev commands
- Redeploy slash commands:
node src/deploy-commands.js - PM2 status:
pm2 list - Bot logs:
pm2 logs cardian --lines 200 - Restart bot with env refresh:
pm2 restart cardian --update-env
Sharding
Cardian uses discord.js sharding for scalability. The shard manager spawns shards automatically.
Environment variables:
SHARD_COUNT=auto- Auto-detect shard count (recommended)SHARD_COUNT=2- Manual shard count
Notes:
- Slash commands deploy from the manager, not from shards
- Sessions are file-persisted for cross-shard consistency
- Each shard logs with
[Shard N]prefix
To run without sharding (single instance):
pm2 start src/index.js --name cardian-singleAdding new games
- Copy
src/games/template/tosrc/games/yourgame/ - Implement the required interface (see
template/README.md) - Register in
src/core/registry/index.js - Add wiki documentation in
wiki/yourgame.md - Test thoroughly before enabling
See template/README.md for detailed instructions.
Common gotchas
- Linux paths are case-sensitive (
config.jsonis notConfig.json) - If you have a build step, PM2 must start the built output (example:
dist/), not the source