EcommerceBot is a Node.js-based Discord bot with integrated e-commerce functionality powered by Stripe and MongoDB. The bot allows users to register, manage their profiles, purchase game subscriptions, upload files, and create/manage tickets for support. Designed for simplicity and efficiency, it provides tools for both users and administrators.
-
!register
- Registers a user with their Discord username and generates a secure password.
- Displays credentials upon successful registration.
-
!profile
- Shows the user's profile, including their role, subscriptions, and account details.
-
!games
- Displays a list of available games and their subscription plans (e.g., 24-hour, 7-day, 30-day, and 365-day access).
- Generates a Stripe purchase link for selected subscriptions.
-
!support
- Creates a support ticket.
- Allows users to set ticket priority (Low, Medium, High, Urgent).
-
!upload
- Uploads files related to a specific game.
-
!creategame
- Adds new games to the list of available options.
-
!ban / !unban
- Bans or unbans users from accessing the bot or specific functionalities.
-
!sale
- Sets discounts for games.
- Notifies all registered users of the sale via an embedded message.
-
!motd
- Updates the message of the day (optional).
- Tracks the last response time for both admins and users.
- Periodically checks for open tickets and sends reminders to users if:
- The admin has responded.
- The user hasn’t replied within 30 minutes.
- No previous reminders were sent in the last 30 minutes.
- Prevents spam by updating reminder timestamps.
- Automatically updates user roles after purchases.
- Sends notifications for game sales and updates.
- Backend: Node.js
- Database: MongoDB
- Payment Integration: Stripe
-
Clone the repository:
git clone https://github.com/whosstyler/EcommerceBot.git cd EcommerceBot -
Install dependencies:
npm install
-
Configure environment variables:
- Create a
.envfile and add the following:# MongoDB Connection MONGODB_URI=mongodb://localhost:27017/EcommerceBot # JWT Configuration JWT_SECRET=your-jwt-secret # Discord Bot DISCORD_TOKEN=your-discord-bot-token # API Configuration API_PORT=3000 API_TOKEN=your-api-token # Stripe Configuration STRIPE_SECRET_KEY=sk-your-stripe-secret STRIPE_WEBHOOK_SECRET=your-stripe-webhook PAYMENT_SUCCESS_URL=http://localhost:3000/payment/success STRIPE_WEBHOOK_URL=http://localhost:3000/api/payments/webhook/stripe # Encryption Configuration ENCRYPTION_KEY=your-encryption-key # Owner ID OWNER_ID=your-owner-id
- Create a
-
Run the bot:
npm run dev
- Invite the bot to your Discord server using the generated OAuth2 URL.
- Use
!registerto create a profile. - Explore other commands (
!games,!profile,!support) as needed.
Contributions are welcome! Please submit a pull request or open an issue for any bugs or feature requests.
This project is licensed under the MIT License. See the LICENSE file for more details.