From c4fc9ac8e077d2d1a7d00f8abcd8da2e5e77578f Mon Sep 17 00:00:00 2001 From: sadan4 <117494111+sadan4@users.noreply.github.com> Date: Fri, 21 Mar 2025 08:18:12 -0400 Subject: [PATCH 1/6] Fix plugins for Discord update (#3298) Co-authored-by: Nuckyz <61953774+Nuckyz@users.noreply.github.com> --- src/plugins/accountPanelServerProfile/index.tsx | 4 ++-- src/plugins/alwaysAnimate/index.ts | 6 +++--- src/plugins/decor/index.tsx | 2 +- src/plugins/ignoreActivities/index.tsx | 9 +-------- src/plugins/noBlockedMessages/index.ts | 4 ++-- 5 files changed, 9 insertions(+), 16 deletions(-) diff --git a/src/plugins/accountPanelServerProfile/index.tsx b/src/plugins/accountPanelServerProfile/index.tsx index d9fc9de1..30403f84 100644 --- a/src/plugins/accountPanelServerProfile/index.tsx +++ b/src/plugins/accountPanelServerProfile/index.tsx @@ -73,8 +73,8 @@ export default definePlugin({ group: true, replacement: [ { - match: /(?<=\.AVATAR_SIZE\).{0,100};)(?=return)/, - replace: "$self.useAccountPanelRef();" + match: /let{speaking:\i/, + replace: "$self.useAccountPanelRef();$&" }, { match: /(\.AVATAR,children:.+?renderPopout:(\i)=>){(.+?)}(?=,position)(?<=currentUser:(\i).+?)/, diff --git a/src/plugins/alwaysAnimate/index.ts b/src/plugins/alwaysAnimate/index.ts index a5297445..8edae08b 100644 --- a/src/plugins/alwaysAnimate/index.ts +++ b/src/plugins/alwaysAnimate/index.ts @@ -44,15 +44,15 @@ export default definePlugin({ find: "#{intl::GUILD_OWNER}),children:", replacement: { match: /(\.CUSTOM_STATUS.+?animate:)\i/, - replace: (_, rest) => `${rest}!0` + replace: "$1!0" } }, { // Guild Banner find: ".animatedBannerHoverLayer,onMouseEnter:", replacement: { - match: /(?<=guildBanner:\i,animate:)\i(?=}\))/, - replace: "!0" + match: /(\.headerContent.+?guildBanner:\i,animate:)\i/, + replace: "$1!0" } } ] diff --git a/src/plugins/decor/index.tsx b/src/plugins/decor/index.tsx index 4801cf75..63963d09 100644 --- a/src/plugins/decor/index.tsx +++ b/src/plugins/decor/index.tsx @@ -99,7 +99,7 @@ export default definePlugin({ }, // Current user area, at bottom of channels/dm list { - find: "renderAvatarWithPopout(){", + find: "#{intl::ACCOUNT_SPEAKING_WHILE_MUTED}", replacement: [ // Use Decor avatar decoration hook { diff --git a/src/plugins/ignoreActivities/index.tsx b/src/plugins/ignoreActivities/index.tsx index 9e9610f6..b0889186 100644 --- a/src/plugins/ignoreActivities/index.tsx +++ b/src/plugins/ignoreActivities/index.tsx @@ -260,14 +260,7 @@ export default definePlugin({ replace: (m, props, nowPlaying) => `${m}$self.renderToggleGameActivityButton(${props},${nowPlaying}),` } }, - // Discord has 2 different components for activities. Currently, the last is the one being used - { - find: ".activityTitleText,variant", - replacement: { - match: /\.activityTitleText.+?children:(\i)\.name.*?}\),/, - replace: (m, props) => `${m}$self.renderToggleActivityButton(${props}),` - }, - }, + // Activities from the apps launcher in the bottom right of the chat bar { find: ".promotedLabelWrapperNonBanner,children", replacement: { diff --git a/src/plugins/noBlockedMessages/index.ts b/src/plugins/noBlockedMessages/index.ts index 95b53c6b..efa4ed08 100644 --- a/src/plugins/noBlockedMessages/index.ts +++ b/src/plugins/noBlockedMessages/index.ts @@ -57,10 +57,10 @@ export default definePlugin({ patches: [ { - find: "#{intl::BLOCKED_MESSAGES_HIDE}", + find: ".__invalid_blocked,", replacement: [ { - match: /let\{[^}]*collapsedReason[^}]*\}/, + match: /let{expanded:\i,[^}]*?collapsedReason[^}]*}/, replace: "if($self.shouldHide(arguments[0]))return null;$&" } ] From 94ee0c518a087461a7bacbcc6af4050d5889aaa1 Mon Sep 17 00:00:00 2001 From: sadan4 <117494111+sadan4@users.noreply.github.com> Date: Fri, 21 Mar 2025 08:22:58 -0400 Subject: [PATCH 2/6] InvisibleChat: Fix crashing when message contains a link (#3303) --- src/plugins/invisibleChat.desktop/index.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/plugins/invisibleChat.desktop/index.tsx b/src/plugins/invisibleChat.desktop/index.tsx index d6a39cba..f98ab176 100644 --- a/src/plugins/invisibleChat.desktop/index.tsx +++ b/src/plugins/invisibleChat.desktop/index.tsx @@ -149,6 +149,12 @@ export default definePlugin({ renderChatBarButton: ChatBarIcon, + colorCodeFromNumber(color: number): string { + return `#${[color >> 16, color >> 8, color] + .map(x => (x & 0xFF).toString(16)) + .join("")}`; + }, + // Gets the Embed of a Link async getEmbed(url: URL): Promise { const { body } = await RestAPI.post({ @@ -157,6 +163,8 @@ export default definePlugin({ urls: [url] } }); + // The endpoint returns the color as a number, but Discord expects a string + body.embeds[0].color = this.colorCodeFromNumber(body.embeds[0].color); return await body.embeds[0]; }, @@ -166,7 +174,7 @@ export default definePlugin({ message.embeds.push({ type: "rich", rawTitle: "Decrypted Message", - color: "0x45f5f5", + color: "#45f5f5", rawDescription: revealed, footer: { text: "Made with ❤️ by c0dine and Sammy!", From 16910c95adf40df18c03609638df8bb35ae88345 Mon Sep 17 00:00:00 2001 From: sadan4 <117494111+sadan4@users.noreply.github.com> Date: Fri, 21 Mar 2025 08:24:03 -0400 Subject: [PATCH 3/6] VolumeBooster: Fix error when going back to the default device (#3273) --- src/plugins/volumeBooster/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/volumeBooster/index.ts b/src/plugins/volumeBooster/index.ts index c9a08bbc..62d2a2c1 100644 --- a/src/plugins/volumeBooster/index.ts +++ b/src/plugins/volumeBooster/index.ts @@ -136,7 +136,7 @@ export default definePlugin({ // @ts-expect-error if (data.sinkId != null && data.sinkId !== data.audioContext.sinkId && "setSinkId" in AudioContext.prototype) { // @ts-expect-error https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/setSinkId - data.audioContext.setSinkId(data.sinkId); + data.audioContext.setSinkId(data.sinkId === "default" ? "" : data.sinkId); } data.gainNode.gain.value = data._mute From d178dcc4809891cc36f659ee2da28cd51f8e0156 Mon Sep 17 00:00:00 2001 From: sadan4 <117494111+sadan4@users.noreply.github.com> Date: Fri, 21 Mar 2025 08:26:49 -0400 Subject: [PATCH 4/6] IrcColors: Dont color wumpus in Role Settings (#3272) --- src/plugins/ircColors/index.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/plugins/ircColors/index.ts b/src/plugins/ircColors/index.ts index 3522eaad..d547a0e1 100644 --- a/src/plugins/ircColors/index.ts +++ b/src/plugins/ircColors/index.ts @@ -81,9 +81,13 @@ export default definePlugin({ ], calculateNameColorForMessageContext(context: any) { - const id = context?.message?.author?.id; + const userId: string | undefined = context?.message?.author?.id; const colorString = context?.author?.colorString; - const color = calculateNameColorForUser(id); + const color = calculateNameColorForUser(userId); + + // Color preview in role settings + if (context?.message?.channel_id === "1337" && userId === "313337") + return colorString; if (settings.store.applyColorOnlyInDms && !context?.channel?.isPrivate()) { return colorString; From 7eec2e5d5bde7ce6b31555b57e5d050a3ac48c18 Mon Sep 17 00:00:00 2001 From: sadan4 <117494111+sadan4@users.noreply.github.com> Date: Fri, 21 Mar 2025 08:33:37 -0400 Subject: [PATCH 5/6] CommandsAPI: Fix issue with overlapping IDS (#3271) --- src/api/Commands/index.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/api/Commands/index.ts b/src/api/Commands/index.ts index 2b7a4de6..af6a6fdf 100644 --- a/src/api/Commands/index.ts +++ b/src/api/Commands/index.ts @@ -31,6 +31,7 @@ export const commands = {} as Record; // hack for plugins being evaluated before we can grab these from webpack const OptPlaceholder = Symbol("OptionalMessageOption") as any as Option; const ReqPlaceholder = Symbol("RequiredMessageOption") as any as Option; + /** * Optional message option named "message" you can use in commands. * Used in "tableflip" or "shrug" @@ -44,11 +45,16 @@ export let OptionalMessageOption: Option = OptPlaceholder; */ export let RequiredMessageOption: Option = ReqPlaceholder; +// Discord's command list has random gaps for some reason, which can cause issues while rendering the commands +// Add this offset to every added command to keep them unique +let commandIdOffset: number; + export const _init = function (cmds: Command[]) { try { BUILT_IN = cmds; OptionalMessageOption = cmds.find(c => (c.untranslatedName || c.displayName) === "shrug")!.options![0]; RequiredMessageOption = cmds.find(c => (c.untranslatedName || c.displayName) === "me")!.options![0]; + commandIdOffset = Math.abs(BUILT_IN.map(x => Number(x.id)).sort((x, y) => x - y)[0]) - BUILT_IN.length; } catch (e) { new Logger("CommandsAPI").error("Failed to load CommandsApi", e, " - cmds is", cmds); } @@ -142,7 +148,7 @@ export function registerCommand(command: C, plugin: string) { command.isVencordCommand = true; command.untranslatedName ??= command.name; command.untranslatedDescription ??= command.description; - command.id ??= `-${BUILT_IN.length + 1}`; + command.id ??= `-${BUILT_IN.length + commandIdOffset + 1}`; command.applicationId ??= "-1"; // BUILT_IN; command.type ??= ApplicationCommandType.CHAT_INPUT; command.inputType ??= ApplicationCommandInputType.BUILT_IN_TEXT; From b3bff83dd5040950c55e09bed9e47a60490f81d8 Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Fri, 21 Mar 2025 09:34:41 -0300 Subject: [PATCH 6/6] Bump to 1.11.7 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 32c3a329..6be69fa3 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "vencord", "private": "true", - "version": "1.11.6", + "version": "1.11.7", "description": "The cutest Discord client mod", "homepage": "https://github.com/Vendicated/Vencord#readme", "bugs": {