fix(api): 🐛 Fix regression in emoji parsing caused by incorrectly changed regex

This commit is contained in:
Jesse Wierzbinski 2024-05-12 15:07:55 -10:00
parent c6c92e716f
commit 8e5d68144c
No known key found for this signature in database
3 changed files with 49 additions and 3 deletions

View file

@ -1,4 +1,4 @@
import { emojiValidator } from "@api";
import { emojiValidator, emojiValidatorWithColons } from "@api";
import { proxyUrl } from "@response";
import { type InferSelectModel, and, eq } from "drizzle-orm";
import type * as Lysand from "lysand-types";
@ -17,7 +17,7 @@ export type EmojiWithInstance = InferSelectModel<typeof Emojis> & {
* @returns An array of emojis
*/
export const parseEmojis = async (text: string) => {
const matches = text.match(emojiValidator);
const matches = text.match(emojiValidatorWithColons);
if (!matches) return [];
const emojis = await db.query.Emojis.findMany({
where: (emoji, { eq, or }) =>