fix OnePingPerDM (#3648)

also removes a now obsolete patch from FakeNitro
This commit is contained in:
thororen 2025-09-06 12:27:29 -04:00 committed by GitHub
parent 26074b7f18
commit 1cfc3fb8f8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 15 additions and 12 deletions

View file

@ -159,7 +159,6 @@ function makeBypassPatches(): Omit<Patch, "plugin"> {
{ func: "canUseHighVideoUploadQuality", predicate: () => settings.store.enableStreamQualityBypass }, { func: "canUseHighVideoUploadQuality", predicate: () => settings.store.enableStreamQualityBypass },
{ func: "canStreamQuality", predicate: () => settings.store.enableStreamQualityBypass }, { func: "canStreamQuality", predicate: () => settings.store.enableStreamQualityBypass },
{ func: "canUseClientThemes" }, { func: "canUseClientThemes" },
{ func: "canUseCustomNotificationSounds" },
{ func: "canUsePremiumAppIcons" } { func: "canUsePremiumAppIcons" }
]; ];
@ -176,7 +175,7 @@ function makeBypassPatches(): Omit<Patch, "plugin"> {
export default definePlugin({ export default definePlugin({
name: "FakeNitro", name: "FakeNitro",
authors: [Devs.Arjix, Devs.D3SOX, Devs.Ven, Devs.fawn, Devs.captain, Devs.Nuckyz, Devs.AutumnVN], authors: [Devs.Arjix, Devs.D3SOX, Devs.Ven, Devs.fawn, Devs.captain, Devs.Nuckyz, Devs.AutumnVN],
description: "Allows you to stream in nitro quality, send fake emojis/stickers, use client themes and custom Discord notifications.", description: "Allows you to stream in nitro quality, send fake emojis/stickers, and use client themes.",
dependencies: ["MessageEventsAPI"], dependencies: ["MessageEventsAPI"],
settings, settings,

View file

@ -38,17 +38,21 @@ export default definePlugin({
description: "If unread messages are sent by a user in DMs multiple times, you'll only receive one audio ping. Read the messages to reset the limit", description: "If unread messages are sent by a user in DMs multiple times, you'll only receive one audio ping. Read the messages to reset the limit",
authors: [Devs.ProffDea], authors: [Devs.ProffDea],
settings, settings,
patches: [{ patches: [
{
find: ".getDesktopType()===", find: ".getDesktopType()===",
replacement: [{ replacement: [
{
match: /(\i\.\i\.getDesktopType\(\)===\i\.\i\.NEVER)\)/, match: /(\i\.\i\.getDesktopType\(\)===\i\.\i\.NEVER)\)/,
replace: "$&if(!$self.isPrivateChannelRead(arguments[0]?.message))return;else " replace: "$&if(!$self.isPrivateChannelRead(arguments[0]?.message))return;else "
}, },
{ {
match: /sound:(\i\?\i:void 0,soundpack:\i,volume:\i,onClick)/, match: /sound:(\i\?\i:void 0,volume:\i,onClick)/,
replace: "sound:!$self.isPrivateChannelRead(arguments[0]?.message)?undefined:$1" replace: "sound:!$self.isPrivateChannelRead(arguments[0]?.message)?undefined:$1"
}] }
}], ]
}
],
isPrivateChannelRead(message: MessageJSON) { isPrivateChannelRead(message: MessageJSON) {
const channelType = ChannelStore.getChannel(message.channel_id)?.type; const channelType = ChannelStore.getChannel(message.channel_id)?.type;
if ( if (