merge unconflict

This commit is contained in:
2025-11-18 23:10:36 +01:00
5 changed files with 14 additions and 10 deletions

View File

@@ -31,7 +31,7 @@ export interface ProfileBadge {
/** Custom component for the badge (tooltip not included) */ /** Custom component for the badge (tooltip not included) */
component?: ComponentType<ProfileBadge & BadgeUserArgs>; component?: ComponentType<ProfileBadge & BadgeUserArgs>;
/** The custom image to use */ /** The custom image to use */
image?: string; iconSrc?: string;
link?: string; link?: string;
/** Action to perform when you click the badge */ /** Action to perform when you click the badge */
onClick?(event: React.MouseEvent, props: ProfileBadge & BadgeUserArgs): void; onClick?(event: React.MouseEvent, props: ProfileBadge & BadgeUserArgs): void;

View File

@@ -36,7 +36,7 @@ const CONTRIBUTOR_BADGE = "https://raw.githubusercontent.com/Nexulien/assets/mai
const ContributorBadge: ProfileBadge = { const ContributorBadge: ProfileBadge = {
description: "Nexulien Contributor", description: "Nexulien Contributor",
image: CONTRIBUTOR_BADGE, iconSrc: CONTRIBUTOR_BADGE,
position: BadgePosition.START, position: BadgePosition.START,
shouldShow: ({ userId }) => shouldShowContributorBadge(userId), shouldShow: ({ userId }) => shouldShowContributorBadge(userId),
onClick: (_, { userId }) => openContributorModal(UserStore.getUser(userId)) onClick: (_, { userId }) => openContributorModal(UserStore.getUser(userId))
@@ -77,11 +77,11 @@ function BadgeContextMenu({ badge }: { badge: ProfileBadge & BadgeUserArgs; }) {
action={() => copyWithToast(badge.description!)} action={() => copyWithToast(badge.description!)}
/> />
)} )}
{badge.image && ( {badge.iconSrc && (
<Menu.MenuItem <Menu.MenuItem
id="vc-badge-copy-link" id="vc-badge-copy-link"
label="Copy Badge Image Link" label="Copy Badge Image Link"
action={() => copyWithToast(badge.image!)} action={() => copyWithToast(badge.iconSrc!)}
/> />
)} )}
</Menu.Menu> </Menu.Menu>
@@ -105,8 +105,8 @@ export default definePlugin({
find: "#{intl::PROFILE_USER_BADGES}", find: "#{intl::PROFILE_USER_BADGES}",
replacement: [ replacement: [
{ {
match: /(alt:" ","aria-hidden":!0,src:)(.+?)(?=,)(?<=href:(\i)\.link.+?)/, match: /alt:" ","aria-hidden":!0,src:.{0,50}(\i).iconSrc/,
replace: (_, rest, originalSrc, badge) => `...${badge}.props,${rest}${badge}.image??(${originalSrc})` replace: "...$1.props,$&"
}, },
{ {
match: /(?<="aria-label":(\i)\.description,.{0,200})children:/, match: /(?<="aria-label":(\i)\.description,.{0,200})children:/,
@@ -191,7 +191,7 @@ export default definePlugin({
getDonorBadges(userId: string) { getDonorBadges(userId: string) {
return DonorBadges[userId]?.map(badge => ({ return DonorBadges[userId]?.map(badge => ({
image: badge.badge, iconSrc: badge.badge,
description: badge.tooltip, description: badge.tooltip,
position: BadgePosition.START, position: BadgePosition.START,
props: { props: {
@@ -215,7 +215,7 @@ export default definePlugin({
getNexulienBadges(userId: string) { getNexulienBadges(userId: string) {
return NexulienBadges[userId]?.map(badge => ({ return NexulienBadges[userId]?.map(badge => ({
image: badge.badge, iconSrc: badge.badge,
description: badge.tooltip, description: badge.tooltip,
position: BadgePosition.START, position: BadgePosition.START,
props: { props: {

View File

@@ -127,7 +127,7 @@ export default definePlugin({
const colorString = context?.colorString; const colorString = context?.colorString;
const color = calculateNameColorForUser(id); const color = calculateNameColorForUser(id);
if (settings.store.applyColorOnlyInDms && !context?.channel?.isPrivate()) { if (settings.store.applyColorOnlyInDms && context?.guildId !== undefined) {
return colorString; return colorString;
} }

View File

@@ -136,7 +136,7 @@ export default definePlugin({
{ {
find: ".reactorDefault", find: ".reactorDefault",
replacement: { replacement: {
match: /,onContextMenu:\i=>.{0,15}\((\i),(\i),(\i)\).{0,250}tag:"strong"/, match: /tag:"strong"(?=.{0,50}\i\.name)(?<=onContextMenu:.{0,15}\((\i),(\i),\i\).+?)/,
replace: "$&,style:$self.getColorStyle($2?.id,$1?.channel?.id)" replace: "$&,style:$self.getColorStyle($2?.id,$1?.channel?.id)"
}, },
predicate: () => settings.store.reactorsList, predicate: () => settings.store.reactorsList,

View File

@@ -632,6 +632,10 @@ export const Devs = /* #__PURE__*/ Object.freeze({
name: "thororen", name: "thororen",
id: 848339671629299742n id: 848339671629299742n
}, },
alfred: {
name: "alfred",
id: 1038466644353232967n
}
} satisfies Record<string, Dev>); } satisfies Record<string, Dev>);
// iife so #__PURE__ works correctly // iife so #__PURE__ works correctly