A Discord bot for collecting and trading cards with pack opening mechanics, rarity systems, and trading functionality.
- Pack opening system with regular and chase cards
- Foil card variants with specified probabilities
- Card rarity system (Common, Uncommon, Rare, Legendary, Mythic)
- Inventory management with pagination and filters
- Trading system between users
- Admin commands for card management and user statistics
-
Clone the repository
-
Install dependencies:
npm install
-
Create a
.envfile in the root directory with the following variables:DISCORD_TOKEN=your_bot_token_here CLIENT_ID=your_client_id_here GUILD_ID=your_guild_id_here ADMIN_USERS=comma_separated_admin_user_ids DB_PATH=./data/cards.db
-
Create a
cardsdirectory in the root folder for storing card images -
Deploy slash commands:
node src/deploy-commands.js
-
Start the bot:
npm start
/open- Open a card pack (24h cooldown)/inventory [user] [page] [rarity]- View card collection/trade @user <card-id>- Initiate a trade with another user
/admin addcard <name> <rarity> <image>- Add a new card/admin checkuser @user- View detailed user statistics
-
5 Regular cards
- Foil chance: 1/16 (max 2 per pack)
- Rarities: Common (65%), Uncommon (25%), Rare (10%)
-
1 Chase card
- Foil chance: 1/10
- Rarities: Uncommon (50%), Rare (35%), Legendary (12%), Mythic (3%)
To run the bot in development mode with auto-reload:
npm run devThe bot uses SQLite for data storage with the following tables:
- Users: Stores user data and pack opening cooldowns
- Cards: Stores card information and images
- Inventory: Tracks user card collections
- Trades: Manages trading system
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request