> For the complete documentation index, see [llms.txt](https://jumpathy.gitbook.io/betterchat-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jumpathy.gitbook.io/betterchat-documentation/plugin-api/server/speaker-object.md).

# Speaker Object

### Methods

#### getPlayer

```lua
local speaker = API.speaker.cache("Player1")
print(speaker:GetPlayer())
```

This method will return a [player object](https://developer.roblox.com/en-us/api-reference/class/Player) if the speaker is assigned to one.

#### addToChannel

```lua
local speaker = API.speaker.cache("Player1")
speaker:addToChannel("all")
```

This method will add the specified speaker to the specified [channel object.](/betterchat-documentation/plugin-api/server/channel-object.md)

| Type   | Name         |
| ------ | ------------ |
| string | channel name |

#### isinChannel

```lua
local speaker = API.speaker.cache("Player1")
speaker:addToChannel("all")
local isInChannel = speaker:isInChannel("all")
print(isInChannel)
```

This method will return a boolean that tells you if the speaker is in the specified [channel object.](/betterchat-documentation/plugin-api/server/channel-object.md)

| Type   | Name         |
| ------ | ------------ |
| string | channel name |

#### destroy

```lua
local speaker = API.speaker.cache("Player1")
speaker:Destroy()
```

This method will destroy all the connections of the specified speaker and remove their functions. This essentially is the same as destroying a part, it renders it useless.

| Type   | Name         |
| ------ | ------------ |
| string | speaker name |
