This is a FoundryVTT module designed to mirror Foundry chat to a Discord channel.
- Create a Webhook in your Discord server, and specify which channel to output chat to. Copy the Webhook URL, you'll need it later. a. Server Settings (or channel settings) > Integrations > Webhooks > [New Webhook] b. Set webhook name and channel to post to. c. [Copy Webhook URL]
NOTE: if you're planning on having different Foundry Worlds post to separate Discord OR a separate channel for Rolls, additional Webhooks will need to be created.
-
Add the module to FoundryVTT. Add-on Modules > Install Module > Search for DiscordConnect
-
Open Foundry and enable the module. Game Settings > Manage Modules
-
Configure the module settings in Foundry. See below for info on each setting. Game Settings > Configure Settings > Module Settings
That's it!
Ignore Whispers & Private Rolls: Enable this to ensure GM and Private messages, (both rolls and chat) aren't posted to Discord for all to see.
Game Invite URL: the external, internet URL everyone connects to the server through Game Settings > Game Access > Invitation Links "Internet"
Webhook URL: Discord Webhook URL from Step 1. This is where chat will be sent, not including rolls.
Roll Webhook URL: Discord Webhook URL for rolls - either the same webhook for rolls to appear in the same channel as chat, or a separate webhook needs to be setup for the rolls to appear in. Leave empty to ignore all rolls.
#Getting Main GM ID Option A:
-
Open browser Inspect/Developer Tools on the Foundry tab Chrome: (Windows, Linux, Chrome OS): [F12] or Control+Shift+C Chrome (Mac): Command+Option+C
-
Within Console type: game.user for current user information game.users for all user information
-
Expand to find the correct user's name and find the _id (> data : 16 character string) This is the ID needed for the Main GM ID field.
Option B:
-
Install and enable the module, and provide a webhook.
-
Type dc getID into chat as the user you would like to get the ID of.
-
Check your discord chat channel as defined by your webhook.
NOTE: The Main GM must be logged in for DiscordConnect to work!
-Only partial support for midi-qol messages at the moment; more to come in the future!
-It's really bad with html content in general. Oops.
I want it to work regardless of how many gm's there are, without needing users to select a "primary".
Hopefully total support for major other modules (like midi-qol!) won't be too huge.
If you have any questions, issues, or suggested features, feel free to dm me on discord (Caoranach#9357) or email me at caoranach.ar@gmail.com!
Special thanks to Foundry-DiscordBridge by nearlyNonexistent, whose code helped me figure out a few things about how Foundry worked!
Thanks also to Vaelos, who helped me submit it.