messages fetch doesnt show up older messages

Hello!
I run into a problem with my code:
async function fetchAllMessages(input, interactionUser) {
    const channel = client.channels.cache.get(input);
    let messages = [];
    let amountPayout = 0

    // Create message pointer
    let message = await channel.messages
        .fetch({ limit: 1 })
        .then(messagePage => (messagePage.size === 1 ? messagePage.at(0) : null));

    while (message) {
        await channel.messages
            .fetch({ limit: 100, before: message.id })
            .then(messagePage => {
                messagePage.forEach(msg => {
                    if (msg.embeds[0] && msg.embeds[0].title != 'Krautz - Familienkasse') {
                        let receivedEmbed = msg.embeds[0]
                        const descr = receivedEmbed.description.split(" ");
                        let id = descr[2].replace("<@", "").replace(">", "")
                        const user = client.users.cache.get(id)
                        for (let field of receivedEmbed.fields) {
                            if (field.name == ":moneybag: Auszahlung" && user == interactionUser) {
                                let int = parseInt(field.value.replace("$ ", ""))
                                amountPayout = amountPayout + int
                                console.log("+ " + int + " Fisch: " + amountPayout)

                                msg.delete()
                            }
                        }
                    }
                    //messages.push(msg)
                });

                // Update our message pointer to be last message in page of messages
                message = 0 < messagePage.size ? messagePage.at(messagePage.size - 1) : null;
            })
    }
    return amountPayout
}
Its working good, but when there are older messages with embeds they don't add them why?
Was this page helpful?