ChatHub/docs

Search documentation

SUGGESTED FOR YOU200 results

Search published articles · By section

Connect a Discord bot to the ChatHub inbox

Create a Discord application, get the bot token, enable the message content intent, invite the bot to your server, then add the Discord channel in ChatHub to receive and reply to messages in the shared inbox.

What this guide covers#

The ChatHub Discord channel receives direct messages sent to your bot and messages in the text channels of your servers, then lets staff reply from the shared inbox — with attachments, quoted replies, buttons, and message recall.

Unlike the other channels, Discord does not push messages over a webhook. ChatHub opens a persistent connection to Discord and keeps it alive, so the installation needs no public HTTPS domain: a server behind NAT or on an internal network still receives everything.

All Discord-side configuration happens in the Developer Portal and takes about ten minutes. You need administrator rights on the Discord server you want to connect, because inviting the bot requires the Manage Server permission.

The screenshots were taken on a Developer Portal displayed in Vietnamese, because the portal follows the language of your Discord account. On an English account the same buttons read New Application, Reset Token, Message Content Intent and so on; the position and order are identical.

1. Before you start#

  1. 1

    A Discord account with a verified email, used to sign in to the Developer Portal at discord.com/developers/applications.

  2. 2

    A Discord server where you hold the Manage Server permission. If you only want to try things out, create a new free server in the Discord app.

  3. 3

    Administrator rights in ChatHub so you can open Channels and add an account.

A Discord bot cannot reach customers on its own: whoever writes to it must share a server with it. This differs from Zalo or Telegram, so have the server your customers already use ready.

2. Create the application and its bot#

  1. 1

    Open discord.com/developers/applications and sign in to your Discord account.

  2. 2

    Click New Application in the top right.

  3. 3

    In the Create an application dialog, fill in the Name field — this becomes the bot name your customers see — tick the terms checkbox and click Create.

  4. 4

    Discord may ask you to confirm you are not a robot; finish that check before the application is created.

  5. 5

    In the left menu, open Bot. A new application already ships with a bot; this page is where you set its avatar and display name.

The dialog that opens after clicking New Application: fill in Name, tick the terms box, then click Create. Captured before Create was pressed; the name is only an example. Vietnamese interface.
The name and avatar you set here are exactly what ChatHub reads after it connects, so use your real brand so customers recognise the bot in their chat window.

3. Get the bot token#

The bot token is this channel's only secret: anyone holding it can read and send messages in every server the bot is in. Discord shows a token exactly once, right after you reset it, so copy it and paste it straight into ChatHub.

  1. 1

    Still on the Bot page, find the Token section and click Reset Token. Discord asks for confirmation and may request your two-factor code if it is enabled.

  2. 2

    Copy the token that appears.

  3. 3

    Paste it into ChatHub following step 6 below before you leave the page. If you close the page too early, simply reset the token again — the old one stops working at that moment.

  4. 4

    If you want to be the only person who can invite the bot, turn off the Public Bot switch just below and save the change.

The Token section sits right under the bot username; Reset Token is where the secret comes from. Captured before the button was pressed, so no real token is visible. Vietnamese interface.
Never send the token over chat, email, or in a screenshot. ChatHub encrypts it with AES-256-GCM before storing it and never shows it again, not even to administrators.

4. Enable the message content intent#

Discord treats message content as sensitive data, so by default a bot is told a message exists but cannot see the text. Without this step the channel still connects, but nothing reaches the inbox — and ChatHub reports exactly that reason.

  1. 1

    On the Bot page, scroll down to Privileged Gateway Intents.

  2. 2

    Turn on Message Content Intent.

  3. 3

    Click Save Changes in the bar at the bottom of the page and wait for the confirmation that the bot was updated.

Only the bottom switch — Message Content Intent — needs to be on; leave the two above it off. The save bar appears at the bottom of the page once you flip it; captured just before saving. Vietnamese interface.
ChatHub does not use the other two switches — Presence Intent and Server Members Intent — so leave them off. Message Content Intent can only be self-enabled while the bot is in fewer than 100 servers; beyond that Discord requires verification, which a single company's bot almost never reaches.

5. Invite the bot to your server#

