# BotResponse

This class defines a Bot Response associated to an [[Event]].

### Constructor

```ts
new BotResponse(event, payload?): BotResponse;
```

#### Parameters

| Parameter | Type |
| :------ | :------ |
| `event` | [`Event`](https://bkper.com/docs/api/bkper-js/classes/event.md) |
| `payload?` | `BotResponse` |

#### Returns

`BotResponse`

### payload

```ts
payload: BotResponse;
```

### getAgentId()

```ts
getAgentId(): string | undefined;
```

Gets the agent id of this Bot Response.

#### Returns

`string` \| `undefined`

The agent id of this Bot Response

***

### getCreatedAt()

```ts
getCreatedAt(): Date | undefined;
```

Gets the date this Bot Response was created.

#### Returns

`Date` \| `undefined`

The date this Bot Response was created

***

### getEvent()

```ts
getEvent(): Event;
```

Gets the Event this Bot Response is associated to.

#### Returns

[`Event`](https://bkper.com/docs/api/bkper-js/classes/event.md)

The Event this Bot Response is associated to

***

### getMessage()

```ts
getMessage(): string | undefined;
```

Gets the message of this Bot Response.

#### Returns

`string` \| `undefined`

The message of this Bot Response

***

### getType()

```ts
getType(): 
  | BotResponseType
  | undefined;
```

Gets the type of this Bot Response.

#### Returns

  \| [`BotResponseType`](https://bkper.com/docs/api/bkper-js/enumerations/botresponsetype.md)
  \| `undefined`

The type of this Bot Response

***

### remove()

```ts
remove(): Promise;
```

Delete this Bot Response.

#### Returns

`Promise`\<`BotResponse`\>

The deleted Bot Response

***

### replay()

```ts
replay(): Promise;
```

Replay this Bot Response.

#### Returns

`Promise`\<`BotResponse`\>

The updated Bot Response
