# Channel

Defined in: [zaun/js/index.d.ts:646](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L646)

## Constructors

### Constructor

> **new Channel**(): `Channel`

#### Returns

`Channel`

## Properties

### client

> `readonly` **client**: [`Client`](/docs/reference/js/zaun-client/classes/client/)

Defined in: [zaun/js/index.d.ts:647](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L647)

***

### community

> `readonly` **community**: [`Community`](/docs/reference/js/zaun-client/classes/community/)

Defined in: [zaun/js/index.d.ts:648](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L648)

***

### data

> `readonly` **data**: `any`

Defined in: [zaun/js/index.d.ts:658](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L658)

***

### id

> `readonly` **id**: `string`

Defined in: [zaun/js/index.d.ts:649](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L649)

***

### isDM

> `readonly` **isDM**: `boolean`

Defined in: [zaun/js/index.d.ts:686](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L686)

DM: a direct message, not a community channel.

***

### members

> `readonly` **members**: [`Collection`](/docs/reference/js/zaun-client/classes/collection/)\<`string`, [`Member`](/docs/reference/js/zaun-client/classes/member/)\>

Defined in: [zaun/js/index.d.ts:656](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L656)

Who is in this voice channel now.

***

### messages

> `readonly` **messages**: `object`

Defined in: [zaun/js/index.d.ts:657](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L657)

#### fetch()

> **fetch**(`options?`): `Promise`\<[`Collection`](/docs/reference/js/zaun-client/classes/collection/)\<`string`, [`Message`](/docs/reference/js/zaun-client/classes/message/)\>\>

##### Parameters

###### options?

###### before?

`number`

###### limit?

`number`

##### Returns

`Promise`\<[`Collection`](/docs/reference/js/zaun-client/classes/collection/)\<`string`, [`Message`](/docs/reference/js/zaun-client/classes/message/)\>\>

***

### name

> `readonly` **name**: `string`

Defined in: [zaun/js/index.d.ts:650](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L650)

***

### parent

> `readonly` **parent**: `Channel`

Defined in: [zaun/js/index.d.ts:654](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L654)

***

### position

> `readonly` **position**: `number`

Defined in: [zaun/js/index.d.ts:653](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L653)

***

### recipient

> `readonly` **recipient**: [`Member`](/docs/reference/js/zaun-client/classes/member/)

Defined in: [zaun/js/index.d.ts:688](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L688)

DM: the other participant of a direct message, or null.

***

### topic

> `readonly` **topic**: `string`

Defined in: [zaun/js/index.d.ts:652](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L652)

***

### type

> `readonly` **type**: `"text"` \| `"announcement"` \| `"voice"` \| `"category"` \| `"forum"` \| `"stage"`

Defined in: [zaun/js/index.d.ts:651](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L651)

***

### typing

> `readonly` **typing**: \{ `kind`: `"named"`; `member_ids`: `string`[]; \} \| \{ `count`: `1` \| `2` \| `3`; `kind`: `"anonymous"`; \}

Defined in: [zaun/js/index.d.ts:662](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L662)

Who else is typing now, or `null`; anonymous channels give only a count (3 = three or more).

***

### typingMode

> `readonly` **typingMode**: `"named"` \| `"anonymous"` \| `"off"`

Defined in: [zaun/js/index.d.ts:660](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L660)

Who sees typing here.

## Methods

### autocomplete()

> **autocomplete**(`command`, `options`): `Promise`\<`string`\>

Defined in: [zaun/js/index.d.ts:678](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L678)

Asks for suggestions for the option marked `focused`; they come as `autocomplete`.

#### Parameters

##### command

`string` \| [`ApplicationCommandData`](/docs/reference/js/zaun-client/interfaces/applicationcommanddata/)

##### options

[`OptionValueData`](/docs/reference/js/zaun-client/interfaces/optionvaluedata/)[]

#### Returns

`Promise`\<`string`\>

***

### click()

> **click**(`message`, `customId`, `values?`): `Promise`\<`string`\>

