> ## Documentation Index
> Fetch the complete documentation index at: https://www.chapterjs.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Data

> Read the plain objects you get for attachments, reactions, tags, overwrites, bans, audit logs, events, rules, stickers, voice states and presences

Some things have no class of their own: you get them as plain objects, with the fields of Discord written in camelCase. They have no methods, and nothing on them sends a request.

> [!NOTE]
>
> The structures that have a page of their own are listed in the [overview](https://www.chapterjs.org/reference.md). What a message contains when you send one is in [Message options](https://www.chapterjs.org/reference/message-options.md).

Two things hold everywhere on this page:

* A date is a `string` in ISO 8601 (`'2026-10-06T12:00:00.000000+00:00'`): `new Date(value)` turns it into a `Date`.
* A user inside plain data is plain data too (`id`, `username`, `globalName`, `avatar`...), not a [`User`](https://www.chapterjs.org/reference/user). Only `Ban` holds a real `User`.

```ts theme={"theme":{"light":"github-light","dark":"vesper"}}
import type { Message } from 'chapterjs';

function images(message: Message) {
  return message.attachments.filter(file => file.contentType?.startsWith('image/'));
}
```

## Attachment

A file attached to a message. You read them in `message.attachments`.

**id** `Snowflake` *required*

The id of the attachment.

**filename** `string` *required*

The name of the file.

**title** `string`

The title of the file.

**description** `string`

What the file shows, for people who can't see it (1024 characters at most).

**contentType** `string`

The media type of the file (`image/png`).

**size** `number` *required*

The size of the file, in bytes.

**url** `string` *required*

The URL of the file.

**proxyUrl** `string` *required*

The URL of the file through the proxy of Discord.

**height** `number | null`

The height, for an image or a video.

**width** `number | null`

The width, for an image or a video.

**placeholder** `string`

A tiny blurred preview of an image or a video, as a thumbhash.

**placeholderVersion** `number`

The version of that preview.

**ephemeral** `boolean`

Whether the file belongs to an ephemeral message: it disappears with it.

**durationSecs** `number`

The length of an audio or video file, in seconds.

**waveform** `string`

The sampled waveform of a voice message, as base64.

**flags** `number`

The flags of the attachment, as a bit field.

**clipParticipants** `object[]`

For a clip of a stream, the users who were in the stream (plain data).

**clipCreatedAt** `string`

For a clip of a stream, when it was recorded.

**application** `object | null`

For a clip of a stream, the application that was streamed, when Discord recognized it (plain data).

[Discord documentation](https://docs.discord.com/developers/resources/message#attachment-object-attachment-structure)

## Reaction

The reactions of one emoji on a message. You read them in `message.reactions`, one entry per emoji.

**count** `number` *required*

How many times the emoji was used, super reactions included.

**countDetails** `object` *required*

The same count, split.

**fields**

**normal** `number` *required*

How many normal reactions.

**burst** `number` *required*

How many super reactions.

**me** `boolean` *required*

Whether the bot reacted with this emoji.

**meBurst** `boolean` *required*

Whether the bot super-reacted with this emoji.

**emoji** `object` *required*

The emoji.

**fields**

**id** `Snowflake | null`

The id of a custom emoji; `null` for a standard one.

**name** `string | null`

The name of a custom emoji, or the character of a standard one.

**animated** `boolean`

Whether a custom emoji is animated.

**burstColors** `string[]` *required*

The colors of the super reactions, as hex text.

To react or read who reacted, see [Message](https://www.chapterjs.org/reference/message.md): `react()`, `fetchReactionUsers()`.

[Discord documentation](https://docs.discord.com/developers/resources/message#reaction-object-reaction-structure)

## ReactionEmoji

The emoji of a reaction: a standard one has only a `name` (`"👍"`), a custom one has an `id` too. The [reaction events](https://www.chapterjs.org/reference/events.md#reactionadd) give one.

**id** `Snowflake | null` *required*

The id of a custom emoji; `null` for a standard one.

**name** `string | null` *required*

The name of a custom emoji, or the character of a standard one.

**animated** `boolean`

Whether a custom emoji is animated.

[Discord documentation](https://docs.discord.com/developers/resources/emoji#emoji-object)

## ForumTag

A tag the posts of a forum can have. You read them in `forum.availableTags`, and pass them in `availableTags` when you [create](https://www.chapterjs.org/reference/options.md#channelcreateoptions) or [edit](https://www.chapterjs.org/reference/options.md#guildchanneleditoptions) a forum channel.

**id** `Snowflake` *required*

The id of the tag.

**name** `string` *required*

The name of the tag (0-20 characters).

**moderated** `boolean` *required*

Whether only members with the `ManageThreads` permission can add the tag to a post or remove it.

**emojiId** `Snowflake | null` *required*

The id of a custom emoji of the server shown next to the tag.

**emojiName** `string | null` *required*

A standard emoji shown next to the tag, as its character.

A tag has either `emojiId` or `emojiName`, or neither.

[Discord documentation](https://docs.discord.com/developers/resources/channel#forum-tag-object-forum-tag-structure)

## ThreadMember

Someone in a thread, and since when. `thread.fetchMembers()` returns a list of them.

**id** `Snowflake`

The id of the thread.

**userId** `Snowflake`

The id of the user.

**joinTimestamp** `string` *required*

When the user last joined the thread.

**flags** `number` *required*

The settings of the user for the thread, as a bit field; today only about notifications.

To get the member behind it, use `guild.fetchMember(threadMember.userId)`.

[Discord documentation](https://docs.discord.com/developers/resources/channel#thread-member-object-thread-member-structure)

## PermissionOverwrite

What a role or a member is allowed or denied in one channel. You read them in `channel.permissionOverwrites`.

**id** `Snowflake` *required*

The id of the role or of the member.

**type** `'role' | 'member'` *required*

Whether it applies to a role or to a member.

**allow** `Permissions` *required*

What is allowed, whatever the server says.

**deny** `Permissions` *required*

What is denied, whatever the server says.

`allow` and `deny` are [`Permissions`](https://www.chapterjs.org/reference/permissions) sets, so `overwrite.allow.has('SendMessages')` works. To change an overwrite, use `channel.setPermissions()` and `channel.deletePermissions()`; the `permissionOverwrites` field of [`ChannelCreateOptions`](https://www.chapterjs.org/reference/options#channelcreateoptions) has another shape, the one Discord takes.

[Discord documentation](https://docs.discord.com/developers/resources/channel#overwrite-object-overwrite-structure)

## Ban

A ban of a server. `guild.fetchBan()` returns one, `guild.fetchBans()` a list.

**user** `User` *required*

Who is banned.

**reason** `string | null` *required*

Why, when a reason was given.

[Discord documentation](https://docs.discord.com/developers/resources/guild#ban-object-ban-structure)

## AuditLog

What moderators and bots did in a server: its entries, newest first, and what they refer to. `guild.fetchAuditLog()` returns one.

**auditLogEntries** `object[]` *required*

The entries, from the most recent to the oldest.

**fields of an entry**

**id** `Snowflake` *required*

The id of the entry.

**actionType** `AuditLogEvent` *required*

What happened: a value of [`AuditLogEvent`](https://www.chapterjs.org/reference/enums#auditlogevent).

**targetId** `string | null` *required*

The id of what was affected: a webhook, a user, a role...

**userId** `Snowflake | null` *required*

The id of the user or the app that did it.

**reason** `string`

The reason given (1-512 characters).

**changes** `object[]`

What changed on the target.

**fields of a change**

**key** `string` *required*

The name of what changed, with a few exceptions Discord lists.

**oldValue** `unknown`

The value before.

**newValue** `unknown`

The value after.

**options** `object`

More details for some kinds of entries. Every field can be missing; counts and days are text, as Discord sends them.

**fields**

**applicationId** `Snowflake`

The id of the app whose permissions were changed.

**autoModerationRuleName** `string`

The name of the auto moderation rule that was triggered.

**autoModerationRuleTriggerType** `string`

What triggers that rule.

**channelId** `Snowflake`

The channel where it happened.

**count** `string`

How many things were affected.

**deleteMemberDays** `string`

After how many days of inactivity members were pruned.

**id** `Snowflake`

The id of the role or member whose overwrite changed.

**membersRemoved** `string`

How many members the prune removed.

**messageId** `Snowflake`

The id of the message that was pinned or unpinned.

**roleName** `string`

The name of the role, when `type` is `"0"`.

**type** `string`

Whose overwrite changed: `"0"` a role, `"1"` a member.

**integrationType** `string`

The kind of integration that did it.

**status** `string`

The new status of the voice channel.

**users** `object[]` *required*

The users the entries refer to (plain data).

**webhooks** `object[]` *required*

The webhooks the entries refer to (plain data).

**threads** `object[]` *required*

The threads the entries refer to (plain data).

**integrations** `object[]` *required*

The integrations the entries refer to, partially (plain data).

**applicationCommands** `object[]` *required*

The commands the entries refer to (plain data).

**autoModerationRules** `AutoModerationRule[]` *required*

The auto moderation rules the entries refer to.

**guildScheduledEvents** `ScheduledEvent[]` *required*

The scheduled events the entries refer to.

[Discord documentation](https://docs.discord.com/developers/resources/audit-log#audit-log-object-audit-log-structure)

## AuditLogEntry

One thing a moderator or a bot did in a server: what, by whom, on what, and what changed. `auditLogEntryCreate` gives one; its fields are the ones of an entry of [`AuditLog`](#auditlog): `id`, `actionType`, `targetId`, `userId`, `reason`, `changes` and `options`.

[Discord documentation](https://docs.discord.com/developers/resources/audit-log#audit-log-entry-object-audit-log-entry-structure)

## ScheduledEvent

An event scheduled in a server: when it happens, where, and how often. `guild.fetchScheduledEvents()` returns a list, `guild.createScheduledEvent()` the one it created.

**id** `Snowflake` *required*

The id of the event.

**guildId** `Snowflake` *required*

The id of the server.

**channelId** `Snowflake | null` *required*

The id of the channel where the event takes place; `null` when it takes place outside Discord.

**creatorId** `Snowflake | null`

The id of the user who created the event.

**name** `string` *required*

The name of the event (1-100 characters).

**description** `string | null`

The description of the event (1-1000 characters).

**scheduledStartTime** `string` *required*

When the event starts.

**scheduledEndTime** `string | null` *required*

When the event ends; always set for an event outside Discord.

**privacyLevel** `2` *required*

Who can see the event: `2`, the members of the server.

**status** `1 | 2 | 3 | 4` *required*

`1` scheduled, `2` active, `3` completed, `4` canceled.

**entityType** `1 | 2 | 3` *required*

Where it takes place: `1` a stage channel, `2` a voice channel, `3` outside Discord.

**entityId** `Snowflake | null` *required*

The id of what the event is tied to, when there is one.

**entityMetadata** `object | null` *required*

More about the place.

**fields**

**location** `string`

Where the event takes place, for an event outside Discord (1-100 characters).

**creator** `object`

The user who created the event (plain data).

**userCount** `number`

How many users are interested in the event.

**image** `string | null`

The hash of the cover image.

**recurrenceRule** `object | null` *required*

How often the event repeats; `null` when it happens once.

**fields**

**start** `string` *required*

When the repetition starts.

**end** `string | null` *required*

When the repetition ends.

**frequency** `0 | 1 | 2 | 3` *required*

`0` yearly, `1` monthly, `2` weekly, `3` daily.

**interval** `number` *required*

The spacing between two occurrences, in units of `frequency`: weekly with an interval of `2` is every other week.

**byWeekday** `number[] | null` *required*

The days of the week it repeats on, from `0` (Monday) to `6` (Sunday).

**byNWeekday** `object[] | null` *required*

Days of a given week of the month: `{ n, day }`, with `n` the week (1-5) and `day` the weekday.

**byMonth** `number[] | null` *required*

The months it repeats on, from `1` (January) to `12` (December).

**byMonthDay** `number[] | null` *required*

The days of the month it repeats on.

**byYearDay** `number[] | null` *required*

The days of the year it repeats on (1-364).

**count** `number | null` *required*

How many times it repeats before stopping.

[Discord documentation](https://docs.discord.com/developers/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-structure)

## AutoModerationRule

A rule Discord applies by itself to the messages of a server: what triggers it, and what it does then. `guild.fetchAutoModerationRules()` returns a list.

**id** `Snowflake` *required*

The id of the rule.

**guildId** `Snowflake` *required*

The id of the server.

**name** `string` *required*

The name of the rule.

**creatorId** `Snowflake` *required*

The id of the user who created the rule.

**eventType** `1 | 2` *required*

When the rule is checked: `1` a member sends or edits a message, `2` a member edits their profile.

**triggerType** `1 | 3 | 4 | 5 | 6` *required*

What triggers it: `1` words from a list, `3` spam, `4` words from a preset list of Discord, `5` too many mentions, `6` words from a list in the profile of a member.

**triggerMetadata** `object` *required*

The details of the trigger. Which fields are there depends on `triggerType`.

**fields**

**keywordFilter** `string[]`

The words or parts of words searched for (1000 at most).

**regexPatterns** `string[]`

The regular expressions matched against the content (10 at most).

**presets** `number[]`

The preset lists of Discord searched for: `1` profanity, `2` sexual content, `3` slurs.

**allowList** `string[]`

The words that never trigger the rule (100 or 1000 at most, depending on the trigger).

**mentionTotalLimit** `number`

How many different roles and users a message may mention (50 at most).

**mentionRaidProtectionEnabled** `boolean`

Whether mention raids are detected by themselves.

**actions** `object[]` *required*

What happens when the rule is triggered.

**fields of an action**

**type** `1 | 2 | 3 | 4` *required*

`1` block the message, `2` send an alert in a channel, `3` time the member out, `4` block the member from using text, voice and other interactions.

**metadata** `object`

What the action needs.

**fields**

**channelId** `Snowflake`

The channel where the alert is sent.

**durationSeconds** `number`

How long the timeout lasts, in seconds.

**customMessage** `string | null`

What the member is told when their message is blocked.

**enabled** `boolean` *required*

Whether the rule is on.

**exemptRoles** `Snowflake[]` *required*

The ids of the roles the rule ignores (20 at most).

**exemptChannels** `Snowflake[]` *required*

The ids of the channels the rule ignores (50 at most).

[Discord documentation](https://docs.discord.com/developers/resources/auto-moderation#auto-moderation-rule-object-auto-moderation-rule-structure)

## Sticker

A sticker: one of a server, or a standard one from a pack. `guild.fetchStickers()` returns the ones of a server.

**id** `Snowflake` *required*

The id of the sticker.

**packId** `Snowflake`

For a standard sticker, the id of its pack.

**name** `string` *required*

The name of the sticker.

**description** `string | null` *required*

The description of the sticker.

**tags** `string` *required*

The words that suggest the sticker when typing (200 characters at most).

**type** `1 | 2` *required*

`1` a standard sticker from a pack, `2` a sticker of a server.

**formatType** `1 | 2 | 3 | 4` *required*

The format of the image: `1` PNG, `2` APNG, `3` Lottie, `4` GIF.

**available** `boolean`

Whether the sticker of a server can be used; `false` when the server lost the boosts it needed.

**guildId** `Snowflake`

The id of the server that owns the sticker.

**user** `object`

The user who uploaded the sticker (plain data).

**sortValue** `number`

The place of a standard sticker in its pack.

To send one, pass its id in the `stickers` of a message: see [Message options](https://www.chapterjs.org/reference/message-options.md).

[Discord documentation](https://docs.discord.com/developers/resources/sticker#sticker-object-sticker-structure)

## VoiceState

Where someone is in voice, and how: muted, deafened, streaming... The [voice events](https://www.chapterjs.org/reference/events.md#voicejoin) give one.

**channelId** `Snowflake | null` *required*

The id of the voice channel the person is in.

**userId** `Snowflake` *required*

The id of the person.

**sessionId** `string` *required*

The id of their voice session.

**deaf** `boolean` *required*

Whether the server deafened them.

**mute** `boolean` *required*

Whether the server muted them.

**selfDeaf** `boolean` *required*

Whether they deafened themselves.

**selfMute** `boolean` *required*

Whether they muted themselves.

**selfStream** `boolean`

Whether they are streaming with Go Live.

**selfVideo** `boolean` *required*

Whether their camera is on.

**suppress** `boolean` *required*

Whether they may not speak (in a stage channel, an audience member).

**requestToSpeakTimestamp** `string | null` *required*

When they asked to speak, in a stage channel.

[Discord documentation](https://docs.discord.com/developers/resources/voice#voice-state-object)

## UserPresence

Whether someone is online and what they are doing: their status, their activities, and on which devices. `presenceUpdate` gives one.

**status** `'online' | 'idle' | 'dnd' | 'offline'` *required*

Their status.

**activities** `object[]` *required*

What they are doing, the first one being what Discord shows.

**fields of an activity**

**name** `string` *required*

The name of the activity: the game, the music service...

**type** `0 | 1 | 2 | 3 | 4 | 5` *required*

`0` playing, `1` streaming, `2` listening, `3` watching, `4` a custom status, `5` competing.

**url** `string | null`

The link of a stream.

**createdAt** `number` *required*

When the activity started, in milliseconds since 1970.

**timestamps** `object`

When the game started or ends: `start` and `end`, in milliseconds since 1970.

**applicationId** `Snowflake`

The id of the application of the game.

**details** `string | null`

What they are doing in it.

**state** `string | null`

The state of their party, or the text of a custom status.

**emoji** `object | null`

The emoji of a custom status (plain data).

**party** `object`

Their party: `id`, and `size` as `[current, max]`.

**assets** `object`

The images of the activity and their texts (plain data).

**instance** `boolean`

Whether it is an instanced game session.

**flags** `number`

What the activity includes, as a bit field.

**clientStatus** `object` *required*

Their status on each kind of device they use; a device they don't use is left out.

**fields**

**desktop** `string`

On a computer application.

**mobile** `string`

On a phone.

**web** `string`

In a browser.

**vr** `string`

In virtual reality.

[Discord documentation](https://docs.discord.com/developers/events/gateway-events#presence-update-presence-update-event-fields)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.