Discord is a popular communications app used by gamers to communicate online. It lets you share voice, video, and text chat with friends, game communities, and developers.
Find the open source transformer code for this destination in the GitHub repository.
Getting started
RudderStack supports sending event data to Discord via the following connection modes:
Connection Mode | Web | Mobile | Server |
---|---|---|---|
Device mode | - | - | - |
Cloud mode | Supported | Supported | Supported |
Once you have confirmed that the source platform supports sending events to Discord, follow these steps:
- From your RudderStack dashboard, add the source. Then, from the list of destinations, select Discord.
- Assign a name to the destination and click Continue.
Connection settings
To successfully configure Discord as a destination, you need to configure the following settings:
- Identify Template: Enter a template for building a text message while sending an
identify
call to Discord. If not provided, RudderStack usesUser {{name}} with {{traits}} is identified
as the default template. - Event Name: Enter the event name for which RudderStack should trigger the
track
call's event template. - Event Template: Enter a template for building a text message while sending a
track
call to Discord. If not provided, RudderStack usesUser {{name}} did {{event}} with {{properties}}
as the default template. - Regex Matching: Enable this setting if you want to match multiple event names in the
track
call using a regex. It helps in setting the same event template for the event names matching the regex. - Embed Flag: Enable this setting to set an embed message for Discord. If enabled, also specify the following:
- Title Template: Enter the template for building the title of the embed message. If not provided, RudderStack uses
Identify/Track call made
as the default title. - Description Template: Enter the template for building the description of the embed message. If not provided, RudderStack uses
Message from RudderStack
as the default description.
- Title Template: Enter the template for building the title of the embed message. If not provided, RudderStack uses
- Webhook Url: Enter the webhook URL of the Discord channel where you want to send the data. You can create it by logging in to Discord, selecting the channel, and going to the Channel settings > Integrations > Create Webhook.
- Trait: Enter all the traits you want to send to Discord in the text message.
Identify
You can use the identify
call to create or update a user in Discord.
A sample identify
call is shown below:
rudderanalytics.identify("1hKOmRA4GRlm", { name: "Alex Keener", email: "alex@example.com", country: "USA"});
userId
or anonymousId
is required to make an identify
call successfully.RudderStack sends the above identify
call to Discord in the following text message format (using the default identify
template):
User Alex Keener with email: alex@example.com, country: USA is identified
- When the Embed Flag setting is enabled and the default values for Title Template and Description Template are used:
"content": "User Alex Keener with email: alex@example.com, country: USA is identified","embeds": [{ "description": "Identify call made", "title": "Message from Rudderstack "}]
RudderStack sends the text message in the content
property after converting it into the identify
template specified in the dashboard. Also, if the Embed Flag setting is enabled, it sends the embed message details in the embeds
property. Refer to the Discord documentation for more information.
Track
You can use the track
call to capture user events along with the properties associated with them.
A sample track
call is shown below:
rudderanalytics.track("Order Completed", { category: "category", label: "label", value: 120});
event name
is a required property to make a track
call successfully.RudderStack sends the above track
call to Discord in the following text message format (using the default track
template):
Anonymous user anon_id did Order Completed with category: category, label: label, value: 120
- When the Embed Flag setting is enabled and the default values for Title Template and Description Template are used:
"content": "Anonymous user anon_id did Order Completed with category: category, label: label, value: 120","embeds": [{ "description": "Track call made", "title": "Message from Rudderstack "}]
RudderStack sends the text message in content
property after converting it into the track
template specified in the Event Template dashboard setting. Also, if the Embed Flag setting is enabled, it sends the embed message details in the embeds
property. Refer to the Discord documentation for more information.
Contact us
For more information on the topics covered on this page, email us or start a conversation in our Slack community.