Expand description
Protocol limits (specification §5.2, §10.5, §12). Hosts may be stricter and report the
effective values in session.welcome.limits.
Human-text limits count Unicode scalar values; each also has a byte ceiling of 4× that.
Constants§
- ACK_
CHANNELS sync.ackchannels.- ACTIVITY_
MAX - Presence
activity, maximum scalars. - APP_
CHOICE_ TEXT - Choice
nameand stringvalue, scalars. - APP_
COMMANDS - Application commands per bot:
CHAT_INPUT,USER,MESSAGE(§8.14). - APP_
COMMAND_ DESCRIPTION - Command and option
description(CHAT_INPUT), scalars. - APP_
COMMAND_ NAME - Command and option
name, scalars. - APP_
COMMAND_ OPTIONS - Options per command or subcommand, and choices per option.
- APP_
COMMAND_ TEXT_ TOTAL - All names, descriptions, choice names and values of one command, scalars.
- APP_
LOCALIZATIONS - Localized names per field.
- APP_
OPTION_ LENGTH_ MAX - String option
min_length/max_lengthbound. - ATTACHMENTS_
PER_ MESSAGE - Attachments per message.
- ATTACHMENT_
MIME_ MAX - Attachment media type, bytes.
- ATTACHMENT_
NAME - Attachment file name, scalars.
- ATTACHMENT_
SIZE_ MAX - Largest attachment the protocol allows, in bytes (XFTP’s 1 GiB); hosts set lower limits.
- AUTOCOMPLETE_
CHOICES - Autocomplete choices.
- BAN_
DELETE_ WINDOW_ MAX_ MS - Ban message-deletion window upper bound in milliseconds (7 days).
- BOTS_
PER_ COMMUNITY - Bots per community.
- BOT_
COMPONENT_ MAX - The WebAssembly component inside a bot package, bytes.
- BOT_
CONFIG_ KEYS - Settings a bot may declare (
config). - BOT_
CONFIG_ VALUE_ MAX - A setting’s value or default, bytes.
- BOT_
DESCRIPTION_ MAX - A bot’s
description, scalars. - BOT_
HEADER_ MAX - Bot package header, manifest and component sizes, bytes (§4.9).
- BOT_
LOCAL_ NETWORK local_networkaddresses a bot may ask for.- BOT_
MANIFEST_ MAX - The manifest JSON inside a bot package, bytes.
- BOT_
NETWORK_ HOSTS - Network hosts a bot may ask for.
- BOT_
STORAGE_ MAX - A bot’s key-value storage quota, bytes.
- BULK_
DELETE_ MAX - Most message ids in one
messages.bulk_deletedevent (§9.2). - BUTTON_
LABEL_ MAX - Button
label, scalars. - CAPABILITIES
session.hellocapabilities: count and bytes each.- CHANNELS_
PER_ COMMUNITY - Channels per community, including categories.
- CHANNEL_
NAME - Channel name length.
- CHANNEL_
TOPIC_ MAX - Channel topic, maximum scalars.
- CHECKBOX_
OPTIONS - Checkbox group options.
- COLOR_
MAX - Largest role colour,
0xFFFFFF(§8.4). - COMMUNITY_
DESCRIPTION_ MAX - Community description, maximum scalars.
- COMMUNITY_
NAME - Community name length (scalars).
- COMPONENTS_
TOTAL - Components in one message, counting nested ones.
- COMPONENT_
CUSTOM_ ID - Component
custom_id, bytes. - COMPONENT_
ROWS - Top-level action rows of a message without
IS_COMPONENTS_V2. - COMPONENT_
ROW_ BUTTONS - Buttons per action row.
- DAY_MS
- One day in milliseconds.
- DISPLAY_
NAME - Member display name length.
- DM_
OPENS_ PER_ MINUTE - New DMs one bot may open per minute (§8.15).
- DM_
UNANSWERED_ PER_ HOUR - Messages a bot may write into a DM per hour while the member has never written in it.
- EMBEDS_
PER_ MESSAGE - Embeds per message (§8.5).
- EMBED_
AUTHOR_ NAME - Embed
author.name, scalars. - EMBED_
DESCRIPTION - Embed
description, scalars. - EMBED_
FIELDS - Fields per embed.
- EMBED_
FIELD_ NAME - Embed field
name, scalars. - EMBED_
FIELD_ VALUE - Embed field
value, scalars. - EMBED_
FOOTER_ TEXT - Embed
footer.text, scalars. - EMBED_
TEXT_ TOTAL - The text of all of a message’s embeds together (titles, descriptions, field names and values, author names, footer texts), scalars.
- EMBED_
TITLE - Embed
title, scalars. - EMBED_
URL_ MAX - Embed
urlandauthor.url, maximum bytes. - EMOJI_
MAX_ BYTES - Emoji, maximum bytes.
- FILE_
UPLOAD_ MAX - Files in one file upload.
- FRAGMENT_
TIMEOUT_ MS - Milliseconds from the first to the last fragment before a reassembly is discarded.
- ICE_
FIELD_ MAX - Longest ICE server URL, username or credential, in bytes.
- ICE_
SERVERS_ MAX - Most ICE servers a host lists in
voice.join. - ICON_
MAX - Descriptor icon, maximum bytes (PNG or WebP).
- IDEMPOTENCY_
RETENTION_ MS - Idempotency record retention lower bound in milliseconds.
- INTERACTION_
ANSWER_ MS - Interaction answer deadline, ms (§8.14).
- INTERACTION_
FOLLOWUPS - Follow-ups per interaction.
- INTERACTION_
LIFETIME_ MS - Follow-ups, edits and modal submits are accepted this long after the interaction, ms.
- INVITE_
EXPIRY_ MAX_ MS - Invite expiry upper bound in milliseconds (30 days).
- INVITE_
MAX_ USES - Invite
max_usesupper bound (0 means unlimited). - IN_
FLIGHT_ DEFAULT - Default in-flight window in SMP messages per member.
- IN_
FLIGHT_ MAX - Highest configurable in-flight window (half the 128-message SMP queue stays free).
- IN_
FLIGHT_ MIN - Lowest configurable in-flight window (the largest frame must fit).
- LABEL_
TEXT - Label
labelanddescription, scalars. - LAST_N
last_nhistory bounds.- LOCKDOWN_
MS - Lockdown duration bounds in milliseconds per
enable(60 s – 7 days). - MAX_
CANONICAL_ FIELD - Unlisted variable-length fields in canonical encodings (specification §3.1).
- MAX_
COMMAND - Maximum command envelope, except
community.createandcommunity.descriptor.publish. - MAX_
FRAGMENTS - Fragments per frame.
- MAX_
FRAME - Maximum reassembled envelope in bytes.
- MAX_
OPEN_ REASSEMBLIES - Open reassemblies per connection; a further one discards the oldest.
- MEDIA_
DESCRIPTION_ MAX - Media description, scalars.
- MEDIA_
GALLERY_ ITEMS - Media gallery items.
- MENTION_
MEMBERS - Member mentions per message.
- MENTION_
ROLES - Role mentions per message.
- MESSAGE_
CONTENT - Message content length. The content may be empty when the message has an attachment or an embed (§8.5).
- MESSAGE_
JSON_ MAX - A message’s
contentandembedstogether, as JSON bytes the host writes them (message_json_len), so that every message, message event and report fits a page. Onemessage.sendnever exceeds it (its envelope is at mostMAX_COMMAND); an edit that adds long content beside large stored embeds can. - MODAL_
ITEMS - Top-level modal items.
- MODAL_
TITLE - Modal
title, scalars. - NEWCOMER_
WINDOW_ MAX_ S - Largest lockdown
newcomer_window_s: 30 days, in seconds (§8.10). - OVERRIDES_
PER_ CHANNEL - Overrides per channel.
- PAGE_
BYTES - The items of one paged response (
message.historymessages,sync.eventsevents,report.listreports; forsync.resume, the whole body), as JSON bytes: belowMAX_FRAMEby enough for the envelope, so a page always fits one frame. A host stops before it would exceed this and signals the rest (has_more,next); it always keeps the first item, except insync.resume, whose streams continue withsync.events. - PAGE_
LARGE - Page size:
member.list,sync.events. - PAGE_
SMALL - Page size:
message.history,audit.list,invite.list,invite.uses,member.bans,membership.pending,report.list. - PENDING_
EXPIRY_ MAX_ MS - Pending expiry upper bound in milliseconds (30 days); default 7 days.
- PENDING_
PER_ COMMUNITY - Pending members per community.
- PROTOCOL_
VERSION - Protocol version defined by this crate (specification §1.1).
- RADIO_
OPTIONS - Radio group options.
- REACTIONS_
PER_ MESSAGE - Distinct reaction emoji per message.
- REASON_
MAX - Moderation reason, maximum scalars.
- REPORT_
DESCRIPTION_ MAX - Report description, maximum scalars.
- REPORT_
EVIDENCE_ MAX - Report evidence, maximum messages.
- REPORT_
NOTE_ MAX - Report resolution
note, maximum scalars. - REPORT_
SNAPSHOT_ BYTES - The evidence snapshots (content and embeds as JSON) one rendered report carries; the
first snapshot always goes, and
evidence_nextnames where the rest continue. - REQUEST_
NOTE_ MAX - Membership request note, maximum scalars.
- RESUME_
CHANNELS sync.resume: channels per request.- RESUME_
EVENTS_ PER_ STREAM sync.resume: events per stream.- ROLES_
PER_ COMMUNITY - Roles per community, including
@everyone. - ROLES_
PER_ MEMBER - Roles per member.
- ROLE_
NAME - Role name length.
- ROTATIONS_
PAGE - Page size:
community.rotations(§8.1). - SECTION_
TEXTS - Section text displays.
- SELECT_
OPTIONS - Select options.
- SELECT_
OPTION_ TEXT - Select option
label,value,description, scalars. - SELECT_
PLACEHOLDER_ MAX - Select
placeholder, scalars. - SIGNAL_
INTERVAL_ MS - Minimum interval between signals per member per channel, in milliseconds.
- SLOWMODE_
MAX_ S - Slowmode upper bound in seconds.
- SNAPSHOT_
PAGE sync.snapshotpage.- SUSPENSION_
MAX_ MS - Suspension upper bound in milliseconds (90 days), or until restored.
- TEXT_
DISPLAY_ TOTAL - All text displays of one message or modal together, scalars.
- TEXT_
INPUT_ MAX - Text input value and length bounds, scalars.
- TEXT_
INPUT_ PLACEHOLDER_ MAX - Text input
placeholder, scalars. - TIMEOUT_
MAX_ MS - Timeout upper bound in milliseconds (28 days).
- TYPING_
COUNT_ CAP - The largest
countof an anonymoussignal.typing(§10.5): 3 means “three or more”, so a larger channel never learns exactly how many are typing. - UNBOUND_
DEADLINE_ MS - Unbound connection deadline (default) in milliseconds.
- VOICE_
KEY_ PACKAGE_ MAX - Largest
key_packageofvoice.join, decoded bytes (opaque to the host; the media layer’s packages are 4 680 bytes). - VOICE_
MESH_ MAX - The most participants a voice channel can have on any host (
mesh_max≤ this). Every participant’s key package is in thevoice.joinresponse, which must fit inMAX_FRAME(9 base64 packages ofVOICE_KEY_PACKAGE_MAXbytes are about 74 KiB), and onevoice.keysfor the whole mesh must fit inMAX_COMMAND. - VOICE_
SENDER_ KEYS_ MAX - Largest
sender_keysofvoice.keys, decoded bytes: the sender’s signed message for one epoch, the same for every recipient (the media layer’s are at most 5 468 bytes). - VOICE_
SIGNAL_ MAX - Largest
dataofvoice.signal(WebRTC SDP or ICE), decoded bytes. - VOICE_
USER_ LIMIT user_limitof a voice channel.- VOICE_
WRAPPED_ KEY_ MAX - Largest
wrappedkey of onevoice.keysentry, decoded bytes (the media layer’s are 1 168 bytes).
Functions§
- text_
within - Whether
texthas betweenminandmaxUnicode scalar values and at most 4×maxbytes.