Discord Integrations

Create Discord Integration

Create Discord integration

post
/v1/integration/discord/create

Authorization

ChatBotKit API Secret * Required

HTTP Authorization Scheme: bearer

Request Body * Required

Request Body Schema: application/json

aliasstring

The unique alias for the instance

namestring

The associated name

descriptionstring

The associated description

metaobject

Meta data information

blueprintIdstring

The ID of the blueprint

botIdstring

The ID of the bot this configuration is using

appIdstring

The Discord application ID

botTokenstring

The Discord bot token

publicKeystring

The Discord public key

handlestring

The Discord command handle

contactCollectionboolean

Weather to collect contacts

sessionDurationnumber

The chat session duration

autoRespondstring

When the bot replies to messages that are not addressed to it. Direct messages and mentions of the bot always get a reply. Leave empty to reply only when addressed (the bot keeps replying in conversations it is already part of), use '@all' to reply to every message, '@auto' to let the bot decide from its name, description and backstory, or write instructions describing which messages to reply to ('@agent <instructions>' is accepted and treated the same). Stored for consistency with other integrations; this integration does not apply it yet and answers every message it receives as before.

allowFromstring

Restrict which Discord users can interact with this integration. Accepts Discord user IDs (17-18 digit snowflakes) or @username, one per line. Use * to allow all senders. Leave empty to deny all.

import { ChatBotKit } from '@chatbotkit/sdk'

const cbk = new ChatBotKit({

token: process.env.CHATBOTKIT_API_TOKEN!

})

const response = await cbk.integration.discord.create(

{
"alias":"string",
"name":"string",
"description":"string",
"meta":"object",
"blueprintId":"string",
"botId":"string",
"appId":"string",
"botToken":"string",
"publicKey":"string",
"handle":"string",
"contactCollection":"boolean",
"sessionDuration":"number",
"autoRespond":"string",
"allowFrom":"string"
}
)
{
"id":"string"
}
The Discord integration was created successfully