discord-get-messages
Skill16 starsChanged 14 months agoMITView on GitHub
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.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- EvolutionAPI/evo-nexusword for word, first seen Oct 8, 2026
- evolution-foundation/evo-nexusword for word, first seen Apr 20, 2026
Other versions2 projects use a version of this.
Word for word · 2
- EvolutionAPI/evo-nexus★ 545100% same
- evolution-foundation/evo-nexus★ 535100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository4 other files it gives its agents.
The file
Show its rules and text
We split this skill into the rules it gives an agent
17 rules. About 0 are common, 15 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈15
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Use this skill when the user wants to:
- Distinctive: line 13
Read recent messages from a Discord channel
- Distinctive: line 15
Search for specific messages in a channel
- Distinctive: line 28
When the user requests to retrieve Discord messages:
- Distinctive: line 32
Verify channel ID is provided (18-19 digit number)
- Distinctive: line 42
Use the following curl command structure:
- Distinctive: line 140
After retrieving messages, filter by author ID or username:
- Distinctive: line 147
Search for specific keywords in message content:
- Very specific: line 187
Check that DISCORD_BOT_TOKEN is set correctly
- Distinctive: line 188
Verify token hasn't expired
- Distinctive: line 193
Check channel permission overrides
- Distinctive: line 208
Wait 1 second between pagination requests
- Distinctive: line 212
Never expose the bot token in messages or logs
- Distinctive: line 214
Don't store messages longer than necessary
- Distinctive: line 215
Follow Discord's Terms of Service regarding data retention
- Very specific: line 219
Use limit parameter to reduce response size
- Distinctive: line 222
Use pagination for large history retrieval
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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)
- Confirm
- 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:
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
?limit=10 # Get 10 most recent messages (default: 50, max: 100)Before (Pagination)
?before=1234567890123456789&limit=50 # Get 50 messages before this message IDAfter
?after=1234567890123456789&limit=50 # Get 50 messages after this message IDAround
?around=1234567890123456789&limit=50 # Get 50 messages around this message IDMessage Object Structure
Each message returned contains:
{
"id": "1234567890123456789",
"channel_id": "123456789012345678",
"author": {
"id": "987654321098765432",
"username": "Username",
"discriminator": "0000",
"avatar": "avatar_hash"
},
"content": "Message text content",
"timestamp": "2025-10-20T12:00:00.000000+00:00",
"edited_timestamp": null,
"tts": false,
"mention_everyone": false,
"mentions": [],
"mention_roles": [],
"attachments": [],
"embeds": [],
"reactions": [],
"pinned": false,
"type": 0
}Formatting Output
Simple Format
[2025-10-20 12:00] Username: Message content here
[2025-10-20 11:55] OtherUser: Another messageDetailed Format
Message ID: 1234567890123456789
Author: Username#0000 (987654321098765432)
Timestamp: 2025-10-20T12:00:00.000000+00:00
Content: Message text content here
Attachments: image.png (https://cdn.discordapp.com/...)Filtering and Processing
Filter by Author
After retrieving messages, filter by author ID or username:
# Get messages then filter in output
curl ... | jq '.[] | select(.author.username == "TargetUser")'Filter by Content
Search for specific keywords in message content:
# Get messages then search content
curl ... | jq '.[] | select(.content | contains("keyword"))'Get Only Text Messages
Exclude system messages and embeds:
# Filter message type 0 (default text messages)
curl ... | jq '.[] | select(.type == 0)'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:
# First batch
curl "https://discord.com/api/v10/channels/{CHANNEL_ID}/messages?limit=100" \
-H "Authorization: Bot ${DISCORD_BOT_TOKEN}"
# Get oldest message ID from response (e.g., 1234567890123456789)
# Next batch
curl "https://discord.com/api/v10/channels/{CHANNEL_ID}/messages?before=1234567890123456789&limit=100" \
-H "Authorization: Bot ${DISCORD_BOT_TOKEN}"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
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

