Home/Tools/@tpmjs/discord-read

discordReadTool

@tpmjs/discord-read

Read messages from a Discord server for the past N hours. Fetches all text channels and their messages, filtering by time and optionally excluding bot messages.

Official
communication
v0.2.0
MIT

Interactive Playground

Test @tpmjs/discord-read (discordReadTool) with AI-powered execution

0/2000 characters

Installation & Usage

Install this tool and use it with the AI SDK

1. Install the package

npm install @tpmjs/discord-read
pnpm add @tpmjs/discord-read
yarn add @tpmjs/discord-read
bun add @tpmjs/discord-read
deno add npm:@tpmjs/discord-read

2. Import the tool

import { discordReadTool } from '@tpmjs/discord-read';

3. Use with AI SDK

import { generateText } from 'ai';
import { openai } from '@ai-sdk/openai';
import { discordReadTool } from '@tpmjs/discord-read';

const result = await generateText({
  model: openai('gpt-4o'),
  tools: { discordReadTool },
  prompt: 'Your prompt here...',
});

console.log(result.text);

Parameters

Available configuration options

Auto-extracted
guildId
Required
Type: string

Discord server (guild) ID

hours
Optional
Type: number

Number of hours to look back (default: 24)

excludeChannels
Optional
Type: array

Channel IDs to exclude from reading

excludeBots
Optional
Type: boolean

Whether to exclude bot messages (default: true)

Schema extracted: 1/15/2026, 3:45:44 AM

README

ERROR: No README data found!

Statistics

Downloads/month

0

Quality Score

0%

Bundle Size

NPM Keywords

tpmjs
discord
ai
communication

Maintainers

thomasdavis(thomasalwyndavis@gmail.com)

Frameworks

vercel-ai