diff --git a/src/api/controllers/sendMessage.controller.ts b/src/api/controllers/sendMessage.controller.ts index 60bc9195..64aa1c84 100644 --- a/src/api/controllers/sendMessage.controller.ts +++ b/src/api/controllers/sendMessage.controller.ts @@ -19,10 +19,12 @@ import { BadRequestException } from '@exceptions'; import { isBase64, isURL } from 'class-validator'; import emojiRegex from 'emoji-regex'; +const regex = emojiRegex(); + function isEmoji(str: string) { if (str === '') return true; - const match = str.match(emojiRegex()); + const match = str.match(regex); return match?.length === 1 && match[0] === str; }