Add dashboard UI and secure API endpoints
This commit is contained in:
@@ -1,80 +1,65 @@
|
||||
Im going to make a To-do List for the features i want to implement for my Bot.
|
||||
# Discord Bot
|
||||
|
||||
### **To-Do List for My Discord Bot**
|
||||
## Dashboard setup
|
||||
|
||||
#### **Core Features**
|
||||
(I will try to make these tools optional, because alot of bots already feature them)
|
||||
This repository includes a lightweight dashboard for configuring permissions and warnings without editing JSON. The dashboard uses Discord OAuth2 and the existing MongoDB collections.
|
||||
|
||||
1. **Basic Commands**
|
||||
- [x] Add a `/help` command to display a list of available commands.
|
||||
- [x] Implement a `/ping` command to check bot responsiveness.
|
||||
- [x] Add an `/about` command to describe the bot's purpose.
|
||||
### Environment variables
|
||||
|
||||
2. **Role Management**
|
||||
- [ ] Set up a self-assignable role system (e.g., using reaction roles).
|
||||
- [x] Allow admins to assign/remove roles with commands.
|
||||
Copy `.env.example` and fill in the values:
|
||||
|
||||
3. **Moderation Tools**
|
||||
- [x] Add commands to mute, kick, and temp_ban users.
|
||||
- [ ] Create an auto-moderation feature to delete spam or inappropriate content.
|
||||
- [x] Implement a warning system with a strike counter.
|
||||
```bash
|
||||
cp .env.example .env
|
||||
```
|
||||
|
||||
Required backend variables:
|
||||
|
||||
- `DISCORD_CLIENT_ID`
|
||||
- `DISCORD_CLIENT_SECRET`
|
||||
- `DISCORD_REDIRECT_URI` (example: `http://localhost:3000/auth/discord/callback`)
|
||||
- `DISCORD_BOT_TOKEN`
|
||||
- `MONGODB_URI`
|
||||
- `SESSION_SECRET`
|
||||
- `DASHBOARD_CLIENT_URL` (example: `http://localhost:5173`)
|
||||
|
||||
Frontend variables (Vite):
|
||||
|
||||
- `VITE_API_BASE_URL` (example: `http://localhost:3000`)
|
||||
- `VITE_BOT_INVITE_URL`
|
||||
|
||||
> Make sure the redirect URI is added in the Discord Developer Portal OAuth2 settings.
|
||||
|
||||
### Running the backend
|
||||
|
||||
```bash
|
||||
node dashboardServer.js
|
||||
```
|
||||
|
||||
The API will run on `DASHBOARD_PORT` (default `3000`).
|
||||
|
||||
### Running the dashboard frontend
|
||||
|
||||
```bash
|
||||
cd dashboard
|
||||
npm install
|
||||
npm run dev
|
||||
```
|
||||
|
||||
The frontend will run on `http://localhost:5173` by default.
|
||||
|
||||
### API health check
|
||||
|
||||
```bash
|
||||
curl http://localhost:3000/health
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
#### **Unique Features**
|
||||
1. **Currency System**
|
||||
- [x] Design a virtual currency system with basic commands:
|
||||
- [x] `/balance` to check currency balance.
|
||||
- [x] `/earn` to earn daily or periodic rewards.
|
||||
- [x] `/transfer @user [amount]` to send currency to another user.
|
||||
- [ ] Link the currency system to role management:
|
||||
- [ ] Allow users to purchase roles using the currency with a command (e.g., `!buyrole [role name]`).
|
||||
## Existing feature notes
|
||||
|
||||
2. **Datetime Converter**
|
||||
(Still in Progress, maybe i'll add visual Menu)
|
||||
- [x] Create a command to convert timezones:
|
||||
- [x] `/timestamp [date]` to generate Discord timestamps.
|
||||
- [x] Support multiple Discord timestamp formats.
|
||||
- [ ] Include a command to display server-specific or user-specific timezones.
|
||||
### Server-Specific Permission Configuration
|
||||
|
||||
3. **Minigames**
|
||||
- [ ] Implement a Quiz Game:
|
||||
- [x] Add a `/quiz` command to start the game.
|
||||
- [x] Provide multiple-choice or true/false questions.
|
||||
- [x] Award virtual currency for correct answers.
|
||||
- [ ] Add a simple number-guessing game (e.g., `!guess [number]`).
|
||||
- [ ] Create a leaderboard for game winners.
|
||||
|
||||
---
|
||||
|
||||
#### **Utility Tools**
|
||||
1. **Search and Lookups**
|
||||
- [x] Add a `/wiki [topic]` command to fetch summaries from Wikipedia.
|
||||
- [x] Include a `/weather [location]` command for weather updates.
|
||||
|
||||
---
|
||||
|
||||
#### **Advanced and Fun Features (very optional)**
|
||||
1. **AI Chat Integration**
|
||||
- [ ] Integrate GPT for conversational AI:
|
||||
- [ ] Respond to mentions with intelligent replies.
|
||||
- [ ] Allow users to ask general questions with `!ask [question]`.
|
||||
|
||||
---
|
||||
|
||||
#### **Deployment (will happen if im completly satisfied with the bot)**
|
||||
1. **Hosting**
|
||||
- [ ] Set up local hosting for development.
|
||||
- [ ] Deploy the bot on a cloud platform (e.g., Heroku, AWS, or Railway).
|
||||
|
||||
2. **Monitoring**
|
||||
- [ ] Add logging to track errors and usage statistics.
|
||||
- [ ] Implement uptime monitoring to ensure the bot stays online.
|
||||
|
||||
---
|
||||
|
||||
### **Server-Specific Permission Configuration**
|
||||
Moderation commands support per-server permission overrides stored in MongoDB. Each guild can define which users or roles are allowed to run specific commands, plus optional admin overrides that apply to all moderation commands. This is intended for future web-based configuration.
|
||||
Moderation commands support per-server permission overrides stored in MongoDB. Each guild can define which users or roles are allowed to run specific commands, plus optional admin overrides that apply to all moderation commands.
|
||||
|
||||
Example document stored in the `discord.guild_permissions` collection:
|
||||
```json
|
||||
|
||||
Reference in New Issue
Block a user