Skip to main content
Build an Avatar content value.
  • avatar("clear") — remove the current chat avatar.
  • avatar("./icon.png") — set avatar from a filesystem path. MIME type is inferred from the extension; override with options.mimeType.
  • avatar(new URL("https://…/icon.png")) — fetch the avatar lazily over the network. Bytes stay in memory (safe in read-only environments). MIME type is inferred from the URL pathname extension; override with options.mimeType when the URL has no usable extension.
  • avatar(buffer, { mimeType }) — set avatar from in-memory bytes. options.mimeType is required (enforced at the type level).
"clear" is a reserved string-literal sentinel. If you have a file literally named clear with no extension, pass "./clear" or load it as a Buffer.

Parameters

string | URL
required
{ mimeType: string }

Returns

ContentBuilder
Build an Avatar content value.
  • avatar("clear") — remove the current chat avatar.
  • avatar("./icon.png") — set avatar from a filesystem path. MIME type is inferred from the extension; override with options.mimeType.
  • avatar(new URL("https://…/icon.png")) — fetch the avatar lazily over the network. Bytes stay in memory (safe in read-only environments). MIME type is inferred from the URL pathname extension; override with options.mimeType when the URL has no usable extension.
  • avatar(buffer, { mimeType }) — set avatar from in-memory bytes. options.mimeType is required (enforced at the type level).
"clear" is a reserved string-literal sentinel. If you have a file literally named clear with no extension, pass "./clear" or load it as a Buffer.

Parameters

Buffer
required
{ mimeType: string }
required

Returns

ContentBuilder