> ## Documentation Index
> Fetch the complete documentation index at: https://botmesh.afaya.com.co/llms.txt
> Use this file to discover all available pages before exploring further.

# legacyMessageKey()

> Function exported by @botmesh/core/spi.

```ts theme={null}
function legacyMessageKey(ref): string;
```

Defined in: [core/provider.ts:1620](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/provider.ts#L1620)

The pre-escaping message key (`${chatId}:${id}`), ambiguous when either part
contains `:`. Only for stores migrating rows written before
[messageKey](https://botmesh.afaya.com.co/api/core/spi/functions/messageKey.md) escaped its parts: it differs from `messageKey(ref)`
exactly when a part contains `:` or `%`, and a row found under it must be
checked to belong to `ref` (same chat id and message id) before use.

## Parameters

| Parameter | Type |
| - | - |
| `ref` | [`MessageRef`](https://botmesh.afaya.com.co/api/core/interfaces/MessageRef) |

## Returns

`string`


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.