Discord¶
ViewDock has two independent Discord features, both configured under Admin → Discord:
- Discord sign-in lets people sign in with their Discord account, optionally limited to members of your server or a role.
- The Discord bot adds a
/partyslash command so people can start and control watch parties from a Discord channel.
Both need a Discord application, created in the Discord Developer Portal. Set the public URL under Admin → Settings (or VD_PUBLIC_URL) first, so the addresses ViewDock gives Discord stay stable behind your reverse proxy or tunnel.
Discord sign-in¶
Warning
When Discord sign-in is on, local username and password sign-in and signup are turned off completely. Save your own Discord user ID as the Superadmin before enabling it, so you keep access to the administrator account.
- In the Developer Portal, open your application's OAuth2 page. Copy the Client ID and Client secret, and add the Redirect URL shown on the ViewDock Discord page as a redirect.
- In Discord, turn on Settings → Advanced → Developer Mode, then right-click your profile and choose Copy User ID.
- In Admin → Discord, enter the Superadmin Discord user ID, the client ID and the client secret, then save.
- Optional settings:
- Allow new users to register with Discord. Without it, only existing accounts that have linked Discord can sign in.
- Registration whitelist. Require new sign-ups to be members of a Discord server, and optionally to hold a role in it. Accounts that are already linked skip these checks.
- Extra administrator Discord user IDs, comma-separated.
- Tick Enable Discord sign-in and save.
Existing users can link their Discord account under Settings → Connected.
Discord bot and slash commands¶
The bot receives slash commands through an HTTPS interactions endpoint on your ViewDock server, so the public URL must use HTTPS and be reachable from the internet.
- In the Developer Portal, open the Bot page and copy the bot token. The application public key is on the General Information page.
- Add the bot to your server with the OAuth2 URL generator, selecting the
botandapplications.commandsscopes. - In Admin → Discord, paste the bot token and save. You can paste the public key too; if you leave it empty, ViewDock saves it automatically when you register commands. The page tells you if the saved key does not match the bot's application.
- Press Register commands. Enter a server ID to make the commands available in that server immediately, or leave it blank to register them for every server (global commands can take up to an hour to appear).
- Press Set endpoint in Discord so Discord sends interactions to ViewDock.
The bot token can also be provided with VD_DISCORD_BOT_TOKEN; a value saved in the admin page takes precedence. Tokens and secrets are stored encrypted with the master key.
Commands¶
| Command | What it does |
|---|---|
/party create title:<title> |
Starts a watch party for a title and links it to the current channel |
/party invite |
Posts the invite link for the party linked to this channel |
/party status |
Shows the state of the linked party |
/party pause, /party resume |
Pauses or resumes the party (host only) |
/party link-voice channel:<voice channel> |
Links a voice channel to a party (host only) |
/party unlink |
Removes a channel's party link |
People must link their Discord account to ViewDock (through Discord sign-in or Settings → Connected) before they can use the commands. Anyone who has not linked an account gets a private reply explaining how.
Administrators can also post a party invite into any channel with Send party invite on the Discord page, and see which channels are linked to which parties.