nice-wolf-studio/agent-discord-skills/discord-get-messages
Claude Code and agent skill by nice-wolf-studio/agent-discord-skills
- community
Checking that the SKILL.md file is still in the repository.
Retrieve messages from Discord channels via the Discord API. Use this skill when the user wants to read, search, or analyze messages from a Discord channel.
Install
npx vskill@latest install nice-wolf-studio/agent-discord-skills/discord-get-messagesSKILL.md
The same SKILL.md was published earlier as majiayu000/claude-skill-registry/discord-get-messages.
Discord Get Messages
Retrieve messages from Discord channels using the Discord API v10. This skill supports pagination, filtering by message count, and retrieving message history.
When to Use This Skill
Use this skill when the user wants to:
- Read recent messages from a Discord channel
- Get message history for analysis
- Search for specific messages in a channel
- Retrieve messages before or after a specific message ID
- Export channel conversation history
Prerequisites
DISCORD_BOT_TOKENenvironment variable must be set- Bot must be a member of the target server
- Bot must have "Read Message History" permission in the target channel
- Valid Discord channel ID (18-19 digit snowflake ID)
Instructions
When the user requests to retrieve Discord messages:
- Validate Requirements
- Confirm
DISCORD_BOT_TOKENis set in environment - Verify channel ID is provided (18-19 digit number)
- Validate limit parameter (1-100 messages)
- Prepare Query Parameters
limit: Number of messages to retrieve (default: 50, max: 100)before: Get messages before this message ID (for pagination)after: Get messages after this message IDaround: Get messages around this message ID
- Make the API Request
Use the following curl command structure:
``bash curl -X GET "https://discord.com/api/v10/channels/{CHANNEL_ID}/messages?limit=50" \ -H "Authorization: Bot ${DISCORD_BOT_TOKEN}" ``
Replace:
{CHANNEL_ID}with the actual channel IDlimit=50with desired message count (1-100)
- Process Response
- Messages are returned in reverse chronological order (newest first)
- Each message contains: id, content, author, timestamp, attachments, embeds
- Filter or format messages as requested by user
- Handle Response Codes
- 200 Success: Messages retrieved successfully
- 401 Unauthorized: Invalid bot token
- 403 Forbidden: Missing "Read Message History" permission
- 404 Not Found: Channel doesn't exist or bot can't see it
- Present Results
- Format messages in a readable way
- Show author, timestamp, and content
- Include attachment URLs if present
- Summarize if many messages retrieved
Query Parameters
Limit
Before (Pagination)
After
Around
Message Object Structure
Each message returned contains:
Formatting Output
Simple Format
Detailed Format
Filtering and Processing
Filter by Author
After retrieving messages, filter by author ID or username:
Filter by Content
Search for specific keywords in message content:
Get Only Text Messages
Exclude system messages and embeds:
Pagination Strategy
To retrieve more than 100 messages:
- Get first batch:
?limit=100 - Get oldest message ID from response
- Get next batch:
?before={oldest_id}&limit=100 - Repeat until all messages retrieved or desired count reached
Example:
Error Handling
Common Errors
401 Unauthorized
- Check that
DISCORD_BOT_TOKENis set correctly - Verify token hasn't expired
403 Forbidden
- Bot needs "Read Message History" permission
- Bot needs "View Channel" permission
- Check channel permission overrides
404 Not Found
- Channel ID is incorrect
- Channel was deleted
- Bot doesn't have access to channel
400 Bad Request
- Invalid limit parameter (must be 1-100)
- Invalid message ID format for before/after/around
Rate Limiting
- Discord allows 5 requests per 5 seconds per channel
- Implement delays between requests when paginating
- Wait 1 second between pagination requests
Security Notes
- Never expose the bot token in messages or logs
- Respect user privacy when handling message content
- Don't store messages longer than necessary
- Follow Discord's Terms of Service regarding data retention
Performance Tips
- Use
limitparameter to reduce response size - Retrieve only the messages you need
- Cache results if querying the same channel multiple times
- Use pagination for large history retrieval
Examples
See examples.md for detailed usage scenarios.
API Reference
- Endpoint:
GET /channels/{channel.id}/messages - Discord API Version: v10
- Documentation: https://discord.com/developers/docs/resources/channel#get-channel-messages
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/discord-get-messages/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/nice-wolf-studio/agent-discord-skills/discord-get-messages)