RelayBot

A powerful and easy-to-use Discord bot for relaying messages, edits, deletes, and role pings between channels on one or more servers.

Join our Discord

RelayBot is designed for communities that span multiple Discord servers, like gaming alliances or project collaborations. It creates a seamless bridge, allowing members to communicate as if they were in the same channel.

✨ Key Features

🚀 Getting Started

There are two ways to use RelayBot: inviting an official public bot (if available) or self-hosting your own private instance for full control.

Public-Hosting

(public bot on railway.app)

Self-Hosting (Recommended)

The easiest way to host your own bot is with Railway. The button below will guide you through setting up your own private instance.

Deploy on Railway

For manual installation instructions and troubleshooting, please see the sections at the bottom of this guide.

🤖 Bot Usage Guide

Configuration is done via the /relay command. You must have the Manage Server permission.

The Setup Workflow

The bot uses global groups. One server creates the group, and others link to it.

  1. On ONE Server Only - Create a Global Group: An admin on your "main" server creates the group. The name must be unique across all servers using this bot.

    • /relay create_group name: my-super-unique-alliance
  2. On ALL Servers - Link Your Channels: Admins on all participating servers can now link their channels to the same global group by name. You can specify a message direction, which is great for announcement or log channels!

    • /relay link_channel group_name: my-super-unique-alliance direction: One Way (Send messages FROM this channel only)
  3. Map Roles: (Optional) To sync role pings, map your server's roles to a shared "common name" within that group. This should be done on all servers that want to participate in role pings.

    • On Server A: /relay map_role group_name: my-super-unique-alliance common_name: K30-31 role: @Kingdom-30-31
    • On Server B: /relay map_role group_name: my-super-unique-alliance common_name: K30-31 role: @K30-31
  4. Enable Auto-Role Syncing (Optional, Recommended): For the easiest role management, you can have the bot automatically create and link roles for you.

    • First, enable the feature on your channel: /relay toggle_auto_role
    • Then, run the link command. The bot will now sync all mapped roles from the group to your server, creating new ones if they don't exist and linking existing ones by name.
    • Already in a group? No problem. Just run /relay toggle_auto_role to enable the feature, then run /relay link_channel again on your already-linked channel to trigger the sync.

All Commands

Group Management:

Channel Management:

Role Mapping:

Settings:

Utility:


Manual Installation & Configuration

If you prefer to host the bot yourself on a VPS or other service, follow these steps.

Prerequisites:

Before you begin, ensure you have the following software installed on your system.

  1. Node.js: This is the runtime environment for the bot.

    • Recommended Version: v20.x (LTS) or higher.
    • We strongly recommend using a version manager to avoid permission issues and easily switch versions:
  2. Build Tools for Native Modules: The better-sqlite3 database package requires C++ code to be compiled during installation.

    • On Windows: The easiest way to get the necessary build tools is to install Visual Studio 2022 Community. During installation, make sure to select the "Desktop development with C++" workload.
    • On macOS: Install the Xcode Command Line Tools by running xcode-select --install in your terminal.
    • On Debian/Ubuntu: Install the necessary packages by running sudo apt-get install -y build-essential python3.
  3. Git: Required for cloning the repository. You can get it from git-scm.com.

1. Clone the Repository:

git clone https://github.com/shaggyze/RelayBot.git
cd RelayBot

2. Install Dependencies: This single command will download all the necessary Node.js packages like discord.js, dotenv, and better-sqlite3.

npm install

3. Create a Discord Bot Application:

4. Configure Environment Variables:

5. Deploy Slash Commands: Run this command once to register the bot's slash commands with Discord.

npm run deploy

6. Start the Bot:

npm start

For 24/7 hosting on a VPS, it is highly recommended to use a process manager like pm2.

7. Inviting Your Bot to a Server: After deploying your bot, it is running but hasn't joined any servers yet. Use the manual link generation method to get it into your first server.

  1. Go to the Discord Developer Portal -> [Your App] -> OAuth2 -> URL Generator.
  2. In "Scopes", check bot and applications.commands.
  3. In "Bot Permissions", check: View Channel, Send Messages, Read Message History, Manage Webhooks, Manage Messages, Manage Roles, Embed Links and Attach Files.
  4. Copy the generated URL and use it to invite the bot.

Once the bot is in one server, you can simply use the /invite command to get a clean invite link for other servers.

Troubleshooting

I get a big red error during npm install on Windows (better-sqlite3 / node-gyp)

If you see a long error log during npm install that mentions better-sqlite3, node-gyp rebuild, and C++ errors, it is almost certainly a Node.js version incompatibility.

Cause: This happens when you are using a brand-new or unstable version of Node.js. Many packages that rely on native C++ code, like our database driver, are only compatible with stable, Long-Term Support (LTS) versions.

Solution: The fix is to use a Node Version Manager to install and switch to the recommended LTS version.

  1. Install a Node Version Manager:

  2. Switch to the Stable LTS Version:

    • Open a new terminal as an Administrator.
    • Install the latest Long-Term Support (LTS) version: nvm install lts
    • Tell nvm to use it: nvm use lts
    • Verify the change with node -v. It should now show a stable version (e.g., v20.x.x).
  3. Perform a Clean Installation:

    • It's crucial to delete the old, broken files. In your project directory, run:
      rmdir /s /q node_modules
      del package-lock.json
    • Now, run the installation again: npm install

Legal & Licensing

Your use of RelayBot is subject to the following legal documents. By adding the bot to your server, you are agreeing to these terms.

documents

The bot is provided "as is", without warranty of any kind.


This bot was originally conceived by YuRaNnNzZZ then ShaggyZE and has been refactored for public use.

← Back to Dashboard