Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/coslynx/discord-giveaway-bot
Project: Discord Server Giveaway Bot. Created at https://spectra.codes, which is owned by @Drix10
https://github.com/coslynx/discord-giveaway-bot
code-generation code-quality community-engagement developer-tools devops discord-automation discord-bot discord-giveaway discord-js discord-server-tools giveaway-bot giveaway-management javascript machine-learning mui next-js nodejs postgresql react software-development
Last synced: 22 days ago
JSON representation
Project: Discord Server Giveaway Bot. Created at https://spectra.codes, which is owned by @Drix10
- Host: GitHub
- URL: https://github.com/coslynx/discord-giveaway-bot
- Owner: coslynx
- Created: 2024-08-05T17:54:02.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-08-05T17:56:08.000Z (5 months ago)
- Last Synced: 2024-12-03T19:06:14.311Z (about 1 month ago)
- Topics: code-generation, code-quality, community-engagement, developer-tools, devops, discord-automation, discord-bot, discord-giveaway, discord-js, discord-server-tools, giveaway-bot, giveaway-management, javascript, machine-learning, mui, next-js, nodejs, postgresql, react, software-development
- Language: JavaScript
- Size: 17.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
discord-giveaway-botA Discord bot designed to automate and streamline giveaways
Developed with the software and tools below.
## ๐ Table of Contents
- ๐ Overview
- ๐ฆ Features
- ๐ Structure
- ๐ป Installation
- ๐๏ธ Usage
- ๐ Hosting
- ๐ License
- ๐ Authors## ๐ Overview
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.## ๐ฆ Features
| | 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. |## ๐ Structure
```
โโโ 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
```## ๐ป Installation
### ๐ง Prerequisites
- Node.js (v18+)
- npm
- Docker### ๐ Setup Instructions
1. Clone the repository:
- `git clone https://github.com/spectra-ai-codegen/discord-giveaway-bot.git`
2. Navigate to the project directory:
- `cd discord-giveaway-bot`
3. Install dependencies:
- `npm install`
## ๐๏ธ Usage
### ๐โโ๏ธ Running the Project
1. Start the development server:
- `npm start`
2. Open your browser and navigate to [http://localhost:3000](http://localhost:3000).### โ๏ธ Configuration
Adjust configuration settings in `config.js` or `.env`.
### ๐ Examples
- ๐ 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).
## ๐ Hosting
### ๐ Deployment Instructions#### Heroku Deployment
1. Install the Heroku CLI:
- `npm install -g heroku`
2. Login to Heroku:
- `heroku login`
3. Create a new Heroku app:
- `heroku create`
4. Deploy the code:
- `git push heroku main`
#### Environment Variables
- `DISCORD_BOT_TOKEN`: Your Discord bot token.
- `DATABASE_URL`: Your PostgreSQL database connection string.
- `NEXTAUTH_SECRET`: Your NextAuth.js secret key.
## ๐ API Documentation
### ๐ Endpoints
- POST /api/giveaways: Creates a new giveaway.
- GET /api/giveaways/:id: Retrieves a specific giveaway.
- PUT /api/giveaways/:id: Updates a giveaway.
- DELETE /api/giveaways/:id: Deletes a giveaway.
- POST /api/giveaways/:id/enter: Enters a giveaway.
- POST /api/giveaways/:id/end: Ends a giveaway.
### ๐ Authentication
Use JWT tokens for authentication to access the API.
### ๐ Examples
- `curl -X POST -H "Content-Type: application/json" -d '{"prize": "Discord Nitro", "duration": 86400, "entryRequirements": [], "numberOfWinners": 1}' http://localhost:3000/api/giveaways`
## ๐ License
This project is licensed under the [GNU AGPLv3](https://choosealicense.com/licenses/agpl-3.0/).
## ๐ฅ Authors
- Author Name - [Spectra.codes](https://spectra.codes)
- Creator Name - [DRIX10](https://github.com/Drix10)
๐ Spectra.Codes
Why only generate Code? When you can generate the whole Repository!