Skip to content
Entity Info guildIcon

$guildIcon[] — Server Icon (Alias)

$guildIcon[] is an alias of $serverIcon[]. It returns the URL of the Discord server icon.

Syntax

$guildIcon[(guildID)]

Parameters

Parameter Description
guildID (Optional) The ID of a server. When omitted or empty, the current server is used. A non-empty value that is not a positive integer raises Invalid guild ID.

Return Value

  • Type : string
  • The URL of the icon (https://cdn.discordapp.com/icons/<guildID>/<hash>.png, or .gif when the icon hash starts with a_, i.e. animated), or an empty string.
  • If the server cannot be fetched, the value of the guild.icon context variable supplied by the host is returned, or an empty string if there is none.

Examples

Embed with icon

$title[$guildName]
$thumbnail[$guildIcon]
$description[$serverDescription]
$color[#5865F2]
$footer[$guildName;$guildIcon]
$description[Official message]
$color[#2ECC71]

Icon check

$if[$guildIcon==]
$sendMessage[⚠️ This server does not have a custom icon.]
$else
$sendMessage[✅ Server icon: $guildIcon]
$endif

Notes

  • $serverIcon is not strictly identical: it takes no argument and raises Guild not found. when the server cannot be fetched.
  • Returns an empty string if the server has no icon.

Try it

Paste an example into the playground to preview its message (functions that act on Discord are not run), or build the same thing with blocks.