ยฉ 2026 Hedgehog Software, LLC
All Guilds are cached if you have the intent, and the client is ready
GuildMembers
Guilds
this.container.client.guilds.cache.filter(x => !x.members.cache.get(message.author.id)).forEach(guild => { selectMenu.addOptions(new StringSelectMenuOptionBuilder() .setLabel(guild.name) .setEmoji({ id: getEmojiIdByName(this.container.client, DefaultEmojis.HELIX_ARROW) }) .setValue(guild.id.toString()) ); });
const guilds = await Promise.all((await this.container.client.guilds.fetch()).map((guild) => guild.fetch())); guilds.forEach(async (guild) => { selectMenu.addOptions( new StringSelectMenuOptionBuilder() .setLabel(guild.name) .setEmoji({ id: getEmojiIdByName(this.container.client, DefaultEmojis.HELIX_ARROW) }) .setValue(guild.id.toString()) ); });