Skip to main content

Discord Data Source

Nexla's bi-directional connectors allow data to flow both to and from any location, making it simple to create a FlexFlow, DB-CDC, Spark ETL, or Replication data flow that ingests data from a Discord location.
discord.png

Discord

Follow the instructions below to create a new data flow that ingests data from a Discord source in Nexla.

Create a New Data Flow

  1. To create a new data flow, navigate to the Integrate section, and click the New Data Flow button. Then, select the desired flow type from the list, and click the Create button.

  2. Select the Discord connector tile from the list of available connectors. Then, select the credential that will be used to connect to the Discord bot, and click Next; or, create a new Discord credential for use in this flow.

  3. In Nexla, Discord data sources can be created using pre-built endpoint templates, which expedite source setup for common Discord endpoints. Each template is designed specifically for the corresponding Discord endpoint, making source configuration easy and efficient.
    • To configure this source using a template, follow the instructions in Configure Using a Template.

    Discord sources can also be configured manually, allowing you to ingest data from Discord endpoints not included in the pre-built templates or apply further customizations to exactly suit your needs.
    • To configure this source manually, follow the instructions in Configure Manually.

Configure Using a Template

Nexla provides pre-built templates that can be used to rapidly configure data sources to ingest data from common Discord endpoints. Each template is designed specifically for the corresponding Discord endpoint, making data source setup easy and efficient.

Endpoint Settings

  • Select the endpoint from which this source will fetch data from the Endpoint pulldown menu. Available endpoint templates are listed in the expandable boxes below. Click on an endpoint to see more information about it and how to configure your data source for this endpoint.

    Get Channel Messages

    Retrieve an array of messages. Requires the VIEW_CHANNEL, READ_MESSAGE_HISTORY, and CONNECT permissions.

    • Optionally, enter the number of messages to fetch in the Fetch how many messages? field. This is the limit value for message pagination. The default value is 1000 if not specified. The maximum number of messages that can be retrieved per request is 100.
    • Optionally, enter a snowflake timestamp in the Fetch messages before and after field. This must be formatted as a snowflake timestamp. When specified, the endpoint will fetch messages before and after this timestamp. You can leave this empty if you don't need to filter by timestamp.
    • Optionally, enter a snowflake timestamp in the Fetch messages before field. This must be formatted as a snowflake timestamp. When specified, the endpoint will fetch messages before this timestamp. You can leave this empty if you don't need to filter by timestamp.
    • Optionally, enter a snowflake timestamp in the Fetch messages after field. This must be formatted as a snowflake timestamp. When specified, the endpoint will fetch messages after this timestamp. You can leave this empty if you don't need to filter by timestamp.
    • The endpoint uses GET requests to https://discord.com/api/v10/channels/{channel_id}/messages where {channel_id} is the channel ID you configured in your credential. The endpoint URL is automatically constructed based on the Discord API base URL and the channel ID from your credential.
    • The endpoint does not use pagination (iteration.type: static.url) and returns a single response. The response data path is $, which extracts the entire response array.

    This endpoint retrieves messages from a Discord channel. The endpoint requires the VIEW_CHANNEL, READ_MESSAGE_HISTORY, and CONNECT permissions for the bot in the Discord server. The channel ID is automatically retrieved from your credential configuration. You can optionally filter messages by timestamp using snowflake timestamps. Snowflake timestamps are Discord's unique identifier format that includes timestamp information. You can use the before, after, or around parameters to filter messages by time. The endpoint supports a maximum of 100 messages per request. For detailed information about snowflake timestamps, message pagination, and the API response format, see the Discord API documentation and Discord Snowflakes documentation.

Configure Manually

Discord data sources can be manually configured to ingest data from any valid Discord API endpoint. Manual configuration provides maximum flexibility for accessing endpoints not covered by pre-built templates or when you need custom API configurations.

With manual configuration, you can also create more complex Discord sources, such as sources that use custom query parameters, different HTTP methods, or custom data transformations.

Content Format

  1. Select the format in which the data from the Discord API will be received from the Content Format pulldown menu. Nexla will automatically parse the data in the selected format. The Discord API typically returns data in JSON format.

API Endpoint URL

  1. Enter the URL of the Discord API endpoint from which this source will fetch data in the Set API URL field. This should be the complete URL including the protocol (https://) and any required path parameters. Discord API endpoints typically follow the pattern https://discord.com/api/v10/{endpoint_path}.

Ensure the API endpoint URL is correct and accessible with your current credentials. You can test the endpoint using the Test button after configuring the URL. The endpoint requires OAuth2 authentication via the Authorization: Bearer {token} header, which is handled automatically by your credential configuration. Discord API requests also require a User-Agent header in the format {bot_name} ({bot_url}, {bot_version}), which is automatically included based on your credential configuration. The bot must have the appropriate permissions in the Discord server to access the endpoint. For detailed information about Discord API endpoints, authentication, and available APIs, see the Discord API documentation.