# ChatHudLineHelper

`com.jsmacrosce.jsmacros.client.api.helper.screen.ChatHudLineHelper`

Wraps a chat HUD history entry, exposing its text and creation tick and allowing removal from
 the HUD scrollback. History access is provided by `Chat.getHistory()`.  
 ```js
const history = Chat.getHistory();  
const lines = history.getRecvLines();  
Chat.log(`${lines.size()} line(s) in the scrollback`);  
// the list is newest first, so index zero is the line that just arrived
for (let i = 0; i !== lines.size(); i += 1) {
  const line = lines.get(i);  
  Chat.log(`[${line.getCreationTick()}] ${line.getText().getString()}`);  
}
 ```

## Constructors

### new ChatHudLineHelper {#com.jsmacrosce.jsmacros.client.api.helper.screen.ChatHudLineHelper_constructor-GuiMessage-ChatComponent-}

```js
new ChatHudLineHelper(GuiMessage base, ChatComponent hud)
```

Stores the chat history message and HUD used by [deleteById()](#com.jsmacrosce.jsmacros.client.api.helper.screen.ChatHudLineHelper_deleteById-).

**Parameters:**
- `base`: raw chat history message to wrap
- `hud`: chat HUD used by `deleteById()` to remove the captured message

## Methods

### deleteById {#com.jsmacrosce.jsmacros.client.api.helper.screen.ChatHudLineHelper_deleteById-}

```js
deleteById(): ChatHudLineHelper
```

Removes this message from the HUD scrollback by value. Removing an absent message has no effect.

**Returns:** self for chaining.

### getCreationTick {#com.jsmacrosce.jsmacros.client.api.helper.screen.ChatHudLineHelper_getCreationTick-}

```js
getCreationTick(): int
```

Returns the tick count recorded when the message arrived, not a timestamp.

**Returns:** the recorded tick count

### getText {#com.jsmacrosce.jsmacros.client.api.helper.screen.ChatHudLineHelper_getText-}

```js
getText(): TextHelper
```

Returns this message's styled content.

**Returns:** the text of this chat line

### toString {#com.jsmacrosce.jsmacros.client.api.helper.screen.ChatHudLineHelper_toString-}

```js
toString(): String
```

Returns a diagnostic representation containing the message's plain content and creation tick count.

**Returns:** diagnostic representation of this chat history entry
