Leo
Leo
DIAdiscord.js - Imagine an app
Created by Leo on 6/24/2023 in #djs-questions
Viewing rate limits
When using @discordjs/core and @discordjs/rest is there any way to see my current limits and how many requests I'm allowed? I know it's handled internally by the library, but I'd like to have that info exposed somewhere
7 replies
DIAdiscord.js - Imagine an app
Created by Leo on 6/24/2023 in #djs-questions
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) node@v18.16.1 @discordjs/core@0.6.0 discord.js@14.11.0
3 replies