Add @tpmjs/tools-slack (10 tools) and @tpmjs/tools-discord (15 tools) with full API coverage, typed outputs, and domain-validated blocks. Add 7 missing business categories (finance, legal, hr, marketing, cx, edu, sales) to TPMJS_CATEGORIES so 50 previously skipped packages can sync to tpmjs.com. Fix lefthook secrets hook to skip gracefully when git-secrets is not installed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| src | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
| tsup.config.ts | ||
@tpmjs/tools-discord
Discord API tools for AI agents. Send messages, manage guilds, channels, threads, members, reactions, and more.
Installation
npm install @tpmjs/tools-discord
Setup
Set the DISCORD_BOT_TOKEN environment variable. Get your token from Discord Developer Portal.
Required bot permissions: Send Messages, Read Message History, Manage Messages, Manage Channels, Add Reactions, Manage Threads.
Usage
import { sendMessage, listGuilds } from '@tpmjs/tools-discord';
const result = await sendMessage.execute({ channel_id: '123456789', content: 'Hello from AI!' });
const guilds = await listGuilds.execute({});
Tools
| Tool | Description |
|---|---|
| sendMessage | Send a message to a channel |
| listGuilds | List guilds the bot is in |
| getGuild | Get guild details |
| listChannels | List guild channels |
| getChannel | Get channel details |
| listMessages | Get recent messages from a channel |
| createChannel | Create a text/voice/category channel |
| editMessage | Edit a previously sent message |
| deleteMessage | Delete a message |
| addReaction | Add emoji reaction to a message |
| listMembers | List guild members |
| getMember | Get member details |
| createThread | Create a thread from a message |
| listThreads | List active threads |
| pinMessage | Pin a message |
License
MIT