Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,117 changes: 1,116 additions & 1 deletion public/data/agent-tools-index.json

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions src/components/templates/agent-connectors/_setup-discord.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,20 @@ Register your Scalekit environment with the Discord connector so Scalekit handle
<Aside type="tip" title="Request only the scopes you need">
Discord displays a consent screen listing every requested scope. Requesting unnecessary scopes reduces user trust and may cause authorization to be denied.
</Aside>

5. ### Configure the bot scope (optional)

If your agent needs to act as a bot in a server — sending messages, managing channels, or reacting to events — include the `bot` scope when you request authorization. Discord then asks the installing user to also grant a set of **bot permissions**.

- In the Scalekit connection settings, set:
- **Bot Permissions** — a bitfield describing what your bot can do in the server. Use the [permissions calculator](https://discord.com/developers/applications) on your application's **Bot** page to generate this value, or use the recommended default `2260657982483703` for common read/write access.
Comment thread
Pranesh-Raghu marked this conversation as resolved.
- **Pre-selected Guild ID** — optional. Pre-fills Discord's server picker with a specific server ID during authorization.
- **Disable Guild Select** — optional. When enabled with a **Pre-selected Guild ID**, the user cannot pick a different server.
- **Installation Context** — optional. Controls whether `applications.commands` installs to a server or to the authorizing user's account.

![Discord Bot Permissions page showing General, Text, and Voice permission checkboxes](@/assets/docs/agent-connectors/discord/bot-permissions.png)

<Aside type="note" title="Leave Bot Permissions blank carefully">
An empty **Bot Permissions** value grants the bot zero permissions in Scalekit's authorization request — it does not fall back to whatever defaults you configured in the Discord Developer Portal. Set an explicit value if your bot needs any permissions at all.
</Aside>
</Steps>
70 changes: 70 additions & 0 deletions src/components/templates/agent-connectors/_setup-discordbot.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import { Steps, Aside, Tabs, TabItem } from '@astrojs/starlight/components'

Register your Discord bot token with Scalekit so it can authenticate and proxy requests on behalf of your users. Discord Bot uses Bearer Token authentication — there is no redirect URI or OAuth flow.

<Steps>
1. ### Create a Discord application and bot user

- Go to the [Discord Developer Portal](https://discord.com/developers/applications) and sign in with your Discord account.
- Click **New Application**, enter a name (for example, `Agent Auth`), accept the terms, and click **Create**.
- Open your application and go to **Bot** in the left sidebar.

2. ### Get your bot token

- On the **Bot** page, under **Token**, click **Reset Token** to generate a new bot token and copy it immediately — Discord shows the full token only once.

![Discord application Bot page showing the Username, Token, and Authorization Flow settings](@/assets/docs/agent-connectors/discordbot/bot-tab.png)

<Aside type="caution" title="Keep your bot token secret">
Anyone with your bot token can control your bot completely. If you suspect it has leaked, click **Reset Token** immediately to invalidate the old one.
</Aside>

3. ### Invite the bot to a server

- Go to **OAuth2** > **URL Generator** in the left sidebar.
- Under **Scopes**, select **bot**.
- Under **Bot Permissions**, select the permissions your agent needs.

![Discord Bot Permissions page showing General, Text, and Voice permission checkboxes](@/assets/docs/agent-connectors/discord/bot-permissions.png)

- Copy the generated URL at the bottom of the page, open it in a browser, and select a server to add the bot to.

4. ### Create a connection in Scalekit

- In the [Scalekit dashboard](https://app.scalekit.com), go to **AgentKit** → **Connections** → **Create Connection**.
- Search for **Discord Bot** and click **Create**.
- Note the **Connection name** — use this as `connection_name` in your code (e.g., `discordbot`).

5. ### Add a connected account

Connected accounts link a specific user identifier in your system to a Discord bot token. Add them via the dashboard for testing, or via the Scalekit API in production.

**Via dashboard (for testing)**

- Open the connection and click the **Connected Accounts** tab → **Add account**.
- Fill in **Your User's ID** and **Bot Token**, then click **Save**.

**Via API (for production)**

<Tabs syncKey="tech-stack">
<TabItem label="Node.js">
```ts
await scalekit.connect.upsertConnectedAccount({
connectionName: 'discordbot',
identifier: 'user@example.com',
credentials: { apiKey: 'your-discord-bot-token' },
})
```
</TabItem>
<TabItem label="Python">
```python
scalekit_client.connect.upsert_connected_account(
connection_name="discordbot",
identifier="user@example.com",
credentials={"api_key": "your-discord-bot-token"},
)
```
</TabItem>
</Tabs>

</Steps>
1 change: 1 addition & 0 deletions src/components/templates/agent-connectors/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export { default as SetupDevinmcpSection } from './_setup-devinmcp.mdx'
export { default as SetupDevrevmcpSection } from './_setup-devrevmcp.mdx'
export { default as SetupDiarizeSection } from './_setup-diarize.mdx'
export { default as SetupDiscordSection } from './_setup-discord.mdx'
export { default as SetupDiscordbotSection } from './_setup-discordbot.mdx'
export { default as SetupDropboxSection } from './_setup-dropbox.mdx'
export { default as SetupDropboxmcpSection } from './_setup-dropboxmcp.mdx'
export { default as SetupExaSection } from './_setup-exa.mdx'
Expand Down
10 changes: 6 additions & 4 deletions src/content/docs/agentkit/connectors/discord.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,12 @@ import { SectionAfterSetupDiscordCommonWorkflows } from '@components/templates'

Connect this agent connector to let your agent:

- **Get guild widget png, current user application entitlements, guild widget** — Retrieves a PNG image widget for a Discord guild
- **List my guilds, sticker packs** — Lists the current user's guilds, returning partial data (id, name, icon, owner, permissions, features) for each
- **Invite resolve** — Resolves and retrieves information about a Discord invite code, including the associated guild, channel, event, and inviter
- **Connections retrieve user** — Retrieves a list of the authenticated user's connected third-party accounts on Discord, such as Twitch, YouTube, GitHub, Steam, and others
- **Entitlement consume** — For one-time purchase consumable SKUs, mark a given entitlement for the user as consumed
- **Create lobby channel invite for self, or join lobby** — Create a single-use guild invite to a lobby's linked channel, targeted at the calling user
- **Delete current user application role connection, test entitlement** — Deletes the application role connection for the current user and the given application
- **Permissions edit application command** — Edit the permissions for a specific application command in a guild
- **Get application command permissions, current user application entitlements, current user application role connection** — Fetch permissions for a specific application command in a guild
- **Lobby leave, link channel to** — Remove the calling user from the specified Discord lobby

## Common workflows

Expand Down
84 changes: 84 additions & 0 deletions src/content/docs/agentkit/connectors/discordbot.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
---
title: 'Discord Bot connector'
tableOfContents: true
description: 'Connect to Discord as a bot. Manage guilds, channels, members, messages, roles, webhooks, and more using a Discord Bot Token.'
sidebar:
label: 'Discord Bot'
overviewTitle: 'Quickstart'
connectorIcon: https://cdn.scalekit.com/sk-connect/assets/provider-icons/discord.svg
connectorAuthType: API Key
connectorCategories: [Communication, Collaboration]
head:
- tag: style
content: |
.sl-markdown-content h2 {
font-size: var(--sl-text-xl);
}
.sl-markdown-content h3 {
font-size: var(--sl-text-lg);
}
---

import ToolList from '@/components/ToolList.astro'
import { tools } from '@/data/agent-connectors/discordbot'
import { Steps, Tabs, TabItem } from '@astrojs/starlight/components'
import { AgentKitCredentials } from '@components/templates'
import { SetupDiscordbotSection } from '@components/templates'
import { QuickstartGenericApikeySection } from '@components/templates'

<Steps>

1. ### Install the SDK

<Tabs syncKey="tech-stack">
<TabItem label="Node.js">
```bash frame="terminal"
npm install @scalekit-sdk/node
```
</TabItem>
<TabItem label="Python">
```bash frame="terminal"
pip install scalekit
```
</TabItem>
</Tabs>

Full SDK reference: [Node.js](/agentkit/sdks/node/) | [Python](/agentkit/sdks/python/)

2. ### Set your credentials

<AgentKitCredentials />

3. ### Set up the connector

Register your Discord Bot credentials with Scalekit so it can authenticate requests on your behalf. You do this once per environment.

<details>
<summary>Dashboard setup steps</summary>

<SetupDiscordbotSection />

</details>

4. ### Make your first call

<QuickstartGenericApikeySection connector="discordbot" toolName="discordbot_get_current_application" providerName="Discord Bot" />

</Steps>

## What you can do

Connect this agent connector to let your agent:

- **Member add guild, add lobby, add thread** — Add a user to a guild using their OAuth2 access token with the guilds.join scope
- **Role add guild member, modify guild, remove guild member** — Add a role to a guild member
- **Prune begin guild** — Begin a prune operation to kick inactive members
- **Delete bulk, all reactions, all reactions for emoji** — Delete multiple messages in a Discord channel in a single request (2-100 messages)
- **Ban bulk guild, remove guild** — Ban up to 200 users from a guild and optionally delete their recent messages
- **Commands bulk overwrite global application, bulk overwrite guild application** — Bulk overwrite all global application commands

## Tool list

Use the exact tool names from the **Tool list** below when you call `execute_tool`. If you're not sure which name to use, list the tools available for the current user first.

<ToolList tools={tools} />
5 changes: 5 additions & 0 deletions src/data/agent-connectors/catalog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1635,4 +1635,9 @@ export const catalog: Record<string, ProviderMeta> = {
authType: 'OAuth 2.1/DCR',
categories: ['AI'],
},
discordbot: {
iconUrl: 'https://cdn.scalekit.com/sk-connect/assets/provider-icons/discord.svg',
authType: 'API Key',
categories: ['Communication', 'Collaboration'],
},
}
Loading