---
url: https://docs.juniper.bot/en/message-templates/types/discord/thread-channel.md
description: Discord ThreadChannel 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

# ThreadChannel

This data type describes all available data about the thread.

## Properties { #properties }

| Property    | Type       | Description                                            |
|:------------|:-----------|:-------------------------------------------------------|
| `id`        | \[Number]   | Unique identifier                                      |
| `createdAt` | \[DateTime] | Creation date and time                                 |
| `name`      | \[String]   | Channel name                                           |
| `type`      | \[String]   | Channel type                                           |
| `mention`   | \[String]   | Mention                                                |
| `guild`     | \[Guild]    | Server information                                     |
| `position`  | \[Number]   | Position number in channel list (1 is top of the list) |
| `parent`    | \[Category] | Category if exists                                     |
| `nsfw`      | \[Boolean]  | `true` if this channel is age restricted               || `topic`     | \[String]   | Description (Topic)                                    |
| `canTalk`   | \[Boolean]  | `true` if bot can send messages in this channel        || `archived`          | \[Boolean] | `true` if thread has been archived                                               |
| `invitable`         | \[Boolean] | `true` if members can invite others                                              |
| `joined`            | \[Boolean] | `true` if bot has joined                                                         |
| `locked`            | \[Boolean] | `true` if thread is locked                                                       |
| `pinned`            | \[Boolean] | `true` if thread is pinned (forum posts only)                                    |
| `public`            | \[Boolean] | `true` if thread is public                                                       |
| `owner`             | \[Member]  | Thread Owner                                                                     |
| `memberCount`       | \[Number]  | The current number of members that have joined this thread (capped at 50)        |
| `messageCount`      | \[Number]  | The current number of messages present in this thread                            |
| `totalMessageCount` | \[Number]  | The total number of messages sent in this thread, including all deleted messages |

## Methods { #methods }

### `getMessageById(ID)` { #method-getmessagebyid .template-method }

::: tabs

\== Description | mdi-text

Returns a message object for specified message ID.

**Returns:** \[Message]

\== Parameters | mdi-code-parentheses

| Parameter | Type     | Description        |
|:----------|:---------|:-------------------|
| `ID`      | \[Number] | Message Identifier |

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

```template
{% set someMessage = channel.getMessageById(310848622642069504) %}
```

:::

### `sendMessage(Text)` { #method-sendmessage .template-method }

::: tabs

\== Description | mdi-text

Sends a simple text message to this channel. Returns `true` if message has been sent.

**Returns:** \[Boolean]

\== Parameters | mdi-code-parentheses

| Parameter | Type     | Description  |
|:----------|:---------|:-------------|
| `Text`    | \[String] | Message text |

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

```template
{% do channel.sendMessage('Message!') %}
```

:::

### `sendMessageAndGet(Text)` { #method-sendmessageandget .template-method }

::: tabs

\== Description | mdi-text

Sends a simple text message to this channel. Returns result message object if message has been sent.

**Returns:** \[Boolean]

\== Parameters | mdi-code-parentheses

| Parameter | Type     | Description  |
|:----------|:---------|:-------------|
| `Text`    | \[String] | Message text |

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

```template
{% set newMessage = channel.sendMessageAndGet('Message!') %}
```

:::

### `createEmbed()` { #method-createembed .template-method }

::: tabs

\== Description | mdi-text

Creates a new Embed builder.

**Returns:** \[Embed]

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

```template{2}
{% do channel
    .createEmbed()
    .withContent('Content outside the embed')
    .withTitle('Title', 'https://juniper.bot')
    .withDescription('Oh, hi!')
    .appendDescription('\nHow are you?')
    .withDate(1587713425964)
    .withColor('ffff00')
    .withThumbnail(member.avatarUrl)
    .withImage('https://i.pinimg.com/originals/a4/41/6e/a4416e024d691af3a2971e4114a6da7f.png')
    .withAuthor(member.nickname)
    .withFooter('Huff, bye!', member.avatarUrl)
    .addField('First field', 'Ah! A value of the first field', true)
    .addField('Second field', 'Something here too', true)
    .addReaction(':fox_face:')
    .addButton('LINK', 'https://juniper.bot/', 'Website', '🦊')
    .send()
%}
```

:::
