This application allows users to create custom URLs that redirect to a specific Discord invite link. It uses Discord OAuth2 to authenticate users and automatically join them to a server using a bot.
- Node.js
- SQLite
-
Clone the repository:
git clone https://github.com/aleu0091/discord-invite-redirector.git cd discord-invite-redirector
-
Install the required packages and dependencies:
npm
npm install express sqlite3 body-parser axios querystring dotenv express-session
pnpm
pnpm add express sqlite3 body-parser axios querystring dotenv express-session
yarn
yarn add express sqlite3 body-parser axios querystring dotenv express-session
-
Create a
.env
file in the root directory and add your Discord application's credentials:CLIENT_ID=your_discord_client_id CLIENT_SECRET=your_discord_client_secret BOT_TOKEN=your_discord_bot_token REDIRECT_URI=http://localhost:3000/callback/join LOGIN_REDIRECT_URI=http://localhost:3000/callback/login HCAPTCHA_SECRET=your_hcaptcha_secret SESSION_SECRET=your_session_secret ADMIN_USER_ID=your_discord_id
-
Start the server:
node app.js
- Open your browser and navigate to
http://localhost:3000
. - Create a custom URL by entering a custom URL name and a Discord invite link.
- Visit the generated URL (e.g.,
http://localhost:3000/invite/custom-url
). - Authenticate via Discord OAuth2.
- After authentication, the application will automatically add the user to the specified Discord server using the bot.
This project is licensed under the MIT License. See the LICENSE file for details.