Get first message in thread with @discordjs/core

I'm able to get the last 50 messages in a thread with:
import { REST } from "@discordjs/rest";
import { ChannelsAPI } from "@discordjs/core";

const rest = new REST({ version: "10" }).setToken(
token
);
const channelsAPI = new ChannelsAPI(rest);

const messages = await channelsAPI.getMessages(<threadId>);
import { REST } from "@discordjs/rest";
import { ChannelsAPI } from "@discordjs/core";

const rest = new REST({ version: "10" }).setToken(
token
);
const channelsAPI = new ChannelsAPI(rest);

const messages = await channelsAPI.getMessages(<threadId>);
Is there a way I could either: - Get the first message posted in that thread - invert the order the messages are coming back? (oldest first instead of newest first) [email protected] @discordjs/[email protected] [email protected]
2 Replies
d.js toolkit
d.js toolkit2y ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
Leo
LeoOP2y ago
Had no idea, thank you!
Want results from more Discord servers?
Add your server