Defined in: [zaun/js/index.d.ts:676](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L676)

Clicks a button, or chooses `values` in a select, of bot message `message` (its id).

#### Parameters

##### message

`string`

##### customId

`string`

##### values?

`string`[]

#### Returns

`Promise`\<`string`\>

***

### closeDm()

> **closeDm**(): `Promise`\<`void`\>

Defined in: [zaun/js/index.d.ts:690](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L690)

DM: closes a direct message for this member.

#### Returns

`Promise`\<`void`\>

***

### delete()

> **delete**(): `Promise`\<`void`\>

Defined in: [zaun/js/index.d.ts:684](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L684)

#### Returns

`Promise`\<`void`\>

***

### invokeCommand()

> **invokeCommand**(`command`, `options?`, `target?`): `Promise`\<`string`\>

Defined in: [zaun/js/index.d.ts:674](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L674)

Runs a bot command here: a command object, its id, or a slash command's name (`"help"`,
looked up in `community.commands`; rejects when no bot or several have it). Resolves with
the interaction id (answers come as events).

#### Parameters

##### command

`string` \| [`ApplicationCommandData`](/docs/reference/js/zaun-client/interfaces/applicationcommanddata/)

##### options?

[`OptionValueData`](/docs/reference/js/zaun-client/interfaces/optionvaluedata/)[]

##### target?

`string`

#### Returns

`Promise`\<`string`\>

***

### isCategory()

> **isCategory**(): `boolean`

Defined in: [zaun/js/index.d.ts:669](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L669)

#### Returns

`boolean`

***

### isText()

> **isText**(): `boolean`

Defined in: [zaun/js/index.d.ts:667](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L667)

#### Returns

`boolean`

***

### isVoice()

> **isVoice**(): `boolean`

Defined in: [zaun/js/index.d.ts:668](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L668)

#### Returns

`boolean`

***

### join()

> **join**(`options?`): `Promise`\<[`VoiceConnection`](/docs/reference/js/zaun-client/classes/voiceconnection/)\>

Defined in: [zaun/js/index.d.ts:683](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L683)

Joins this voice channel (browsers with WebRTC only). Relayed through the host's TURN
server unless `allowDirect`, and sealed end to end.

#### Parameters

##### options?

###### allowDirect?

`boolean`

###### selfDeaf?

`boolean`

###### selfMute?

`boolean`

###### track?

`MediaStreamTrack`

#### Returns

`Promise`\<[`VoiceConnection`](/docs/reference/js/zaun-client/classes/voiceconnection/)\>

***

### send()

> **send**(`options`): `Promise`\<[`Message`](/docs/reference/js/zaun-client/classes/message/)\>

Defined in: [zaun/js/index.d.ts:670](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L670)

#### Parameters

##### options

[`MessageOptions`](/docs/reference/js/zaun-client/type-aliases/messageoptions/)

#### Returns

`Promise`\<[`Message`](/docs/reference/js/zaun-client/classes/message/)\>

***

### setTypingMode()

> **setTypingMode**(`mode`): `Promise`\<`void`\>

Defined in: [zaun/js/index.d.ts:666](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L666)

typing: sets who sees typing here (`MANAGE_CHANNELS`).

#### Parameters

##### mode

`"named"` \| `"anonymous"` \| `"off"`

#### Returns

`Promise`\<`void`\>

***

### startTyping()

> **startTyping**(): `boolean`

Defined in: [zaun/js/index.d.ts:664](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L664)

Says this member is typing; `false` (nothing sent) where typing is `off`.

#### Returns

`boolean`

***

### submitModal()

> **submitModal**(`modal`, `customId`, `components`): `Promise`\<`string`\>

Defined in: [zaun/js/index.d.ts:680](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L680)

Submits a modal from `modalOpen` (its `interaction` is `modal`).

#### Parameters

##### modal

`string`

##### customId

`string`

##### components

`object`[]

#### Returns

`Promise`\<`string`\>
