diff --git a/src/api/Badges.ts b/src/api/Badges.ts index 1345b26d6..8299dafa1 100644 --- a/src/api/Badges.ts +++ b/src/api/Badges.ts @@ -31,7 +31,7 @@ export interface ProfileBadge { /** Custom component for the badge (tooltip not included) */ component?: ComponentType; /** The custom image to use */ - image?: string; + iconSrc?: string; link?: string; /** Action to perform when you click the badge */ onClick?(event: React.MouseEvent, props: ProfileBadge & BadgeUserArgs): void; diff --git a/src/plugins/_api/badges/index.tsx b/src/plugins/_api/badges/index.tsx index 5b227b059..4c346689f 100644 --- a/src/plugins/_api/badges/index.tsx +++ b/src/plugins/_api/badges/index.tsx @@ -37,7 +37,7 @@ const CONTRIBUTOR_BADGE = "https://cdn.discordapp.com/emojis/1092089799109775453 const ContributorBadge: ProfileBadge = { description: "Vencord Contributor", - image: CONTRIBUTOR_BADGE, + iconSrc: CONTRIBUTOR_BADGE, position: BadgePosition.START, shouldShow: ({ userId }) => shouldShowContributorBadge(userId), onClick: (_, { userId }) => openContributorModal(UserStore.getUser(userId)) @@ -70,11 +70,11 @@ function BadgeContextMenu({ badge }: { badge: ProfileBadge & BadgeUserArgs; }) { action={() => copyWithToast(badge.description!)} /> )} - {badge.image && ( + {badge.iconSrc && ( copyWithToast(badge.image!)} + action={() => copyWithToast(badge.iconSrc!)} /> )} @@ -98,8 +98,8 @@ export default definePlugin({ find: "#{intl::PROFILE_USER_BADGES}", replacement: [ { - match: /(alt:" ","aria-hidden":!0,src:)(.+?)(?=,)(?<=href:(\i)\.link.+?)/, - replace: (_, rest, originalSrc, badge) => `...${badge}.props,${rest}${badge}.image??(${originalSrc})` + match: /alt:" ","aria-hidden":!0,src:.{0,50}(\i).iconSrc/, + replace: "...$1.props,$&" }, { match: /(?<="aria-label":(\i)\.description,.{0,200})children:/, @@ -184,7 +184,7 @@ export default definePlugin({ getDonorBadges(userId: string) { return DonorBadges[userId]?.map(badge => ({ - image: badge.badge, + iconSrc: badge.badge, description: badge.tooltip, position: BadgePosition.START, props: { diff --git a/src/plugins/ircColors/index.ts b/src/plugins/ircColors/index.ts index ebfa735e8..fbe5431bc 100644 --- a/src/plugins/ircColors/index.ts +++ b/src/plugins/ircColors/index.ts @@ -127,7 +127,7 @@ export default definePlugin({ const colorString = context?.colorString; const color = calculateNameColorForUser(id); - if (settings.store.applyColorOnlyInDms && !context?.channel?.isPrivate()) { + if (settings.store.applyColorOnlyInDms && context?.guildId !== undefined) { return colorString; } diff --git a/src/utils/constants.ts b/src/utils/constants.ts index 92de3d918..ec1d4d036 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -606,6 +606,10 @@ export const Devs = /* #__PURE__*/ Object.freeze({ name: "thororen", id: 848339671629299742n }, + alfred: { + name: "alfred", + id: 1038466644353232967n + } } satisfies Record); // iife so #__PURE__ works correctly