A feature-rich Discord bot built with Discord.js and MongoDB, designed to track and manage user donations (coins, items, daily, and weekly) in community serversโespecially those integrated with Dank Memer. The bot supports dynamic prefixes, role assignments, and real-time donation updates, making it ideal for gaming or fundraising communities.
- Donation Tracking: Monitors coin and item donations (e.g., Dank Memer items), with daily and weekly summaries stored in MongoDB.
- Donation Command: Moderators can use
!donations <user>to view a user's total, daily, and category-specific donations in a clean embed. - Item Donation Processing: Detects item donations from Dank Memer (
ID: 270904126974590976) in designated channels, calculates their value, and updates user records. - Dynamic Prefixes: Supports server-specific command prefixes for flexibility across multiple guilds.
- Role Management: Automatically assigns donation-based roles to users.
- Welcome Messages: Sends customizable welcome messages to new members.
- Error Logging: Logs unhandled rejections and errors to a specified channel for reliability.
- Top.gg Integration: Supports Top.gg webhooks for voting or analytics.
- MongoDB Integration: Persists donation data for robust storage and retrieval.
- Node.js: v16.6.0 or higher
- MongoDB: A running MongoDB instance (local or cloud, e.g., MongoDB Atlas)
- Discord Bot Token: Obtain from the Discord Developer Portal
- Dank Memer Bot: Required for item donation tracking (optional for non-item features)
git clone https://github.com/krisharekar/CribBot.git
cd CribBotnpm installCreate a .env file in the root directory:
TOKEN=your-discord-bot-token
MONGODB_URI=your-mongodb-connection-stringUpdate config.json with your botโs settings (e.g., default prefix, channel IDs).
- Ensure your MongoDB instance is running.
- Create schemas for donations and categories (see
schemas/directory).
node index.js!donations <user>: Displays a userโs donation stats.
(RequiresMANAGE_GUILDpermission)
Example:
!donations @User#1234- Configure donation channels in your server for item donation tracking.
- Define donation categories in
category-schemafor flexible tracking.
index.js โ Main bot file, initializes modules and event listeners
donations.js โ Command to display user donation stats
item-donations.js โ Handles item donation detection and processing
schemas/ โ MongoDB schemas for donations and categories
assets/ โ Utility functions (e.g., prefix finder, role management)
cache/ โ Caching for donation channels and item info
donation-trackers/ โ Modules for coin, item, daily, and weekly donation tracking
This project is licensed under the MIT License.