Skip to content
/ Discord-guild-Shift Public template

Open-source Discord bot designed to safely transfer members between two guilds. On joining a new server, it verifies presence in the old server, optionally kicks from the old guild, reapplies configured roles, and logs actions via console and webhooks with strict startup validation and fail-fast safety.

License

Notifications You must be signed in to change notification settings

KnarliX/Discord-guild-Shift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🛡️ Discord Guild Shift

A professional, open-source automation system designed to manage community migrations between Discord servers.

Developer Profile

Developed by Rajnish Mehta


📖 Overview

Discord Guild Shift is a high-performance bot built to automate the transition of members from an Old Server to a New Server.

When a user joins your new server, the bot instantly verifies if they are a member of the old server. Based on your configuration, it automatically syncs roles, logs the event, and optionally kicks them from the old server to ensure a clean migration.

✨ Key Features

  • ⚡ Smart Detection: Listens for joins in the New Guild and cross-references them with the Old Guild.
  • 🎭 Role Assignment: Automatically grants specific roles to verified migrants in the new server.
  • 👢 Auto-Kick System: (Configurable) Automatically kicks the user from the old server after they successfully join the new one.
  • 🔒 Safety First: Built with Zod for strict environment validation. The bot will not start if the configuration is invalid.
  • 📝 Webhook Logging: detailed logs of every migration event sent directly to a private Discord channel.
  • ❤️ Keep-Alive: Includes a built-in HTTP server to prevent the bot from sleeping on free hosting platforms.

🛠️ Tech Stack

  • Language: TypeScript
  • Library: Discord.js
  • Validation: Zod
  • Package Manager: pnpm

🚀 Setup & Installation

1. Clone the Repository

Clone this repository

2. Install Dependencies

pnpm install --frozen-lockfile

3. Environment Configuration

Create a .env file in the root directory and add the following:

# Bot Token
TOKEN=your_bot_token

# Server IDs
OLD_GUILD=1080560914262139001 (old guild id)
NEW_GUILD=1005766057480421466 (new guild id)

# Role IDs to give in the New Guild (Comma separated)
ROLES=1462197920999673918 (if you want multiple then like this 1462197920999673918,1462197920999675253,146219792626262)

# Logging Webhook (Required for logs)
WEBHOOK_URL=https://discord.com/api/webhooks/xxx/yyy

# Kick user from old guild? (true/false)
KICK_FROM_OLD=false

4. Build and Start

Build:

# Build the TypeScript code
pnpm run build

OR

# Build the TypeScript code
tsc

start:

# Start the bot
pnpm start

📜 Requirements

  1. Administrator Privileges: The bot must have Administrator permissions in BOTH the Old and New guilds to fetch members and kick users. (if bot haven't administrative permission then system automatically crash)
  2. Role Hierarchy: In the New Guild, ensure the Bot's role is higher than the roles it is trying to assign.

🤝 Contributing

Contributions are welcome!

  1. Fork the project
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Open a Pull Request

Developed with ❤️ by Rajnish

About

Open-source Discord bot designed to safely transfer members between two guilds. On joining a new server, it verifies presence in the old server, optionally kicks from the old guild, reapplies configured roles, and logs actions via console and webhooks with strict startup validation and fail-fast safety.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •