# Message

Defined in: [sdk/js/src/message-object.ts:13](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/message-object.ts#L13)

A channel message.

## Implements

- `Message`

## Constructors

### Constructor

> **new Message**(`raw`): `Message`

Defined in: [sdk/js/src/message-object.ts:32](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/message-object.ts#L32)

#### Parameters

##### raw

`Message`

#### Returns

`Message`

## Properties

### attachments

> `readonly` **attachments**: `Attachment`[]

Defined in: [sdk/js/src/message-object.ts:29](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/message-object.ts#L29)

#### Implementation of

`wit.Message.attachments`

***

### authorId

> `readonly` **authorId**: `string`

Defined in: [sdk/js/src/message-object.ts:17](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/message-object.ts#L17)

#### Implementation of

`wit.Message.authorId`

***

### channelId

> `readonly` **channelId**: `string`

Defined in: [sdk/js/src/message-object.ts:15](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/message-object.ts#L15)

#### Implementation of

`wit.Message.channelId`

***

### components

> `readonly` **components**: `Component`[]

Defined in: [sdk/js/src/message-object.ts:23](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/message-object.ts#L23)

#### Implementation of

`wit.Message.components`

***

### content

> `readonly` **content**: `string`

Defined in: [sdk/js/src/message-object.ts:21](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/message-object.ts#L21)

Empty when the bot lacks `message_content` (unless it is mentioned).

#### Implementation of

`wit.Message.content`

***

### createdAt

> `readonly` **createdAt**: `bigint`

Defined in: [sdk/js/src/message-object.ts:18](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/message-object.ts#L18)

#### Implementation of

`wit.Message.createdAt`

***

### editedAt

> `readonly` **editedAt**: `bigint`

Defined in: [sdk/js/src/message-object.ts:19](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/message-object.ts#L19)

#### Implementation of

`wit.Message.editedAt`

***

### embeds

> `readonly` **embeds**: `Embed`[]

Defined in: [sdk/js/src/message-object.ts:22](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/message-object.ts#L22)

#### Implementation of

`wit.Message.embeds`

***

### flags

> `readonly` **flags**: `number`

Defined in: [sdk/js/src/message-object.ts:24](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/message-object.ts#L24)

Raw flag bits.

#### Implementation of

`wit.Message.flags`

***

### interaction

> `readonly` **interaction**: `InteractionMetadata`

Defined in: [sdk/js/src/message-object.ts:30](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/message-object.ts#L30)

#### Implementation of

`wit.Message.interaction`

***

### mentions

> `readonly` **mentions**: [`MessageMentions`](/docs/reference/js/zaun-bot/classes/messagementions/)

Defined in: [sdk/js/src/message-object.ts:28](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/message-object.ts#L28)

Who it mentions, as the host honoured them (on an edit event: the new mentions, or none
when the edit left them unchanged).

#### Implementation of

`wit.Message.mentions`

***

### messageId

> `readonly` **messageId**: `string`

Defined in: [sdk/js/src/message-object.ts:14](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/message-object.ts#L14)

#### Implementation of

`wit.Message.messageId`

***

### replyTo

> `readonly` **replyTo**: `string`

Defined in: [sdk/js/src/message-object.ts:25](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/message-object.ts#L25)

#### Implementation of

`wit.Message.replyTo`

***

### sequence

> `readonly` **sequence**: `bigint`

Defined in: [sdk/js/src/message-object.ts:16](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/message-object.ts#L16)

#### Implementation of

`wit.Message.sequence`

## Accessors

### createdTimestamp

#### Get Signature

> **get** **createdTimestamp**(): `number`

Defined in: [sdk/js/src/message-object.ts:55](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/message-object.ts#L55)

When it was posted, ms since the epoch.

##### Returns

`number`

***

### id

#### Get Signature

> **get** **id**(): `string`

Defined in: [sdk/js/src/message-object.ts:50](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/message-object.ts#L50)

The message id.

##### Returns

`string`

## Methods

### delete()

> **delete**(): `void`

Defined in: [sdk/js/src/message-object.ts:70](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/message-object.ts#L70)

Deletes it (the bot's own, or any with `MANAGE_MESSAGES`).

#### Returns

`void`

***

### edit()

> **edit**(`payload`): `void`

Defined in: [sdk/js/src/message-object.ts:65](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/message-object.ts#L65)

Edits it (the bot's own messages only).

#### Parameters

##### payload

[`MessagePayload`](/docs/reference/js/zaun-bot/type-aliases/messagepayload/)

#### Returns

`void`

***

### react()

> **react**(`emoji`): `void`

Defined in: [sdk/js/src/message-object.ts:75](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/message-object.ts#L75)

Adds a reaction.

#### Parameters

##### emoji

`string`

#### Returns

`void`

***

### reply()

> **reply**(`payload`): `string`

Defined in: [sdk/js/src/message-object.ts:60](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/message-object.ts#L60)

Replies in the same channel; returns the reply's id.

#### Parameters

##### payload

[`MessagePayload`](/docs/reference/js/zaun-bot/type-aliases/messagepayload/)

#### Returns

`string`

***

### unreact()

> **unreact**(`emoji`): `void`

Defined in: [sdk/js/src/message-object.ts:80](https://github.com/zaunchat/zaun-bot/blob/main/sdk/js/src/message-object.ts#L80)

Removes the bot's own reaction.

#### Parameters

##### emoji

`string`

#### Returns

`void`
