Skip to main content

Module util

Module util 

Source
Expand description

General-purpose value types used throughout the Discord API.

Structs§

ImageData
An image sent inside a JSON request body, as an image data URI (data:image/png;base64,iVBORw0…).
ImageDataError
The error of ImageData::new: the data is not a PNG, JPEG, GIF, WebP or AVIF image.
ImageHash
The hash of an image on Discord’s CDN — avatars, icons, banners, splashes and so on.
JsonValueError
The error of converting a JsonValue to a type.
ParseImageHashError
The error returned when parsing an ImageHash fails.
ParseTimestampError
The error returned when parsing a Timestamp fails.
SoundData
A sound sent inside a JSON request body as a data URI (data:audio/mpeg;base64,…), like ImageData for images (D-122).
SoundDataError
The error of SoundData::new: the data is not an MP3 or Ogg file.
Timestamp
A point in time, as sent by Discord in ISO 8601 format.

Enums§

JsonValue
Any JSON value, for the places where the API has arbitrary or “mixed” data (D-070, D-072): audit log change values and game-defined metadata.
Locale
A locale: a language Discord’s client is available in.
Patch
A field of a modify request that can be left unchanged, cleared or set (D-083, D-101).