/messages

Retrieves information of a given message OR maps messages of a channel

This endpoint supports the Exclude header

Endpoint Headers:

  • bot-token - Token of the Bot [String] (Required)

  • chan-id - ID of the channel to be fetched [Snowflake] (Required)

  • msg-id - ID of the message to be fetched [Snowflake] (Optional)

  • apikey - Your Api Auth Key [String] (Required)

  • limit - Number of messages to fetch if no msg-id is provided [Integer 1-100] (Optional)

Examples:

Data API version required. Must replace <version> with either release or beta.

Bot Designer for Discord

Example usage of /messages endpoint using BDFD

$httpAddHeader[apikey;<YOUR-API-KEY>]
$httpAddHeader[bot-token;<YOUR-BOT-TOKEN>]
$httpAddHeader[chan-id;433453456646243565]
$httpAddHeader[msg-id;1064098700307218463] $c[Optional header]
$httpGet[https://bdfddata.rickyjs.xyz/<version>/messages]


$httpResult OR $httpResult[details]
Discord.js

Example usage of /messages endpoint using Discord.js

const axios = require('axios');
(async () => {
return await axios.get('https://bdfddata.rickyjs.xyz/<version>/messages', {
headers: {
"apikey": "<YOUR-API-KEY>",
"bot-token": "<YOUR-BOT-TOKEN>",
"chan-id": "9687459278405623556",
"msg-id": "64563453457782237788"  // Optional header
}
}).then(res=>res.data)
})()

Possible Responses (Codes)

Code 200

API succeeded and details were fetched.

{
 status: 200,
  details: {
    id: '1047848807775358976',
    type: 'Default',
    content: 'lol gn bro',
    channel_id: '1024040173345984562',
    ...
    ...
    ...
  >  'Read on `Message Objects` : https://discord.com/developers/docs/resources/channel#message-object'
}  
Code 400

An error occurred that stopped execution.

{
    status: 400
    error: 'Cannot read ...  (This can vary)'
}
Code 401

Invalid bot token was provided.

{
  status: 401,
  details: { message: '401: Unauthorized', code: 0 }
}

Last updated