[Mod + Program] Minetest-Discord relay [discordmt] [v0.1]

User avatar
archfan7411
New member
 
Posts: 9
Joined: Wed Sep 26, 2018 00:37
GitHub: archfan7411
In-game: archfan

[Mod + Program] Minetest-Discord relay [discordmt] [v0.1]

by archfan7411 » Wed Aug 28, 2019 12:53

Minetest-Discord relay [discordmt]

An easy-to-use relay complete with login and command support, using an external program written in Python.

GitHub | Releases | Wiki

Licensed under MIT

Have you ever wanted to interact with and moderate your server without logging into the game (or IRC)?
Do you have an active community on Discord which you'd like to bridge to Minetest?
Are you unsatisfied with the features or long installation steps of the current Discord relays?


If you answered YES to any of these questions, discordmt is for you!

Setup

1. Download or clone the repository. If you don't want to install Python and/or the dependencies for running the Python relay, take a look at the releases for binary executables.

2. Create an application at the Discord Developer Dashboard and enable it as a bot (in the Bot tab.) For a more detailed guide on creating Discord bots, see this bot setup guide by reactiflux.

3. Copy the token from your newly-created bot, and use it to finish setting up relay.conf along with any other settings you wish to change. The ID of the channel you wish to relay to must also be specified in relay.conf; you may obtain it by enabling Developer Mode on the Discord client and rightclicking the desired channel in the list.

Example relay.conf: (The token shown below has been regenerated)
Code: Select all
[BOT]
token = NjEwODk0MDU4ODY4NzAzMjMz.XVL5dA.8j8d2XN8_5UwRheG91P2XksYDoM
command_prefix = !
[RELAY]
port = 8080
channel_id = 576585506658189332
allow_logins = true
clean_invites = true
use_nicknames = true


4. Put discordmt in your Minetest mods directory. You may also run the relay program from the mod directory, though server owners may wish to separate the two for cleanliness. If you separate the two, ensure that at least the init.lua and settingtypes.txt make it into the mods directory.

5. Enable mod security and add discordmt to the HTTP mods. In addition, set "discord.port" in your minetest.conf to match the port you used in relay.conf and optionally set "discord.text_color" to a hex color string if you'd like to color relayed messages from Discord.

Example minetest.conf excerpt:
Code: Select all
secure.enable_security = true
secure.http_mods = discordmt
discord.port = 8080
discord.text_color = #a7a7a7

(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.)

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

Logging in and running commands

Discord users may log in by using the !login <username> [password] command in DMs (Direct Messages) with the bot. This command should never be used outside of DMs.

Once a user is logged in, they may run commands with !cmd <command name> [command params] in either the relay channel or DMs with the bot.

Additional information

- Logins persist while the relay is up; users do not need to relogin after the Minetest server alone restarts.
- The relay program must be running if you start a Minetest server with `discordmt` enabled; otherwise HTTP errors will be thrown.
- Running two Minetest servers connecting to a single relay, or multiple relays connected to a single bot, will work unexpectedly and is not recommended. You should run a separate relay and bot for each Minetest server.

Thank you for taking the time to read my wall of text, and feel free to reply or otherwise contact me if you have any issues using the relay.
Last edited by archfan7411 on Sat Oct 19, 2019 14:20, edited 2 times in total.
 

User avatar
archfan7411
New member
 
Posts: 9
Joined: Wed Sep 26, 2018 00:37
GitHub: archfan7411
In-game: archfan

Re: [Mod + Program] Minetest-Discord relay [discordmt] [v0.1

by archfan7411 » Wed Aug 28, 2019 23:29

The relay has been updated to support a new relay.conf option, "clean_invites". When enabled, this option automatically strips Discord invite links from Discord messages when relaying them to Minetest.

A note: The current GitHub Release has had its binaries updated to reflect the change, however the source code bundled with the release is outdated. Releases are used in this project solely to distribute compiled binaries of the Python relay for those who do not wish to install the dependencies, and the source code should always be cloned from the master branch.
 

redblade7
Member
 
Posts: 280
Joined: Sun Feb 15, 2015 07:14
IRC: redneonglow redblade7
In-game: redblade7 redblade7_owner

Re: [Mod + Program] Minetest-Discord relay [discordmt] [v0.1

by redblade7 » Thu Aug 29, 2019 01:41

Looks great!

Caveat for people like me who try and stick with the stable versions, if you're on v5.0.1 you have to make this change to avoid annoying messages filling up your log:

https://github.com/minetest/minetest/co ... 604ef44a0b
-redblade7, admin of: THE CREATIVE GARDENS (creative), THE VALLEYS (sandbox), and THE DIGITAL FARMS (farming/hunger/shops)
 

User avatar
archfan7411
New member
 
Posts: 9
Joined: Wed Sep 26, 2018 00:37
GitHub: archfan7411
In-game: archfan

Re: [Mod + Program] Minetest-Discord relay [discordmt] [v0.1

by archfan7411 » Fri Oct 18, 2019 19:10

An update has been released on GitHub which fixes compatibility with the IRC mod.
 


Return to WIP Mods



Who is online

Users browsing this forum: Bing [Bot], BuckarooBanzay and 4 guests