Discord Bridge

Description

Luanti-Discord Relay [discord_bridge] 🔗

attention! 0.0.13 will introduce breaking changes: a rewritten config system 🔗

THIS README FILE IS DEPRECATED, and it's just here because it was in original mod, will be fixed soon 🔗

A feature-filled Discord relay for Luanti, supporting:

  • Relaying server chat to Discord, and Discord chat to the server
  • Allowing anyone to get the server status via a command
  • Logging into the server from Discord (configurable)
  • Running commands from Discord (configurable)
  • A simple API

Great! How do I use it? 🔗

Easy! discord_bridge works by running a Python program which converses with a serverside mod using HTTP requests.

Python 3.8+, aiohttp 3.7.4+ and discord.py 2.0.0+ are required.

Basic setup 🔗

  1. Download the source code and its dependencies.
  2. Create an application at the Discord Developer Dashboard and enable it as a bot (in the Bot tab.) Also enable the Message Content Intent.
  3. Copy the token from your newly-created bot, and use it to finish setting up relay.conf.

Example relay.conf: (The token shown below has been regenerated)

[BOT]
token = NjEwODk0MDU4ODY4NzAzMjMz.XVL5dA.8j8d2XN8_5UwRheG91P2XksYDoM
command_prefix = !
[RELAY]
allow_remote = false
port = 8080
channel_id = 576585506658189332
allow_logins = true
clean_invites = true
use_nicknames = true
  1. Set discord.port in your minetest.conf to match the port you used in relay.conf, and grant the mod permission to use the HTTP API. You may also set discord.text_color to a hex color string if you'd like to color relayed messages from Discord. Set discord.host if you want to use remote server.py

Example minetest.conf excerpt:

secure.enable_security = true
secure.http_mods = discord_bridge
discord.host = localhost
discord.port = 8080
discord.text_color = #a7a7a7
discord.escape_formatting = false

(Side note: The port must be set in both relay.conf and minetest.conf because users may decide to run the relay in a different location than the mod, or to run multiple relays/servers at once.)

  1. Run the relay and, when you're ready, the Luanti server. The relay may be left up even when the server goes down, or may run continuously between several server restarts, for maximum convenience.

Frequently Asked Questions 🔗

Q: I just want a normal relay. Can I disable logins?

A: Yep! Just set allow_logins = false in relay.conf.

Q: Do I need to re-login after a server restart, like with the IRC mod?

A: Nope, logins persist as long as the relay is up.

Q: I'm getting an HTTP error - it says the server can't be found?

A: Make sure the relay is running and that you've configured the correct port in both minetest.conf and relay.conf.

Q: Why is an external program required at all? And why use HTTP polling?

A: Discord's API uses websockets, which require a continuous connection. Luanti's Lua API is not set up to handle these, so running a Discord relay entirely within Luanti is infeasible. HTTP polling is used because it avoids additional dependencies (such as luasocket).

Reviews

Review

Do you recommend this mod?

  • No reviews, yet.

Releases

0.0.12

Download

2026-05-12 10:05 UTC

0.0.12 - slash commands 🔗

  1. fixed password placeholder
  2. removed redundant code
  3. allow_login completelly block commands now
  4. slash commands
  5. typo
  6. fixed Dockerfile CMD
  7. send a message on server.py ready
  8. added TODO

0.0.11

Download

2026-02-14 06:52 UTC

0.0.11 - offline whereis 🔗

  1. whereis now shows offline players as well
  2. renamed player position key in mod_storage
  3. added import_player_pos.py script
  4. coords are now not x10

0.0.10

Download

2026-02-12 09:56 UTC

0.0.10 - critical bug fix 🔗

  1. fixed type error
2026-02-12 05:17 UTC

0.0.9 - Dockerfile 🔗

  1. it's 127.0.0.1, not localhost
  2. added Dockerfile
2026-02-12 04:02 UTC

0.0.8 - bug fixes 🔗

  1. send properly formatted message to discord dm
  2. send user list to luanti when server.py restarts
All releases

Threads

New thread

Thread Last Reply

No threads found

Information

Provides

discord_bridge

Dependencies

Required
No required dependencies
Optional
irc

Information

Type
Mod
Technical Name
discord_bridge
Languages
English
License
MIT
Maintenance State
Work in Progress
Added
2026-01-26 07:39 UTC
Maintainers
Lesha_Vel