#guild.iconURL() returning null

13 messages · Page 1 of 1 (latest)

young osprey
#

Hello~
I am trying to the url to the guild icon from an interaction but am getting null, the server being tested on has an icon. Are there some options I have to pass to the iconURL() method?

console.log(interaction.guild.iconURL()) // Returns null

[email protected]

stoic sluiceBOT
#

• What's your exact discord.js npm list discord.js and node node -v version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.

torpid berry
#

No you don't have to pass options

young osprey
#

Hmm, I wonder why it's returning null

#

Does the bot require extra permissions when trying to view the server icon?

torpid berry
#

no

#

is the guild cached

#

as in, did you invite the bot with the bot scope and have Guilds intent

young osprey
#

Pretty sure I did, let me check that

#

So I do have the bot scope and passing in the Guilds intent like this:
const client = new Client({ intents: [GatewayIntentBits.Guilds] });

#

I am able to view guild roles

#

Ah, nvm I was being silly

#

The test server didn't have an icon, I was confusing it with another one.