Skip to main content

Module appearance

Module appearance 

Expand description

The name and avatar a bot shows for one action, as a webhook does: a bridge posts a Discord user’s message under that user’s name. The bot stays the author; an appearance is presentation recorded in provenance, never identity. A value that fails validation refuses the invocation; it is never cleaned up, so what a reader sees is exactly what the bot sent.

Structs§

Appearance
What a bot showed for one action instead of its own name and icon.
Persona
An account on another service, such as discord / 80351110224678912.

Enums§

AppearanceError
Why an appearance was refused.

Constants§

MAX_AVATAR_BYTES
The largest avatar image.
MAX_NAME_CHARS
The longest name, in characters, after trimming.

Functions§

admit
Admit appearance on a request from caller, for the room-action door: only a bot whose installation allows_personas may show another name, the appearance must be valid, and its avatar must be an image avatar finds in the room’s content store under its own hash.
check_avatar_bytes
Check the bytes an avatar hash names: small, and a raster image. SVG is refused because it is a document, not a picture.
refuse_here
For a door that cannot check that its caller is a bot allowed to show other names: refuse a request carrying an appearance instead of running it under the caller’s own name.