Fed up in scrolling messages. Don't worry we are here to your rescue. Just go to omg.ac/command and make a command named firstmsg and then you can get the First message for any channel
// authenticates you with the API standard library
// type `await lib.` to display API autocomplete
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
// now we will reguster the initial slash command response
await lib.discord.interactions['@1.0.1'].responses.create({
token: `${context.params.event.token}`,
response_type: 'DEFERRED_CHANNEL_MESSAGE_WITH_SOURCE',
});
// now we'll get the first msg of the channel
let a = await lib.discord.channels['@0.3.2'].messages.list({
channel_id: `${context.params.event.channel_id}`,
after: `1`,
limit: 1,
});
// we set the limit as 1 to get only 1 msg from start of the channel
// now send a link to the first message
await lib.discord.channels['@0.3.0'].messages.create({
token: `${context.params.event.token}`,
channel_id: `${context.params.event.channel_id}`,
content: `Click below `,
tts: false,
components: [
{
type: 1,
components: [
{
style: 5,
label: `Go to First message`,
url: `https://discord.com/channels/${context.params.event.guild_id}/${context.params.event.channel_id}/${a[0].id}`,
disabled: false,
type: 2,
},
],
},
],
});