ProphecyOak
ProphecyOak
DIAdiscord.js - Imagine a boo! 👻
Created by ProphecyOak on 4/12/2024 in #djs-questions
How to access older posts in a forum channel?
Here is my current code:
async function countNewGallery(client) {
const galleryForum = (await (await client.guilds.fetch(guildID)).channels.fetch(galleryChannelID));
const options = { "limit":100, "cache":true};
const threads = (await galleryForum.threads.fetch(options)).threads;
console.log(threads.size);
}
async function countNewGallery(client) {
const galleryForum = (await (await client.guilds.fetch(guildID)).channels.fetch(galleryChannelID));
const options = { "limit":100, "cache":true};
const threads = (await galleryForum.threads.fetch(options)).threads;
console.log(threads.size);
}
For whatever reason, it is only grabbing the last 42 forum posts, but I want to go beyond the "older posts" point.
6 replies
DIAdiscord.js - Imagine a boo! 👻
Created by ProphecyOak on 4/11/2024 in #djs-questions
Way to listen for MessageReactionRemove when the messages aren't cached
I am trying to detect when reactions are removed from a post in a forum channel. The relevant code looks like this:
client.on(Events.MessageReactionRemove, async (reaction, user) => {
console.log("Event: Reaction Removed");
if (reaction.emoji.name === '🍉') {
await eventHandler.reactionRemoved(reaction, user, client);
}
});
client.on(Events.MessageReactionRemove, async (reaction, user) => {
console.log("Event: Reaction Removed");
if (reaction.emoji.name === '🍉') {
await eventHandler.reactionRemoved(reaction, user, client);
}
});
However, if I react with the 🍉 and then boot the bot up, and then remove it, it doesn't detect it. On the other hand, if I add the reaction while the bot is already up and then remove it, it does detect it.
23 replies