Project: Discord Server Giveaway Bot. Created at https://spectra.codes, which is owned by @Drix10
This repository contains a Discord giveaway bot project designed to simplify giveaway management on Discord servers. It provides a comprehensive solution with features like automated giveaway creation, entry management, winner selection, and announcement capabilities. The project is built using a robust and scalable tech stack, including React, Node.js, PostgreSQL, and custom AI models.
Feature | Description | |
---|---|---|
โ๏ธ | Architecture | The codebase utilizes a modular architecture, with distinct directories for commands, events, services, models, and utilities, ensuring maintainability and scalability. |
๐ | Documentation | This README file provides a comprehensive overview of the project, its features, dependencies, installation instructions, and usage examples. |
๐ | Dependencies | The project relies on various external libraries such as Discord.js for interacting with the Discord API, Prisma for database management, Next.js for frontend development, and other packages for functionality. |
๐งฉ | Modularity | The codebase is highly modular, with each component and functionality separated into dedicated directories and files, promoting code reusability and maintainability. |
๐งช | Testing | Implement unit tests using Jest or React Testing Library to ensure the reliability and robustness of the codebase. |
โก๏ธ | Performance | The bot is optimized for performance using caching mechanisms, efficient database queries, and asynchronous operations to minimize latency and improve responsiveness. |
๐ | Security | Security measures include input validation, sanitization, and secure API integration, protecting against vulnerabilities and ensuring data privacy. |
๐ | Version Control | The project uses Git for version control, with a GitHub Actions workflow for automated build and deployment processes. |
๐ | Integrations | The bot seamlessly integrates with the Discord API for interactions and data retrieval. It may also integrate with external services like payment gateways or prize delivery platforms. |
๐ถ | Scalability | The bot is designed for scalability to handle increasing user traffic and data volume. This includes database optimization, caching, and the potential for horizontally scaling the server infrastructure. |
โโโ src
โ โโโ commands
โ โ โโโ create.js
โ โ โโโ enter.js
โ โ โโโ end.js
โ โ โโโ winners.js
โ โ โโโ help.js
โ โ โโโ dashboard.js
โ โโโ events
โ โ โโโ ready.js
โ โ โโโ message.js
โ โ โโโ interactionCreate.js
โ โโโ services
โ โ โโโ giveawayService.js
โ โ โโโ databaseService.js
โ โ โโโ discordService.js
โ โ โโโ notificationService.js
โ โโโ models
โ โ โโโ Giveaway.js
โ โ โโโ User.js
โ โ โโโ Prize.js
โ โโโ utils
โ โ โโโ commandHandler.js
โ โ โโโ logger.js
โ โ โโโ errorHandler.js
โ โ โโโ randomWinnerSelector.js
โ โโโ config
โ โ โโโ env.config.js
โ โ โโโ database.config.js
โ โโโ routes
โ โ โโโ api.js
โ โ โโโ authRoutes.js
โ โโโ middleware
โ โ โโโ authentication.js
โ โ โโโ authorization.js
โ โ โโโ logging.js
โ โโโ prisma
โ โโโ schema.prisma
โโโ public
โ โโโ index.html
โ โโโ favicon.ico
โ โโโ robots.txt
โ โโโ manifest.json
โโโ next.config.js
โโโ tsconfig.json
โโโ README.md
git clone https://github.com/spectra-ai-codegen/discord-giveaway-bot.git
cd discord-giveaway-bot
npm install
npm start
Adjust configuration settings in config.js
or .env
.
๐ Example 1: Creating a new giveaway
/create
command with arguments for prize, duration, entry requirements, and number of winners.๐ Example 2: Entering a giveaway
/enter
command with the giveaway ID.๐ Example 3: Ending a giveaway
/end
command with the giveaway ID (only for admins).๐ Example 4: Viewing winners
/winners
command with the giveaway ID.๐ Example 5: Accessing the admin dashboard
/dashboard
command (redirects to the web interface).npm install -g heroku
heroku login
heroku create
git push heroku main
DISCORD_BOT_TOKEN
: Your Discord bot token.DATABASE_URL
: Your PostgreSQL database connection string.NEXTAUTH_SECRET
: Your NextAuth.js secret key.Use JWT tokens for authentication to access the API.
curl -X POST -H "Content-Type: application/json" -d '{"prize": "Discord Nitro", "duration": 86400, "entryRequirements": [], "numberOfWinners": 1}' http://localhost:3000/api/giveaways
This project is licensed under the GNU AGPLv3.