Mods / Discord Bot

Category: #Utility
Author: bluelightning32
Side: Server
Created: Sep 5th at 11:27 PM
Last modified: Sep 10th at 5:29 AM
Downloads: 189

Note that Th3Essentials has a superset of the functionality of Discord Bot. I recommend using it instead. Th3Essentials was released after I released this mod.

 
 
This is a server side Vintage Story mod that provides a Discord bridge. Features:
  • Players join and leave messages are sent to Discord.
  • Players death messages are sent to Discord.
  • Messages from discord are sent to the game.
  • Server startup and shutdown messages are sent to Discord.
  • Discord messages from specific users can be ignored (useful for bots).
  • Configurable log scraping to Discord. By default this is used for temporal storm messages.
  • In game player groups can be configured to connect to different Discord channels.
  • Individual features can be enabled or disabled through the config file.

Installation


  1. Put the discordbot.zip file in the Mods folder on the server-side only.
  2. Start the server to create a default ModConfig/discordbot.json file in your VS config folder. Note that until the correct login information is added to the config file, you will see errors in the server log about 'The server sent close 4004: "Authentication failed.'"
  3. Create a discord application for your server. The application name will become the bot's username.
  4. Click on the Bot tab of the application, then click Add Bot.
  5. On the Bot tab, copy the token (you can use the Copy button). Paste that token between the quotes in the DiscordToken field in discordbot.json. Note that the client secret on the OAuth2 tab is different from the token and cannot be used as a substitue for the token.
  6. Give the bot permissions to interact with your server on the OAuth2 tab. First click the bot checkbox under scopes, then check Send Messages below.
  7. Go to the generated URL shown at the end of the scopes section. Select the server to add your bot to.
  8. In Discord, right click the channel the Bot should listen to, and select Copy ID in the context menu. Paste that channel into the DefaultChannel/DiscordChannel field of discordbot.json. The channel id should not be surrounded by quotes.
  9. Restart the server for the mod settings to take effect.

Per group channels


The text from specifc in game groups can be redirected to their own discord channel. In-game groups are connected to the default channel, unless it has a channel override. This is configured through the ChannelOverrides section in discordbot.json. The default config has a sample no-op entry that you may edit or delete. The name of the group in-game is the key for the entries in the dict. DiscordChannel is the id of the Discord channel to connect the in-game group to.

Server start/stop, death messages, log scrapes, etc. are only sent to the default channel.

Version For Game version Downloads Release date Changelog Download
v1.0.4 35 Sep 10th at 5:29 AM Show discordbot.zip
v1.0.3 22 Sep 10th at 12:53 AM Show discordbot.zip
v1.0.2 44 Sep 7th at 7:26 AM Show discordbot.zip
v1.0.1 45 Sep 5th at 11:48 PM Show discordbot.zip
v1.0.0 43 Sep 5th at 11:28 PM Show discordbot.zip

2 Comments (oldest first | newest first)

bluelightning32, Sep 6th at 9:29 AM

I released v1.0.1 to fix a hang on shutdown. If it's only stalling for a couple seconds on shutdown, but that may be normal.

As for for the start up error, please file a bug in github. Include the error message and which platform you're running it on. Honestly, I've only tested the bot on Linux so far.

NPCFanatic, Sep 6th at 4:29 AM

every time i try and set up the config for the bot to work, it keeps giving me the failed to start system discordbot.discordbotmod. and it still hangs when for a second when closing down the server

delete edit