This is one of my first attempts at scripting for TES3MP and Lua
Note: Due to limiations with Lua, we are unable to use wss (websockets), This prevents the ability to have Discord -> tes3mp chat. You can follow progress here https://github.com/MrFlutters/TES3MP_DiscordRelay/issues/1
This branch has been tweaked to use webhooks as an "Lazy and quick" working alternative, while a more elegant solution is planned
Feel free to submit Issues and Pull Requests.
Consistent tabulation
lowerCamelCase for local and global variables
UpperCamelCase for function names.
(TES3MP -> Discord)
. It does not show discord messages in-game (Discord -> TES3MP)
Copy the folders lib/
and script/
into server
(or Corescripts folder).
Add DiscordRelay = require("custom/DiscordRelay/main")
to scripts/customScripts.lua
Start your TES3MP server, You should see
[ERR]: [Script]: [DiscordRelay] webhook_url is blank or empty.
if not you have not followed the steps correctly or have an compatability issue
Edit config found at data/custom/__config_DiscordRelay.json
1) Create or select the channel you would like to use
2) Right click and edit the channel
3) Select webhook from the side menu
4) Create a webhook and customize it as you see fit
Note: At this time the bot's name is set to the players name with no configuration option, So the name does not matter
5) Add the webhook to data/discord_config.json
6) You should see something like below when a player types ingame.