A Discord bot that relays messages bidirectionally from and to your GMod server. Unlike most relays this one doesn't require any binary modules installed on your GMod server.

It can also show your server's status.
- Relay in-game chat and other messages from multiple servers.
- Relay discord messages to your GMod server.
- Execute RCON commands from discord.
- Show live server status on a designated channel.
- A GMod server with RCON and logging working properly and this addon installed.
- Node.js v16 or higher.
The relay also supports sending custom messages from your GMod server.
This can be useful for implementing gamemode specific functionality to the relay.
In order to send a custom message you can use the SendRelayMessage(string,string) function.
Example usage:
SendRelayMessage("Custom Username","Any message")
Result:
- Head over to the Discord Developer Portal.
- Press the "New Application" button and name the bot however you like.
- Go to the "Bot" tab and check the "Message Content Intent" option, then click "Save changes".

- Go to "Installation" and copy the "Install Link".

- Paste the link into your address bar and add this snippet of text at the end
&permissions=536938560&scope=botand hit Enter.
- Add the bot to your server.
- After adding the bot to your server, go back to your bot's page and enter the "Bot" tab of your bot.
- Click the "Reset Token" button and then copy the newly generated token.
- Save the token for later, as you will need it in later steps.
- Head over to (https://steamcommunity.com/dev/apikey).
- Create an API key and then copy and save it for later.
- Clone this repository with the
git clone https://github.com/Dorian399/GM-DiscordRelay.gitcommand. - Go to the repo's main directory. (
cd "GM-DiscordRelay"). - Run
npm installto install all the required dependencies. - Edit the
config.cjsfile in a text editor and configure everything to your liking. - If you have any trouble figuring what to put as the channel ID's or User ID's, you can follow this guide to find those.
- Everything is set up, you can launch the bot using
node index.js.
Note: Ensure that the relay’s port only accepts connections from your server and is blocked for all other external traffic in your firewall.
- Open your
server.cfgin a text editor. - Add these commands to your
server.cfg:
log on
logaddress_add IP:PORT
sv_logecho 0
The IP and PORT values should be changed to the ip and port your bot is hosted on.
- If you don't have an RCON password set, you can set it by adding
rcon_password yourpasswordto yourserver.cfgfile. - Save and exit the
server.cfgfile. - Go to your server's addons folder.
- Download the required addon using this command:
git clone https://github.com/Dorian399/gm_discordrelay_addon.git. - Everything is set up, you can start your GMod server.


