Obtaining Guild Name Doesn't Seem To Work v13.4.

Hi, I have returned to a year old bot and it seems that a function about getting and listing all guilds isn't detecting any guilds attached. When checked about length it is equal to 0.
The function in question:
module.exports = async (message) => {
    
    let guilds = await message.client.guilds.cache.values();
    let guildNames = ''
    for (let i = 0; i < guilds.length; i++) {
        guildNames = guilds[i].name + "\n"
    }
    console.log(guildNames)
    return
}
Was this page helpful?