This FoundryVTT module is designed to push messages from Discord to the game chat log. It runs only when the game is also running, and will not collect or synchronize messages offline.
The module will forward all messages from all channels it has access to. You can assign the bot a role and manage its permissions through the Discord server interface.
A GM user needs to be logged in for the Discord connection to remain active.
Enter your Discord server ID, which you can find as described here.
Enter a list of comma-separated Discord channel IDs, as described here. The bot will only relay messages from these channels.
If this field is blank, the bot will relay messages from all channels it has access to.
Enter your Discord bot token here. See below for details on setting up your bot.
When messages are deleted in Discord, you can optionally preserve them in the chatlog. If this setting is enabled, deleted messages will still be in the chat log but the content will have a strikethrough to indicate its status.
You are responsible for setting up your own Discord bot, as described below. You can assign a role or channel permissions to the bot through the Discord server interface to restrict which channels it can observe.
Here's how to set up a basic Discord bot for this module's purpose:
- Open the Discord developer portal and log in to your account
- Click on the "New Application" button
- Enter a name and confirm the pop-up window by clicking the "Create" button
- On the left, click on the "Installation" menu and adjust the settings (see figure 1 below)
- Turn off "User Install"
- Add the "bot" scope and the "Read Message History" permission
- Copy the provided "Install Link"
- On the left sidebar, click on the "Bot" menu
- Click on the "Reset Token" button and copy the resulting token. KEEP THIS VALUE SECRET!
- Scroll down and ENABLE the special permissions:
- "Presence Intent" to allow the bot to read user nicknames
- "Message Content Intent" to allow the bot to read messages
- Open the install link from 4(iii) and authorize the bot to your server
- Open your FoundryVTT game and input the token from step 5(i) for this module's "Discord Token" setting
- Markdown formatting: apply markdown formatting to the message to imitate Discord's styling
- Whispers: make a hook to mimic DMs as whispers