---
url: https://docs.juniper.bot/en/message-templates/types/discord/message.md
description: Discord Message data type used in JuniperBot Template Engine.
---

[Number]: /en/message-templates/types/index#literals

[String]: /en/message-templates/types/index#literals

[Boolean]: /en/message-templates/types/index#literals

[List]: /en/message-templates/types/index#lists

[Map]: /en/message-templates/types/index#maps

[DateTime]: /en/message-templates/types/index#datetime

[TwitchChannel]: /en/message-templates/types/subscriptions/twitch#twitch-channel

[TwitchStream]: /en/message-templates/types/subscriptions/twitch#twitch-stream

[TwitchGame]: /en/message-templates/types/subscriptions/twitch#twitch-game

[YouTubeChannel]: /en/message-templates/types/subscriptions/youtube#youtube-channel

[YouTubeVideo]: /en/message-templates/types/subscriptions/youtube#youtube-video

[VkWallPost]: /en/message-templates/types/subscriptions/vk#vkwallpost

[Rank]: /en/message-templates/types/discord/rank

[Guild]: /en/message-templates/types/discord/guild

[Member]: /en/message-templates/types/discord/member

[Role]: /en/message-templates/types/discord/role

[Message]: /en/message-templates/types/discord/message

[Attachment]: /en/message-templates/types/discord/attachment

[Embed]: /en/message-templates/types/discord/embed

[Activity]: /en/message-templates/types/discord/activity

[MemberVoiceState]: /en/message-templates/types/discord/member-voice-state

[MemberPrimaryGuild]: /en/message-templates/types/discord/member-primary-guild

[MenuBuilder]: /en/message-templates/types/discord/menu-builder

[UserFlag]: /en/message-templates/types/discord/user-flag

[Permission]: /en/message-templates/types/discord/permission

[Category]: /en/message-templates/types/discord/category

[TextChannel]: /en/message-templates/types/discord/text-channel

[VoiceChannel]: /en/message-templates/types/discord/voice-channel

[NewsChannel]: /en/message-templates/types/discord/news-channel

[StageChannel]: /en/message-templates/types/discord/stage-channel

[ForumChannel]: /en/message-templates/types/discord/forum-channel

[MediaChannel]: /en/message-templates/types/discord/media-channel

[ThreadChannel]: /en/message-templates/types/discord/thread-channel

[Page]: /en/message-templates/types/storage/page

[GuildIndex]: /en/message-templates/types/storage/guild-index

[GuildIndexEntry]: /en/message-templates/types/storage/guild-index-entry

[GuildIndexes]: /en/message-templates/types/storage/guild-indexes

[MemberAttribute]: /en/message-templates/types/storage/member-attribute

[MemberAttributes]: /en/message-templates/types/storage/member-attributes

[Arguments]: /en/message-templates/types/custom-commands/arguments

[Parameters]: /en/message-templates/types/custom-commands/parameters

[Component]: /en/message-templates/types/custom-commands/component

[Modal]: /en/message-templates/types/custom-commands/modal

# Message

This data type describes all available data about the message in channel.

## Properties { #properties }

| Property            | Type                                                              | Description                                                                                                               |
|:--------------------|:------------------------------------------------------------------|:--------------------------------------------------------------------------------------------------------------------------|
| `id`                | \[Number]                                                          | Unique identifier                                                                                                         |
| `contentRaw`        | \[String]                                                          | The raw textual content of this message                                                                                   |
| `contentDisplay`    | \[String]                                                          | The textual content of this message in the format that would be shown to the Discord client                               |
| `contentStripped`   | \[String]                                                          | The textual content of this message in the format that would be shown to the Discord client and all the markdown stripped |
| `jumpUrl`           | \[String]                                                          | Jump-to URL                                                                                                               |
| `channel`           | \[TextChannel], \[NewsChannel], \[VoiceChannel], \[ThreadChannel]             | Channel of this message                                                                                                   |
| `guild`             | \[Guild]                                                           | Server information                                                                                                        |
| `author`            | \[Member]                                                          | Message author                                                                                                            |
| `createdAt`         | \[DateTime]                                                        | Creation date and time                                                                                                    |
| `mentionedMembers`  | \[List]<\[Member]>                                                  | List of mentioned members                                                                                                 |
| `mentionedChannels` | \[List]<\[TextChannel], \[NewsChannel], \[VoiceChannel], \[StageChannel], \[ForumChannel], \[MediaChannel]> | List of mentioned text channels                                                                                           |
| `mentionedRoles`    | \[List]<\[Role]>                                                    | List of mentioned roles                                                                                                   |
| `attachments`       | \[List]<\[Attachment]>                                              | List of attachments                                                                                                       |
| `referencedMessage` | \[Message]                                                         | Reply message                                                                                                             |

## Methods { #methods }

### `delete()` { #method-delete .template-method }

::: tabs

\== Description | mdi-text

Deletes this message

\== Example | mdi-code-block-braces

```template
{% do message.delete() %}
```

:::

### `pin()` { #method-pin .template-method }

::: tabs

\== Description | mdi-text

Pins this message. Returns `true` is successful.

**Returns:** \[Boolean]

\== Examples | mdi-code-block-braces

```template
{% do message.pin() %}
```

```template{1}
{% if message.pin() %}
Message has been pinned
{% else %}
Message wasn't pinned
{% endif %}
```

:::

### `unpin()` { #method-unpin .template-method }

::: tabs

\== Description | mdi-text

Unpins this message. Returns `true` is successful.

**Returns:** \[Boolean]

\== Examples | mdi-code-block-braces

```template
{% do message.unpin() %}
```

```template{1}
{% if message.unpin() %}
Message has been unpinned
{% else %}
Message wasn't unpinned
{% endif %}
```

:::
