en un clic
discord-get-messages
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.
Menu
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.
Create new channels in Discord guilds/servers via the Discord API. Use this skill when the user wants to create text channels, voice channels, announcement channels, or categories in a Discord server.
List all channels in a Discord guild/server via the Discord API. Use this skill when the user wants to see all channels, find specific channels, or audit server structure.
Manage and update Discord channels via the Discord API. Use this skill when the user wants to modify channel properties, update names/topics, change permissions, or delete channels.
Send messages to Discord channels via the Discord API. Use this skill when the user wants to send text messages, notifications, or formatted content to a Discord channel.
| name | discord-get-messages |
| description | 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. |
Retrieve messages from Discord channels using the Discord API v10. This skill supports pagination, filtering by message count, and retrieving message history.
Use this skill when the user wants to:
DISCORD_BOT_TOKEN environment variable must be setWhen the user requests to retrieve Discord messages:
Validate Requirements
DISCORD_BOT_TOKEN is set in environmentPrepare 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 IDMake 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=50 with desired message count (1-100)Process Response
Handle Response Codes
Present Results
?limit=10 # Get 10 most recent messages (default: 50, max: 100)
?before=1234567890123456789&limit=50 # Get 50 messages before this message ID
?after=1234567890123456789&limit=50 # Get 50 messages after this message ID
?around=1234567890123456789&limit=50 # Get 50 messages around this message ID
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
}
[2025-10-20 12:00] Username: Message content here
[2025-10-20 11:55] OtherUser: Another message
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/...)
After retrieving messages, filter by author ID or username:
# Get messages then filter in output
curl ... | jq '.[] | select(.author.username == "TargetUser")'
Search for specific keywords in message content:
# Get messages then search content
curl ... | jq '.[] | select(.content | contains("keyword"))'
Exclude system messages and embeds:
# Filter message type 0 (default text messages)
curl ... | jq '.[] | select(.type == 0)'
To retrieve more than 100 messages:
?limit=100?before={oldest_id}&limit=100Example:
# 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}"
401 Unauthorized
DISCORD_BOT_TOKEN is set correctly403 Forbidden
404 Not Found
400 Bad Request
limit parameter to reduce response sizeSee examples.md for detailed usage scenarios.
GET /channels/{channel.id}/messages