No description
  • JavaScript 100%
Find a file
2026-02-16 00:46:34 +02:00
.env.example update documentation 2026-02-16 00:46:34 +02:00
.gitignore initial commit 2026-02-15 18:17:23 +02:00
.nvmrc initial commit 2026-02-15 18:17:23 +02:00
formatter.js update documentation 2026-02-16 00:46:34 +02:00
index.js update documentation 2026-02-16 00:46:34 +02:00
package.json update documentation 2026-02-16 00:46:34 +02:00
README.md update documentation 2026-02-16 00:46:34 +02:00
ts-discord-bridge.service.example update documentation 2026-02-16 00:46:34 +02:00

TS-DISCORD-BRIDGE

Log Teamspeak channels and users to Discord

This is a very simple script that does two things:

  • It reads your local Teamspeak HTTP API to find the channels and users in those channels.
  • It posts those to Discord via webhook.

The message is updated in place every 60 seconds. It shows which users are in which channels and how long they have been connected.

Configuration

  1. Make sure your TeamSpeak server has the HTTP API enabled. Open your tsserver.yaml and check that the following is set:
query:
  http:
    enabled: true

The HTTP API runs on port 10080 by default. If the bot runs on the same machine as the server, no firewall changes are needed.

  1. Get your TeamSpeak API key. This is logged to the server console the first time the TeamSpeak server starts. It looks something like this in the logs:
------------------------------------------------------------------
                      I M P O R T A N T
------------------------------------------------------------------
               Server Query Admin Account created
         loginname= "serveradmin", password= "xxxxxxxx"
         apikey= "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
------------------------------------------------------------------

Copy the apikey value. If you lost it, you can generate a new one through the ServerQuery.

  1. Create a Discord webhook. Go to your Discord server settings, then Integrations, then Webhooks. Create a new webhook, pick the channel you want the bot to post in, and copy the webhook URL.

  2. Clone the repo and install dependencies:

git clone https://source.tube/sami/ts-discord-bridge.git
cd ts-discord-bridge

There are no npm dependencies, but you need Node.js 24.13.1 or newer.

  1. Create a .env file in the repo directory. You can copy the example:
cp .env.example .env

Then fill in your values:

DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/123456789/abcdefg
TS_API_KEY=your_teamspeak_api_key_here
  1. Run the bot:
node index.js

If everything is configured correctly you should see it log that it created a Discord message, and the message should appear in your webhook channel.

Running as a systemd service

If you want the bot to run in the background and start on boot, there is an example unit file included.

  1. Copy ts-discord-bridge.service.example to /etc/systemd/system/ts-discord-bridge.service.
  2. Edit the file and update WorkingDirectory and EnvironmentFile to point to where you cloned the repo.
  3. Reload systemd and enable the service:
sudo systemctl daemon-reload
sudo systemctl enable ts-discord-bridge.service
sudo systemctl start ts-discord-bridge.service

You can check the logs with journalctl -u ts-discord-bridge.service -f.

Why?

Discord is shit. The latency with Discord's VOIP was terrible and having any type of back-and-forth is rather terrible when there's a 100ms latency each way. Oh, and Palantir is after your blood, which isn't very nice of them.

Our friend group has really enjoyed the quality and low latency of a locally hosted TeamSpeak server. Alas, old habits die hard and most of our random chit-chat typing and memeing is still on Discord. The text chat on TS6 is still a bit, well, shit.

My friend (shoutout to Julyan) complained that he's still not in the habit of opening TeamSpeak and he has a hard time figuring out if someone is playing something he could join. So, I brough our TeamSpeak status to Discord. Just for him.