# PresenceList: get() method

> The get() method of the PresenceList interface returns a player's presence entry.

The **`get()`** method of the [`PresenceList`](/docs/client/presence-list) interface returns a player's presence entry.

## Syntax

```ts
get(player)
```

### Parameters

`player`
: A string, the player ID.

### Return value

The player's [`PresenceEntry`](/docs/client/presence-entry), or `undefined` when they have none in the room.

### Exceptions

None.

## Description

`get()` is a map lookup. A player has one entry however many connections they have, and keeps it through a dropped connection for 10 seconds, with `connected` `false`.

## Examples

### Naming who sent a chat message

The room relays chat with the sender's player ID. The client shows the sender's name from their presence entry.

```ts
// chat.ts
import { connect } from "@irtio/client";

const room = await connect("main");

room.addEventListener("message", ({ data }) => {
  const chat = data as { from?: string; message?: string } | null;
  if (typeof chat?.from !== "string" || typeof chat.message !== "string") return;
  const name = room.presence.get(chat.from)?.name || chat.from;
  console.log(`${name}: ${chat.message}`);
});
```

## See also

- [`PresenceList.me`](/docs/client/presence-list/me)
- [`Presence.get()`](/docs/room/presence/get), the room's side
