Skip to content

Function: messagePreviewText() ​

ts
function messagePreviewText(content, options?): string;

Defined in: messagePreview.ts:37

A message's text as a notification or list preview: mentions as names, GIFs as a word and spoilers masked. Empty when the message has no text, so the caller can describe its attachments instead.

Shared by every client and the backend's push notifications, which must all keep spoilers out of places that show text without the message around it.

Parameters ​

ParameterType
contentstring | null | undefined
options?IMessagePreviewOptions

Returns ​

string

Released under the GNU Affero General Public License v3.0.