A bot only reads the channels it is in and has permission for. This step builds an invite link that carries the minimum permission set.

  1. 1

    In the left menu, open OAuth2 and scroll down to the OAuth2 URL Generator block.

  2. 2

    Under Scopes, tick bot.

  3. 3

    Under Bot Permissions, tick View Channels (General Permissions column) plus Send Messages, Attach Files and Read Message History (Text Permissions column).

  4. 4

    Copy the link from the Generated URL box at the bottom, open it in a browser, pick the server and confirm the permissions.

  5. 5

    Open Discord and check that the bot now appears in the server member list.

The four permissions to tick: View Channels in the left column; Attach Files and Read Message History in the right column; Send Messages sits higher in that same column and is outside the frame. Vietnamese interface.
The invite link appears in the Generated URL box at the bottom of the page. With exactly those four permissions the link carries permissions=101376 — a quick way to double-check your selection. Vietnamese interface.
Those four permissions are enough for live chat. Do not grant Administrator: a leaked token would then open the whole server, while the minimum set only allows reading and replying.

6. Add the Discord channel in ChatHub#

  1. 1

    In ChatHub, go to Administration -> Channels and click Add account in the top right.

  2. 2

    In the channel type column of the dialog, scroll to the bottom and select Discord.

  3. 3

    Give the channel a memorable name, for example Community Discord — this name only appears inside ChatHub to tell channels of the same type apart.

  4. 4

    Paste the bot token into the Bot token field. ChatHub checks the token shape immediately and reports an error if part of it is missing.

  5. 5

    Click Create account. The channel dialog opens with the status Disconnected.

  6. 6

    Click Connect. After a few seconds the status turns to Active, and the channel name and avatar are replaced by the bot's own name and picture.

Discord sits at the bottom of the channel type list. Selecting it reveals the Bot token field and a next-step box reminding you to enable the Message Content intent. Captured with the token field empty. Vietnamese interface.
If ChatHub runs several processes, the Discord connection is held by the worker process. Clicking Connect in the interface still works: the request is handed to the worker and the result comes straight back to your screen.

7. Test it and fix common errors#

  1. 1

    In Discord, post a message in a text channel the bot can see, or send the bot a direct message.

  2. 2

    Open Messages in ChatHub: the new conversation appears with a Discord badge on the corner of the avatar.

  3. 3

    Reply from ChatHub and check that the message lands in the right place in Discord.

When something goes wrong, ChatHub writes the cause on the channel card instead of a raw Discord code:

  1. 1

    Discord rejected this bot token — the token was reset again, so the stored copy is dead. Get a new token and recreate the channel.

  2. 2

    The bot is missing the message content intent — go back to step 4 and turn on Message Content Intent.

  3. 3

    The bot has no permission in this channel — open the channel settings in Discord, go to Permissions, and grant its role the permissions listed in step 5.

  4. 4

    This person does not accept direct messages from the bot — they must share a server with the bot and allow direct messages from server members in their Discord privacy settings.

8. Scope and limits worth knowing#

  1. 1

    Group messages: the Sync group messages switch in the channel dialog decides whether server text channels reach the inbox at all. Turn it off and only direct messages remain. You can also exclude individual channels once they have sent their first message.

  2. 2

    History sync: only messages in server text channels can be pulled, up to 200 messages per channel and 500 channels per run. Old direct messages cannot be pulled because Discord does not let a bot list its own inbox.

  3. 3

    Long messages: Discord caps a message at 2,000 characters, so ChatHub splits a longer reply into consecutive messages.

  4. 4

    Attachments: 25 MB on a server without boosts. Files customers send are copied into ChatHub storage on arrival, because Discord attachment links expire after about a day.

  5. 5

    Mentions: messages ChatHub sends never trigger @everyone or @here, even when the text contains those words.

  6. 6

    Messages from other bots and from webhooks stay out of the inbox, so two bots sitting in one channel cannot answer each other in a loop.

  7. 7

    Discord has no read receipts for bots, so the inbox does not show whether a customer has seen a message.

See also: the channel types ChatHub supports ↗

Connect a Discord bot to the ChatHub inboxBack to top
© 2026 ChatHub DocsPowered by CMSNT LTDA guide to using ChatHub.