mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-08 06:03:03 -04:00
Merge branch 'dev'
This commit is contained in:
commit
d67beebfbf
17 changed files with 206 additions and 39 deletions
|
@ -179,7 +179,7 @@ export default definePlugin({
|
|||
find: ".GUILD_APPLICATION_PREMIUM_SUBSCRIPTION||",
|
||||
replacement: [
|
||||
{
|
||||
match: /let \i;let\{repliedAuthor:/,
|
||||
match: /let \i,\{repliedAuthor:/,
|
||||
replace: "if(arguments[0] != null && arguments[0].referencedMessage.message != null) { if($self.shouldHideUser(arguments[0].referencedMessage.message.author.id, arguments[0].baseMessage.messageReference.channel_id)) { return $self.hiddenReplyComponent(); } }$&"
|
||||
}
|
||||
]
|
||||
|
|
|
@ -71,7 +71,7 @@ export default definePlugin({
|
|||
find: "#{intl::MESSAGE_EDITED_TIMESTAMP_A11Y_LABEL}",
|
||||
replacement: [
|
||||
{
|
||||
match: /(?<=\i=\i\?)\(0,\i\.\i\)\((\i),"LT"\):\(0,\i\.\i\)\(\i,!0\)/,
|
||||
match: /(?<=\i=null!=\i\?).{0,25}\((\i),"LT"\):\(0,\i\.\i\)\(\i,!0\)/,
|
||||
replace: '$self.format($1,"compactFormat","[calendar]"):$self.format($1,"cozyFormat","LT")',
|
||||
},
|
||||
{
|
||||
|
|
|
@ -83,7 +83,7 @@ export default definePlugin({
|
|||
// this also affects name headers in chats outside of servers
|
||||
find: '="SYSTEM_TAG"',
|
||||
replacement: {
|
||||
match: /(?<=\i.gradientClassName]\),style:.{0,80}:void 0,)/,
|
||||
match: /(?<=\i.gradientClassName]\),style:.{0,80}:void 0\}\)\(\),)/,
|
||||
replace: "style:{color:$self.colorIfServer(arguments[0])},"
|
||||
},
|
||||
predicate: () => !Settings.plugins.IrcColors.enabled
|
||||
|
|
|
@ -254,7 +254,7 @@ export default definePlugin({
|
|||
]
|
||||
},
|
||||
{
|
||||
find: "THREAD_STARTER_MESSAGE?null===",
|
||||
find: "THREAD_STARTER_MESSAGE?null==",
|
||||
replacement: {
|
||||
match: /deleted:\i\.deleted, editHistory:\i\.editHistory,/,
|
||||
replace: "deleted:$self.getDeleted(...arguments), editHistory:$self.getEdited(...arguments),"
|
||||
|
|
|
@ -56,7 +56,7 @@ export default definePlugin({
|
|||
{
|
||||
find: ".gifts)",
|
||||
replacement: {
|
||||
match: /,.{0,5}\(null===\(\w=\w\.stickers\)\|\|void 0.*?(\w)\.push\((\(0,\w\.jsx\))\((.+?),{disabled:\w,type:(\w)},"sticker"\)\)\)/,
|
||||
match: /,.{0,5}\(null==\(\i=\i\.stickers\)\?void 0.*?(\i)\.push\((\(0,\w\.jsx\))\((.+?),{disabled:\i,type:(\i)},"sticker"\)\)\)/,
|
||||
replace: (m, _, jsx, compo, type) => {
|
||||
const c = "arguments[0].type";
|
||||
return `${m},${c}?.submit?.button&&${_}.push(${jsx}(${compo},{disabled:!${c}?.submit?.button,type:${type},stickersType:"stickers+"},"stickers+"))`;
|
||||
|
|
|
@ -28,7 +28,7 @@ export default definePlugin({
|
|||
{
|
||||
find: '"SearchStore",',
|
||||
replacement: {
|
||||
match: /(\i)\.offset=null!==\((\i)=(\i)\.offset\)&&void 0!==(\i)\?(\i):0/i,
|
||||
match: /(\i)\.offset=null!=\((\i)=(\i)\.offset\)\?(\i):0/i,
|
||||
replace: (_, v, v1, query, v3, v4) => `$self.main(${query}), ${v}.offset = null !== (${v1} = ${query}.offset) && void 0 !== ${v3} ? ${v4} : 0`
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ export default definePlugin({
|
|||
settings,
|
||||
patches: [
|
||||
{
|
||||
find: ".videoControls:",
|
||||
find: /\.VIDEO\?\i\.videoControls:/,
|
||||
replacement: {
|
||||
match: /children:\[this\.renderPlayIcon\(\),.{0,200}\.setDurationRef}\),/,
|
||||
replace: "$&$self.SpeedButton(),"
|
||||
|
|
|
@ -39,7 +39,7 @@ export default definePlugin({
|
|||
replace: "Vencord.Api.ServerList.renderAll(Vencord.Api.ServerList.ServerListRenderPosition.In).concat($&)"
|
||||
},
|
||||
{
|
||||
match: /discoveryIcon\}\)\}\)\]/,
|
||||
match: /children:\i\}\)\]/,
|
||||
replace: "$&.concat(Vencord.Api.ServerList.renderAll(Vencord.Api.ServerList.ServerListRenderPosition.Below))"
|
||||
}
|
||||
]
|
||||
|
|
|
@ -148,15 +148,15 @@ export default definePlugin({
|
|||
{
|
||||
find: "is not a valid locale.",
|
||||
replacement: {
|
||||
match: /\i\.error\(""\.concat\(\i," is not a valid locale."\)\);/,
|
||||
replace: ""
|
||||
match: /\i\.error(?=\(""\.concat\(\i," is not a valid locale."\)\))/,
|
||||
replace: "$self.NoopLogger"
|
||||
}
|
||||
},
|
||||
{
|
||||
find: '"AppCrashedFatalReport: getLastCrash not supported."',
|
||||
replacement: {
|
||||
match: /console\.log\("AppCrashedFatalReport: getLastCrash not supported\."\);/,
|
||||
replace: ""
|
||||
match: /console\.log(?=\("AppCrashedFatalReport: getLastCrash not supported\."\))/,
|
||||
replace: "$self.NoopLogger"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
|
@ -49,7 +49,7 @@ export default definePlugin({
|
|||
replace: "$self.handleOnline()"
|
||||
},
|
||||
{
|
||||
match: /(setInterval\(\i,\.25\*)\i\.\i/,
|
||||
match: /(setInterval\(\i,30\*)\i\.\i\.Millis\.SECOND/,
|
||||
replace: "$1$self.getIntervalDelay()" // For web installs
|
||||
}
|
||||
]
|
||||
|
|
|
@ -19,7 +19,7 @@ import { AvatarDecorationModalPreview } from "../components";
|
|||
|
||||
const FileUpload = findComponentByCodeLazy("fileUploadInput,");
|
||||
|
||||
const { HelpMessage, HelpMessageTypes } = mapMangledModuleLazy('POSITIVE=3]="POSITIVE', {
|
||||
const { HelpMessage, HelpMessageTypes } = mapMangledModuleLazy('POSITIVE="positive', {
|
||||
HelpMessageTypes: filters.byProps("POSITIVE", "WARNING", "INFO"),
|
||||
HelpMessage: filters.byCode(".iconDiv")
|
||||
});
|
||||
|
|
|
@ -67,7 +67,7 @@ export default definePlugin({
|
|||
{
|
||||
find: '="SYSTEM_TAG"',
|
||||
replacement: {
|
||||
match: /(?<=\i.gradientClassName]\),style:.{0,80}:void 0,)/,
|
||||
match: /(?<=\i.gradientClassName]\),style:.{0,80}:void 0\}\)\(\),)/,
|
||||
replace: "style:{color:$self.calculateNameColorForMessageContext(arguments[0])},"
|
||||
}
|
||||
},
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
import { definePluginSettings } from "@api/Settings";
|
||||
import { getUserSettingLazy } from "@api/UserSettings";
|
||||
import { Link } from "@components/Link";
|
||||
import { Devs } from "@utils/constants";
|
||||
import { Devs, EquicordDevs } from "@utils/constants";
|
||||
import { Logger } from "@utils/Logger";
|
||||
import definePlugin, { OptionType } from "@utils/types";
|
||||
import { findByPropsLazy } from "@webpack";
|
||||
|
@ -44,10 +44,12 @@ interface Activity {
|
|||
timestamps?: {
|
||||
start?: number;
|
||||
};
|
||||
assets?: ActivityAssets;
|
||||
assets?: ActivityAssets; // LastFM
|
||||
assets2?: ActivityAssets; // StatsFM
|
||||
buttons?: Array<string>;
|
||||
name: string;
|
||||
application_id: string;
|
||||
application_id: string; // LastFM
|
||||
application_id2: string; // StatsFM
|
||||
metadata?: {
|
||||
button_urls?: Array<string>;
|
||||
};
|
||||
|
@ -67,39 +69,91 @@ interface TrackData {
|
|||
const enum ActivityType {
|
||||
PLAYING = 0,
|
||||
LISTENING = 2,
|
||||
STREAMING = 1, // Added Streaming ig as a alt to listening
|
||||
}
|
||||
|
||||
const enum ActivityFlag {
|
||||
INSTANCE = 1 << 0,
|
||||
}
|
||||
|
||||
const enum NameFormat {
|
||||
const enum NameFormat { // (2) = Statsfm config
|
||||
StatusName = "status-name",
|
||||
ArtistFirst = "artist-first",
|
||||
SongFirst = "song-first",
|
||||
ArtistOnly = "artist",
|
||||
SongOnly = "song",
|
||||
AlbumName = "album"
|
||||
AlbumName = "album",
|
||||
AlbumName2 = "album2", // ^
|
||||
ArtistOnly2 = "artist2", // ^
|
||||
ArtistFirst2 = "ArtistFirst2", // ^
|
||||
SongFirst2 = "SongFirst2", // ^
|
||||
SongOnly2 = "SongOnly2", // ^
|
||||
}
|
||||
|
||||
interface Albums {
|
||||
id: number;
|
||||
name: string;
|
||||
image: string;
|
||||
}
|
||||
|
||||
interface Artists {
|
||||
id: number;
|
||||
name: string;
|
||||
image: string;
|
||||
}
|
||||
interface ExternalIds {
|
||||
spotify: string[];
|
||||
appleMusic: string[];
|
||||
}
|
||||
|
||||
|
||||
interface Track {
|
||||
albums: Albums[];
|
||||
artists: Artists[];
|
||||
durationMs: number;
|
||||
explicit: boolean;
|
||||
externalIds: ExternalIds;
|
||||
id: number;
|
||||
name: string;
|
||||
spotifyPopularity: number;
|
||||
spotifyPreview: string;
|
||||
appleMusicPreview: string;
|
||||
}
|
||||
|
||||
interface Item {
|
||||
date: string;
|
||||
isPlaying: boolean;
|
||||
progressMs: number;
|
||||
deviceName: string;
|
||||
track: Track;
|
||||
platform: string;
|
||||
}
|
||||
|
||||
interface SFMR {
|
||||
item: Item;
|
||||
}
|
||||
|
||||
const ShowCurrentGame = getUserSettingLazy<boolean>("status", "showCurrentGame")!;
|
||||
|
||||
const applicationId = "1108588077900898414";
|
||||
const applicationId = "1108588077900898414"; // LastFM Appid
|
||||
const applicationId2 = "1325126169179197500"; // StatsFM Appid
|
||||
const placeholderId = "2a96cbd8b46e442fc41c2b86b821562f";
|
||||
|
||||
const logger = new Logger("LastFMRichPresence");
|
||||
const logger = new Logger("LastFMRichPresence + StatsfmFMRichPresence");
|
||||
|
||||
const PresenceStore = findByPropsLazy("getLocalPresence");
|
||||
|
||||
async function getApplicationAsset(key: string): Promise<string> {
|
||||
return (await ApplicationAssetUtils.fetchAssetIds(applicationId, [key]))[0];
|
||||
}
|
||||
|
||||
async function getApplicationAsset2(key: string): Promise<string> {
|
||||
return (await ApplicationAssetUtils.fetchAssetIds(applicationId2, [key]))[0];
|
||||
}
|
||||
function setActivity(activity: Activity | null) {
|
||||
FluxDispatcher.dispatch({
|
||||
type: "LOCAL_ACTIVITY_UPDATE",
|
||||
activity,
|
||||
socketId: "LastFM",
|
||||
socketId: "LastFM + Statsfm",
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -108,6 +162,10 @@ const settings = definePluginSettings({
|
|||
description: "last.fm username",
|
||||
type: OptionType.STRING,
|
||||
},
|
||||
statsfmusername: {
|
||||
description: "stats.fm username",
|
||||
type: OptionType.STRING,
|
||||
},
|
||||
apiKey: {
|
||||
description: "last.fm api key",
|
||||
type: OptionType.STRING,
|
||||
|
@ -117,26 +175,51 @@ const settings = definePluginSettings({
|
|||
type: OptionType.BOOLEAN,
|
||||
default: false,
|
||||
},
|
||||
shareUsernameStatsfm: {
|
||||
description: "show link to stats.fm profile",
|
||||
type: OptionType.BOOLEAN,
|
||||
default: false,
|
||||
},
|
||||
shareSong: {
|
||||
description: "show link to song on last.fm",
|
||||
type: OptionType.BOOLEAN,
|
||||
default: true,
|
||||
},
|
||||
StatsfmSong: {
|
||||
description: "show link to song on stats.fm",
|
||||
type: OptionType.BOOLEAN,
|
||||
default: true,
|
||||
},
|
||||
hideWithSpotify: {
|
||||
description: "hide last.fm presence if spotify is running",
|
||||
type: OptionType.BOOLEAN,
|
||||
default: true,
|
||||
},
|
||||
hidewithSpotifySFM: {
|
||||
description: "hide stats.fm presence if spotify is running",
|
||||
type: OptionType.BOOLEAN,
|
||||
default: true,
|
||||
},
|
||||
hideWithActivity: {
|
||||
description: "Hide Last.fm presence if you have any other presence",
|
||||
type: OptionType.BOOLEAN,
|
||||
default: false,
|
||||
},
|
||||
hideStatsfmWithExternalRPC: {
|
||||
description: "Hide Stats.fm presence if you have any other presence",
|
||||
type: OptionType.BOOLEAN,
|
||||
default: false,
|
||||
},
|
||||
enableGameActivity: {
|
||||
description: "Enable game activity for last.fm",
|
||||
type: OptionType.BOOLEAN,
|
||||
default: false,
|
||||
},
|
||||
enableGameActivitySFM: {
|
||||
description: "Enable game activity for stats.fm",
|
||||
type: OptionType.BOOLEAN,
|
||||
default: false,
|
||||
},
|
||||
statusName: {
|
||||
description: "custom status text",
|
||||
type: OptionType.STRING,
|
||||
|
@ -178,6 +261,11 @@ const settings = definePluginSettings({
|
|||
type: OptionType.BOOLEAN,
|
||||
default: false,
|
||||
},
|
||||
useStreamingStatus: {
|
||||
description: 'show "Streaming" status instead of "Playing"',
|
||||
type: OptionType.BOOLEAN,
|
||||
default: false,
|
||||
},
|
||||
missingArt: {
|
||||
description: "When album or album art is missing",
|
||||
type: OptionType.SELECT,
|
||||
|
@ -187,6 +275,11 @@ const settings = definePluginSettings({
|
|||
value: "lastfmLogo",
|
||||
default: true
|
||||
},
|
||||
{
|
||||
label: "Use Large Stats.fm logo",
|
||||
value: "StatsFMLogo",
|
||||
default: false
|
||||
},
|
||||
{
|
||||
label: "Use generic placeholder",
|
||||
value: "placeholder"
|
||||
|
@ -198,6 +291,11 @@ const settings = definePluginSettings({
|
|||
type: OptionType.BOOLEAN,
|
||||
default: true,
|
||||
},
|
||||
showStatsFMLogo: {
|
||||
description: "show the Stats.fm logo by the album cover",
|
||||
type: OptionType.BOOLEAN,
|
||||
default: false,
|
||||
},
|
||||
alwaysHideArt: {
|
||||
description: "Disable downloading album art",
|
||||
type: OptionType.BOOLEAN,
|
||||
|
@ -207,8 +305,8 @@ const settings = definePluginSettings({
|
|||
|
||||
export default definePlugin({
|
||||
name: "LastFMRichPresence",
|
||||
description: "Little plugin for Last.fm rich presence",
|
||||
authors: [Devs.dzshn, Devs.RuiNtD, Devs.blahajZip, Devs.archeruwu],
|
||||
description: "Little plugin for Last.fm rich presence + Stats.fm rich presence",
|
||||
authors: [Devs.dzshn, Devs.RuiNtD, Devs.blahajZip, Devs.archeruwu, EquicordDevs.Crxa],
|
||||
|
||||
settingsAboutComponent: () => (
|
||||
<>
|
||||
|
@ -223,6 +321,12 @@ export default definePlugin({
|
|||
|
||||
And copy the API key (not the shared secret!)
|
||||
</Forms.FormText>
|
||||
|
||||
<Forms.FormTitle tag="h3">How to get Stats.fm Presence!</Forms.FormTitle>
|
||||
<Forms.FormText>
|
||||
STATSFM ONLY:
|
||||
If you want to use stats.fm, you will need an account linked @ <Link href="https://stats.fm/login"></Link> and have your listening history public.
|
||||
</Forms.FormText>
|
||||
</>
|
||||
),
|
||||
|
||||
|
@ -236,7 +340,7 @@ export default definePlugin({
|
|||
stop() {
|
||||
clearInterval(this.updateInterval);
|
||||
},
|
||||
|
||||
// Last.fm Fetching
|
||||
async fetchTrackData(): Promise<TrackData | null> {
|
||||
if (!settings.store.username || !settings.store.apiKey)
|
||||
return null;
|
||||
|
@ -278,6 +382,33 @@ export default definePlugin({
|
|||
return null;
|
||||
}
|
||||
},
|
||||
// Stats.fm Fetching
|
||||
async fetchTrackDataStatsfm(): Promise<TrackData | null> {
|
||||
if (!settings.store.statsfmusername)
|
||||
return null;
|
||||
try {
|
||||
const res2 = await fetch(`https://api.stats.fm/api/v1/user/${settings.store.statsfmusername}/recent`);
|
||||
if (!res2.ok) throw `${res2.status} ${res2.statusText}`;
|
||||
|
||||
const json = await res2.json() as SFMR;
|
||||
if (!json.item) {
|
||||
logger.error("Error from Stats.fm API"), json;
|
||||
return null;
|
||||
}
|
||||
const trackData2 = json.item.track;
|
||||
if (!trackData2) return null;
|
||||
return {
|
||||
name: trackData2.name || "Unknown",
|
||||
album: trackData2.albums.map(a => a.name).join(", ") || "Unknown",
|
||||
artist: trackData2.artists[0].name ?? "Unknown",
|
||||
url: `https://stats.fm/track/${trackData2.id}`,
|
||||
imageUrl: trackData2.albums[0].image
|
||||
};
|
||||
} catch (e) {
|
||||
logger.error("Failed to query Stats.fm API, Report to Equicord Discord. https://discord.gg/equicord", e);
|
||||
return null;
|
||||
}
|
||||
},
|
||||
|
||||
async updatePresence() {
|
||||
setActivity(await this.getActivity());
|
||||
|
@ -293,13 +424,14 @@ export default definePlugin({
|
|||
|
||||
async getActivity(): Promise<Activity | null> {
|
||||
if (settings.store.hideWithActivity) {
|
||||
if (PresenceStore.getActivities().some(a => a.application_id !== applicationId)) {
|
||||
if (PresenceStore.getActivities().some(a => a.application_id !== applicationId && (!a.application_id2 || a.application_id2 !== applicationId2)))
|
||||
return null;
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
if (settings.store.hideWithSpotify) {
|
||||
if (PresenceStore.getActivities().some(a => a.type === ActivityType.LISTENING && a.application_id !== applicationId)) {
|
||||
if (PresenceStore.getActivities().some(a => (a.type === ActivityType.LISTENING || a.type === ActivityType.STREAMING) && a.application_id !== applicationId)) {
|
||||
// there is already music status because of Spotify or richerCider (probably more)
|
||||
return null;
|
||||
}
|
||||
|
@ -326,7 +458,21 @@ export default definePlugin({
|
|||
large_image: await getApplicationAsset("lastfm-large"),
|
||||
large_text: trackData.album || undefined,
|
||||
};
|
||||
|
||||
// Stats.fm image stuff
|
||||
const largeImage2 = this.getLargeImage(trackData);
|
||||
const assets2: ActivityAssets = largeImage2 ?
|
||||
{
|
||||
large_image: await getApplicationAsset2(largeImage2),
|
||||
large_text: trackData.album || undefined,
|
||||
...(settings.store.showStatsFMLogo && {
|
||||
small_image: await getApplicationAsset2("statsfm-large"),
|
||||
small_text: "Stats.fm"
|
||||
}),
|
||||
} : {
|
||||
large_image: await getApplicationAsset2("statsfm-large"),
|
||||
large_text: trackData.album || undefined,
|
||||
};
|
||||
const trackData2 = await this.fetchTrackDataStatsfm();
|
||||
const buttons: ActivityButton[] = [];
|
||||
|
||||
if (settings.store.shareUsername)
|
||||
|
@ -334,14 +480,24 @@ export default definePlugin({
|
|||
label: "Last.fm Profile",
|
||||
url: `https://www.last.fm/user/${settings.store.username}`,
|
||||
});
|
||||
|
||||
// Stats.fm settings
|
||||
if (settings.store.shareUsernameStatsfm)
|
||||
buttons.push({
|
||||
label: "Stats.fm Profile",
|
||||
url: `https://stats.fm/user/${settings.store.statsfmusername}`,
|
||||
});
|
||||
if (settings.store.StatsfmSong)
|
||||
buttons.push({
|
||||
label: "View Song",
|
||||
url: trackData.url,
|
||||
});
|
||||
if (settings.store.shareSong)
|
||||
buttons.push({
|
||||
label: "View Song",
|
||||
url: trackData.url,
|
||||
});
|
||||
|
||||
const statusName = (() => {
|
||||
const statusName = (() => { // Last.FM satus stuff dont touch
|
||||
switch (settings.store.nameFormat) {
|
||||
case NameFormat.ArtistFirst:
|
||||
return trackData.artist + " - " + trackData.name;
|
||||
|
@ -353,6 +509,17 @@ export default definePlugin({
|
|||
return trackData.name;
|
||||
case NameFormat.AlbumName:
|
||||
return trackData.album || settings.store.statusName;
|
||||
// Stats.fm Status stuff
|
||||
case NameFormat.ArtistFirst2: // hoping my code works
|
||||
return trackData2?.artist ? `${trackData2.artist} - ${trackData2.name}` : settings.store.statusName;
|
||||
case NameFormat.SongFirst2:
|
||||
return trackData2?.name ? `${trackData2.name} - ${trackData2.artist}` : settings.store.statusName;
|
||||
case NameFormat.ArtistOnly2:
|
||||
return trackData2?.artist ?? settings.store.statusName;
|
||||
case NameFormat.SongOnly2:
|
||||
return trackData2?.name ?? settings.store.statusName;
|
||||
case NameFormat.AlbumName2:
|
||||
return trackData2?.album ?? settings.store.statusName;
|
||||
default:
|
||||
return settings.store.statusName;
|
||||
}
|
||||
|
@ -360,18 +527,19 @@ export default definePlugin({
|
|||
|
||||
return {
|
||||
application_id: applicationId,
|
||||
application_id2: applicationId2, // StatsFM Appid
|
||||
name: statusName,
|
||||
|
||||
details: trackData.name,
|
||||
state: trackData.artist,
|
||||
assets,
|
||||
assets2, // StatsFM assets
|
||||
|
||||
buttons: buttons.length ? buttons.map(v => v.label) : undefined,
|
||||
metadata: {
|
||||
button_urls: buttons.map(v => v.url),
|
||||
},
|
||||
|
||||
type: settings.store.useListeningStatus ? ActivityType.LISTENING : ActivityType.PLAYING,
|
||||
type: settings.store.useStreamingStatus ? ActivityType.STREAMING : settings.store.useListeningStatus ? ActivityType.LISTENING : ActivityType.PLAYING,
|
||||
flags: ActivityFlag.INSTANCE,
|
||||
};
|
||||
}
|
||||
|
|
|
@ -433,7 +433,7 @@ export default definePlugin({
|
|||
|
||||
{
|
||||
// Updated message transformer(?)
|
||||
find: "THREAD_STARTER_MESSAGE?null===",
|
||||
find: "THREAD_STARTER_MESSAGE?null==",
|
||||
replacement: [
|
||||
{
|
||||
// Pass through editHistory & deleted & original attachments to the "edited message" transformer
|
||||
|
|
|
@ -134,7 +134,7 @@ export default definePlugin({
|
|||
{
|
||||
find: ",acceptInvite(",
|
||||
replacement: {
|
||||
match: /INVITE_ACCEPT_SUCCESS.+?,(\i)=null!==.+?;/,
|
||||
match: /INVITE_ACCEPT_SUCCESS.+?,(\i)=null!=.+?;/,
|
||||
replace: (m, guildId) => `${m}$self.applyDefaultSettings(${guildId});`
|
||||
}
|
||||
},
|
||||
|
|
|
@ -28,11 +28,11 @@ export default definePlugin({
|
|||
find: ".nsfwAllowed=null",
|
||||
replacement: [
|
||||
{
|
||||
match: /(?<=\.nsfwAllowed=)null!==.+?(?=[,;])/,
|
||||
match: /(?<=\.nsfwAllowed=)null!=.+?(?=[,;])/,
|
||||
replace: "true",
|
||||
},
|
||||
{
|
||||
match: /(?<=\.ageVerificationStatus=)null!==.+?(?=[,;])/,
|
||||
match: /(?<=\.ageVerificationStatus=)null!=.+?(?=[,;])/,
|
||||
replace: "3", // VERIFIED_ADULT
|
||||
}
|
||||
],
|
||||
|
|
|
@ -8,7 +8,6 @@ import { Settings } from "@api/Settings";
|
|||
import { makeLazy } from "@utils/lazy";
|
||||
import { Logger } from "@utils/Logger";
|
||||
import { interpolateIfDefined } from "@utils/misc";
|
||||
import { canonicalizeReplacement } from "@utils/patches";
|
||||
import { Patch, PatchReplacement } from "@utils/types";
|
||||
import { reporterData } from "debug/reporterData";
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue