Skip to main content

Discord Application

Previous Step: Login to Drivers Hub
You've logged in to the Drivers Hub and ready to start configuring things! But before we make it more customized, you need to configure Discord Application so that users could sign up and login with their Discord Account, which is the only way to become a user in Drivers Hub.

  1. Open Discord Developer Portal and click New Application.

  2. Enter the name of the application, check the "agree box" and click create.
    There's no requirement on the name, it could be anything you want.

  3. (Optional) Customize the application.
    App icon will be displayed when users authorize their Discord Account. Description will be the About Me of the bot that we will create later.

  4. Navigate to OAuth2 - General and reset Client Reset.
    i) Click Reset Secret.

    ii) A prompt will be shown. Click Yes, do it!

    iii) You'll be asked for 2FA Code if enabled. Enter the code and click Submit.

  5. Copy Client ID and Client Secret, switch to Drivers Hub tab and paste them as discord_client_id and discord_client_secret in JSON Config.

  6. Copy discord_callback_url in JSON Config, switch to Discord Developer Portal tab, click Add Redirect, paste the discord_callback_url in the input box, then save the changes.

  7. Navigate to OAuth2 - URL Generator, check identify and email in scopes, select the redirect url you just configured, copy the generated url, switch to Drivers Hub tab and paste it as discord_oauth2_url in JSON Config.

  8. Switch to Discord Developers Portal, create a bot.
    i) Navigate to Bot, and click Add Bot.

    ii) A prompt will be shown. Click Yes, do it!

  9. (Optional) Customize the bot.
    Icon will be the bot's avatar.

  10. Scroll down, enable all Privileged Gateway Intents.

  11. Reset the bot's token, just like when you reset the client secret.

  12. Copy Token, switch to Drivers Hub tab and paste it as discord_bot_token in JSON Config.

  13. Open Discord Application, go to the VTC's Discord Server, right click it's name, then click Copy ID.
    Note that you have to enable Developer Mode to make Copy ID button show. We won't provide guide on enabling Developer Mode here as there's hundreds of existing guide on the Internet.

  14. Switch to Drivers Hub tab, paste the ID as guild_id in JSON Config.

  15. Save config. (You cannot reload until you enable MFA)

  16. Switch to settings and enable MFA.

  17. Switch to configuration and reload API.

  18. Invite the bot to VTC's Discord Server. This could be done by changing the scopes in URL Generator to bot and application.commands, and checking Manage Roles, Send Messages, Read Message History in bot permissions (note that these permissions are required by Drivers Hub Discord Integration, it might need more permissions if you use the bot for other purposes). Then copy the generated URL and open it in browser to add the bot to a Discord Server.
    Please search on the Internet if you need more guide on inviting a bot to a Discord Server.

  19. Wait some time until the API fully restart. Then create a Prvate Window or enter Icognito Mode and try logging in with Discord to see if it works.

Next Step: Logging Jobs: Navio Integration