From 17c2076b01726ffe667dc30c6a766e6fef18b9eb Mon Sep 17 00:00:00 2001 From: Morrow Shore <97566823+MorrowShore@users.noreply.github.com> Date: Mon, 20 Oct 2025 03:51:08 +0700 Subject: [PATCH 1/4] Create README.md --- README.md | 139 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..61457ff --- /dev/null +++ b/README.md @@ -0,0 +1,139 @@ +A comprehensive Discord bot designed specifically for the Web Dev Discord server, providing helpful resources, documentation lookup, moderation tools, and educational content for web developers. +
+
+ +# Features + + +### Documentation Commands +- **`/mdn [query]`** - Search MDN Web Docs for web development documentation +- **`/npm [query]`** - Search npm registry for packages +- **`/baseline [query]`** - Check browser baseline compatibility for web features + + +### Educational Resources +- **`/guides [subject]`** - Access detailed guides on various web development topics +- **`/tips [subject]`** - Get helpful tips and best practices for web development + + +### Moderation Tools +- **`/repel [target] [reason]`** - Advanced moderation command (meant to be given to a high quantity of volunteer assistants) that: + - 1: Checks bot permissions. + - 2: Checks target's role to make sure it's under in hierarchy. + - 3: Times out target user. + - 4: Deletes target user's very recent messages across channels. + - 5: Logs the action to a channel. + + +### Utility Commands +- **`/ping`** - Basic connectivity test to verify bot responsiveness + +
+ +# Installation & Setup + +### Prerequisites +- Node.js (version specified in `.nvmrc`) +- pnpm package manager +- Discord Bot Token + +
+ + +1. Clone the repository: + ```bash + git clone + cd webdev-bot-main + ``` + +2. Install dependencies: + ```bash + pnpm install + ``` + +3. Set up environment variables (create `.env` file): + ``` + DISCORD_TOKEN=your_bot_token_here + DISCORD_CLIENT_ID=your_client_id_here + DISCORD_GUILD_ID=your_guild_id_here + ``` + +4. Build and start the bot: + ```bash + pnpm run build:dev + pnpm start + ``` + +- Or for development with hot reloading: + ```bash + pnpm run dev + ``` + +
+ + +### Docker Support +To use docker with the bot: +```bash +# Development +pnpm run docker:dev + +# Production +pnpm run docker:prod + +# Build only +pnpm run docker:build +``` + +
+ + +# Configuration + +### Environment Variables +- `DISCORD_TOKEN` - Discord bot token (required) +- `DISCORD_CLIENT_ID` - Discord application client ID +- `DISCORD_GUILD_ID` - Target guild/server ID +- Additional moderation-specific configuration in `src/env.ts` + +
+ +### Bot Permissions +The bot requires the following Discord permissions: +- Send Messages +- Read Message History +- Manage Messages +- Moderate Members +- Use Slash Commands + +
+ + +# Contributing + +1. Fork the repository +2. Create a feature branch +3. Make your changes +4. Run tests and linting +5. Submit a pull request + +
+ + +#### Adding New Guides/Tips +1. Add markdown files to `src/commands/guides/subjects/` or `src/commands/tips/subjects/` +2. Include frontmatter with `name` field +3. The bot will automatically detect and load new content + +
+ +## Support + +For issues, questions, or feature requests: +- Open an issue on GitHub +- Contact the Web Dev Discord server moderators + +
+ + +**Made with ❤️ for the Web Dev Discord community** From 8ae1f3e1a604f7d022a1b47dbe63f1f6a450457a Mon Sep 17 00:00:00 2001 From: Morrow Shore <97566823+MorrowShore@users.noreply.github.com> Date: Mon, 20 Oct 2025 04:24:48 +0700 Subject: [PATCH 2/4] Update README.md --- README.md | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 61457ff..73ae57d 100644 --- a/README.md +++ b/README.md @@ -51,11 +51,11 @@ A comprehensive Discord bot designed specifically for the Web Dev Discord server pnpm install ``` -3. Set up environment variables (create `.env` file): +3. Set up environment variables (create `.env.local` file): ``` DISCORD_TOKEN=your_bot_token_here - DISCORD_CLIENT_ID=your_client_id_here - DISCORD_GUILD_ID=your_guild_id_here + CLIENT_ID=your_client_id_here + SERVER_ID=your_guild_id_here ``` 4. Build and start the bot: @@ -72,8 +72,8 @@ A comprehensive Discord bot designed specifically for the Web Dev Discord server
-### Docker Support -To use docker with the bot: +## Docker Support +To use docker with the bot, run: ```bash # Development pnpm run docker:dev @@ -88,18 +88,10 @@ pnpm run docker:build
-# Configuration -### Environment Variables -- `DISCORD_TOKEN` - Discord bot token (required) -- `DISCORD_CLIENT_ID` - Discord application client ID -- `DISCORD_GUILD_ID` - Target guild/server ID -- Additional moderation-specific configuration in `src/env.ts` -
+# Required Permissions -### Bot Permissions -The bot requires the following Discord permissions: - Send Messages - Read Message History - Manage Messages @@ -120,14 +112,14 @@ The bot requires the following Discord permissions:
-#### Adding New Guides/Tips +### Adding New Guides or Tips 1. Add markdown files to `src/commands/guides/subjects/` or `src/commands/tips/subjects/` 2. Include frontmatter with `name` field 3. The bot will automatically detect and load new content
-## Support +# Support For issues, questions, or feature requests: - Open an issue on GitHub From c193d67ea2b91e52c484e3310601fc5cb1631d52 Mon Sep 17 00:00:00 2001 From: Ali Hammoud Date: Tue, 21 Oct 2025 14:00:43 +0300 Subject: [PATCH 3/4] =?UTF-8?q?=F0=9F=94=A8=20refactor:=20add=20REPEL=5FRO?= =?UTF-8?q?LE=5FID=20to=20.env.example?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.example | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index 76b2665..6323e1b 100644 --- a/.env.example +++ b/.env.example @@ -1,8 +1,9 @@ DISCORD_TOKEN="" # Your bot token CLIENT_ID="" # Your bot's application ID -SERVER_ID= +SERVER_ID= # Discord Server ID where the bot will operate MODERATORS_ROLE_IDS= # Comma separated list of role IDs that are Moderators(Mods, Admins, etc) REPEL_LOG_CHANNEL_ID= # Channel ID where the bot will log repel actions +REPEL_ROLE_ID= # Role ID assigned to users who can use the repel command GUIDES_CHANNEL_ID="" # The ID of the channel where guides will be posted From e2fd22a6e3fbd991040677f0a4bfd995c5ab124f Mon Sep 17 00:00:00 2001 From: Ali Hammoud Date: Tue, 21 Oct 2025 14:06:55 +0300 Subject: [PATCH 4/4] =?UTF-8?q?=F0=9F=93=9A=20docs:=20update=20README=20to?= =?UTF-8?q?=20clarify=20Discord=20server=20tips=20and=20installation=20ins?= =?UTF-8?q?tructions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 73ae57d..7ee3074 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,9 @@ A comprehensive Discord bot designed specifically for the Web Dev Discord server ### Educational Resources - **`/guides [subject]`** - Access detailed guides on various web development topics -- **`/tips [subject]`** - Get helpful tips and best practices for web development +### Discord Server Tips +- **`/tips [subject]`** - Get quick tips on interacting within the Web Dev Discord server ### Moderation Tools - **`/repel [target] [reason]`** - Advanced moderation command (meant to be given to a high quantity of volunteer assistants) that: @@ -43,7 +44,7 @@ A comprehensive Discord bot designed specifically for the Web Dev Discord server 1. Clone the repository: ```bash git clone - cd webdev-bot-main + cd webdev-bot ``` 2. Install dependencies: @@ -51,11 +52,10 @@ A comprehensive Discord bot designed specifically for the Web Dev Discord server pnpm install ``` -3. Set up environment variables (create `.env.local` file): - ``` - DISCORD_TOKEN=your_bot_token_here - CLIENT_ID=your_client_id_here - SERVER_ID=your_guild_id_here +3. Create a `.env.local` file based on `.env.example` and fill in the required environment variables: + ```bash + cp .env.example .env.local + # Edit .env.local to add your Discord bot token and other configurations ``` 4. Build and start the bot: