f1fty
f1fty
Explore posts from servers
DIAdiscord.js - Imagine an app
Created by f1fty on 4/17/2024 in #djs-questions
Fetch messages after a message with including initialMessage
let messages = await dmChannel.messages.fetch();
const initialMessage = messages.find(
(x) =>
x.components[0] &&
x.components[0].components &&
x.components[0].components.find(
(x) => x.type === ComponentType.StringSelect,
),
);

messages = new Collection([
[initialMessage.id, initialMessage],
...(await dmChannel.messages.fetch({ after: initialMessage.id })).reverse(),
]);
let messages = await dmChannel.messages.fetch();
const initialMessage = messages.find(
(x) =>
x.components[0] &&
x.components[0].components &&
x.components[0].components.find(
(x) => x.type === ComponentType.StringSelect,
),
);

messages = new Collection([
[initialMessage.id, initialMessage],
...(await dmChannel.messages.fetch({ after: initialMessage.id })).reverse(),
]);
I dont know if i can convert the collection to array. slice them and convert them back. this is the current way, but i think its not the best, because of duplicated fetch# maybe. someone heas
9 replies
DIAdiscord.js - Imagine an app
Created by f1fty on 4/9/2024 in #djs-questions
Switch users screen view to current created channel on guild.
Hello, can i change thhe users screen/view to a created channel on ModalSubmitInteraction.
3 replies