|
|
@ -24,7 +24,7 @@ import definePlugin from "@utils/types";
|
|
|
|
import { findByCodeLazy } from "@webpack";
|
|
|
|
import { findByCodeLazy } from "@webpack";
|
|
|
|
import { UserStore, useState } from "@webpack/common";
|
|
|
|
import { UserStore, useState } from "@webpack/common";
|
|
|
|
import type { User } from "discord-types/general";
|
|
|
|
import type { User } from "discord-types/general";
|
|
|
|
import type { ComponentType } from "react";
|
|
|
|
import type { ComponentType, ReactNode } from "react";
|
|
|
|
|
|
|
|
|
|
|
|
const fetching = new Set<string>();
|
|
|
|
const fetching = new Set<string>();
|
|
|
|
const queue = new Queue(5);
|
|
|
|
const queue = new Queue(5);
|
|
|
@ -36,7 +36,7 @@ interface MentionProps {
|
|
|
|
channelId?: string;
|
|
|
|
channelId?: string;
|
|
|
|
content: any;
|
|
|
|
content: any;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
parse: (content: any, props: MentionProps["props"]) => string[];
|
|
|
|
parse: (content: any, props: MentionProps["props"]) => ReactNode;
|
|
|
|
props: {
|
|
|
|
props: {
|
|
|
|
key: string;
|
|
|
|
key: string;
|
|
|
|
formatInline: boolean;
|
|
|
|
formatInline: boolean;
|
|
|
@ -72,7 +72,7 @@ function MentionWrapper({ data, UserMention, RoleMention, parse, props }: Mentio
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<span
|
|
|
|
<span
|
|
|
|
onMouseEnter={() => {
|
|
|
|
onMouseEnter={() => {
|
|
|
|
const mention = children?.[0];
|
|
|
|
const mention = children?.[0]?.props?.children;
|
|
|
|
if (typeof mention !== "string") return;
|
|
|
|
if (typeof mention !== "string") return;
|
|
|
|
|
|
|
|
|
|
|
|
const id = mention.match(/<@(\d+)>/)?.[1];
|
|
|
|
const id = mention.match(/<@(\d+)>/)?.[1];
|
|
|
|