function mentionsUser
mentionsUser(
body: string,
username: string
): boolean

Checks whether body @mentions username, ignoring case, with the pattern the server uses for mention notifications, this instance's own host included (localHandle). WSProvider uses it to pick the chime, and ChatModal to highlight the message.

Parameters

body: string
username: string

Return Type

boolean

Usage

import { mentionsUser } from "src/utils/chat/text.ts";