Skip to content

insodimension/discord

v0.1.3MIT

Discord connector — list servers/channels, read and send messages via a bot token

What this package declares

The file a client reads when it loads this plugin, exactly as this revision carries it.

plugin.json
{
	"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
	"name": "discord",
	"version": "0.1.3",
	"description": "Discord connector — list servers/channels, read and send messages via a bot token",
	"author": {
		"name": "Dimension"
	},
	"license": "MIT",
	"keywords": [
		"discord",
		"chat",
		"bot",
		"messaging",
		"connector"
	],
	"extensions": {
		"ai.insodimension.dimension": {
			"contractVersion": 1,
			"title": "Discord",
			"icon": "assets/icon.svg",
			"category": "connector",
			"defaultEnabled": false,
			"examples": [
				"Post an update to the #announcements channel in my server",
				"Summarize the last 20 messages in the #dev channel",
				"List the Discord servers the bot is in"
			],
			"connect": {
				"kind": [
					"form"
				],
				"setup": [
					{
						"title": "Create an application",
						"detail": "Open the Discord Developer Portal and click \"New Application\". Give it any name, e.g. \"Dimension\".",
						"url": "https://discord.com/developers/applications",
						"urlLabel": "Open Developer Portal"
					},
					{
						"title": "Add a bot and enable Message Content",
						"detail": "In the application, open the Bot tab. Under \"Privileged Gateway Intents\", turn ON the Message Content Intent — without it the bot cannot read message text (discord_read_messages returns empty content)."
					},
					{
						"title": "Copy the bot token",
						"detail": "On the Bot tab, click \"Reset Token\" (the token is only shown once, right after resetting), copy it, and paste it into the form below. Keep it secret — anyone with it controls the bot."
					},
					{
						"title": "Invite the bot to your server",
						"detail": "OAuth2 → URL Generator → check scope `bot` → under Bot Permissions check View Channels, Send Messages, and Read Message History → copy the generated URL, open it, and add the bot to your server.",
						"url": "https://discord.com/developers/applications",
						"urlLabel": "Open Developer Portal"
					}
				],
				"form": [
					{
						"id": "botToken",
						"label": "Bot Token",
						"secret": true,
						"help": "From your application's Bot tab in the Developer Portal (Reset Token if it's hidden). Stored only on this machine.",
						"helpUrl": "https://discord.com/developers/applications",
						"helpUrlLabel": "Open Developer Portal"
					}
				],
				"configTemplate": "connect/token.template.json",
				"configTarget": "~/.config/dimension-discord/token.json",
				"verify": {
					"http": "https://discord.com/api/v10/users/@me",
					"authPrefix": "Bot",
					"failures": [
						{
							"match": "401|Unauthorized|invalid",
							"title": "Reconnect Discord — the bot token is invalid",
							"detail": "Reset the token in the Developer Portal (Bot tab) and paste the new one.",
							"url": "https://discord.com/developers/applications",
							"urlLabel": "Open Developer Portal"
						}
					]
				}
			},
			"toolRenderer": [
				{
					"match": "discord_list_guilds",
					"use": "summary",
					"icon": "discord",
					"title": "Servers"
				},
				{
					"match": "discord_list_channels",
					"use": "summary",
					"icon": "discord",
					"title": "Channels"
				},
				{
					"match": "discord_read_messages",
					"use": "summary",
					"icon": "discord",
					"title": "Messages"
				},
				{
					"match": "discord_send_message",
					"use": "summary",
					"icon": "discord",
					"title": "Send message"
				},
				{
					"match": "discord_create_thread",
					"use": "summary",
					"icon": "discord",
					"title": "Create thread"
				},
				{
					"match": "discord_reply_message",
					"use": "summary",
					"icon": "discord",
					"title": "Reply"
				},
				{
					"match": "discord_add_reaction",
					"use": "summary",
					"icon": "discord",
					"title": "React"
				},
				{
					"match": "discord_edit_message",
					"use": "summary",
					"icon": "discord",
					"title": "Edit message"
				},
				{
					"match": "discord_delete_message",
					"use": "summary",
					"icon": "discord",
					"title": "Delete message"
				},
				{
					"match": "discord_pin_message",
					"use": "summary",
					"icon": "discord",
					"title": "Pin message"
				},
				{
					"match": "discord_create_channel",
					"use": "summary",
					"icon": "discord",
					"title": "Create channel"
				},
				{
					"match": "discord_timeout_member",
					"use": "summary",
					"icon": "discord",
					"title": "Timeout member"
				}
			],
			"skillCard": {
				"skill": "discord",
				"use": "summary",
				"icon": "discord",
				"title": "Discord"
			},
			"tools": [
				{
					"name": "discord_list_guilds",
					"description": "List the Discord servers (guilds) the connected bot is a member of. Returns id and name per line."
				},
				{
					"name": "discord_list_channels",
					"description": "List the channels in a Discord server. Returns id, name, and type per line."
				},
				{
					"name": "discord_read_messages",
					"description": "Read the most recent messages in a Discord channel (newest first). Requires the bot's Message Content intent."
				},
				{
					"name": "discord_send_message",
					"description": "Post a message to a Discord channel. DESTRUCTIVE — confirm the channel and content with the user first."
				},
				{
					"name": "discord_create_thread",
					"description": "Create a thread in a channel (standalone, or spun off from a message when messageId is given). MUTATING — confirm the channel/message and thread name with the user first."
				},
				{
					"name": "discord_reply_message",
					"description": "Reply to a specific message in a channel. DESTRUCTIVE — confirm the channel, target message, and reply content with the user first."
				},
				{
					"name": "discord_add_reaction",
					"description": "Add an emoji reaction to a message as the bot. A public write — mention it to the user. Custom emoji use name:id; standard emoji use the character."
				},
				{
					"name": "discord_edit_message",
					"description": "Edit the content of a message. ONLY works on the bot's own messages. DESTRUCTIVE — confirm the exact message and new content with the user first."
				},
				{
					"name": "discord_delete_message",
					"description": "MODERATION. Permanently delete a message (anyone's, with Manage Messages). IRREVERSIBLE — demand explicit user confirmation of the exact message; never act on vague instructions."
				},
				{
					"name": "discord_pin_message",
					"description": "Pin a message to its channel (or unpin with unpin:true). MUTATING — confirm the exact message with the user first."
				},
				{
					"name": "discord_create_channel",
					"description": "Create a channel in a server (text, voice, or category). MUTATING — confirm the server, name, and kind with the user first."
				},
				{
					"name": "discord_timeout_member",
					"description": "MODERATION. Time out (mute) a member for up to 28 days, or lift a timeout. Needs Moderate Members. Demand explicit user confirmation of the exact member AND duration; never act on vague instructions."
				}
			]
		}
	}
}

Client extensions

Data this package carries for particular clients. The directory lists the clients named and never reads what is addressed to them.

  • ai.insodimension.dimension