feat(plugin): StatsFM
Some checks are pending
Test / Test (push) Waiting to run

by crxa's order x2
This commit is contained in:
Cortex 2025-04-06 17:35:24 -06:00
parent 507edbbe5b
commit 078eba2f02
8 changed files with 402 additions and 15 deletions

View file

@ -50,4 +50,4 @@ export default definePlugin({
if (this.css) this.css.remove();
}
});
});

View file

@ -4,10 +4,10 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
import FriendCodesPanel from "./FriendCodesPanel";
import { Devs } from "@utils/constants";
export default definePlugin({
name: "FriendCodes",

View file

@ -7,9 +7,7 @@
import "./styles.css";
import { classNameFactory } from "@api/Styles";
import { proxyLazy } from "@utils/lazy";
import { findComponentByCodeLazy } from "@webpack";
import { Forms } from "@webpack/common";
import { ComponentType, HTMLAttributes } from "react";
export enum SpinnerTypes {

View file

@ -255,7 +255,7 @@ export default definePlugin({
replacement: {
match: /(?<=className:\i\}\))/,
replace: ",onClick:()=>$self.openCompleteQuestUI()"
},
},
predicate: () => settings.store.clickableQuestDiscovery
}
],

View file

@ -48,11 +48,11 @@ export async function fetchImageAsBlob(url: string): Promise<Blob> {
if (!url) throw new Error("Invalid URL: URL is empty or undefined");
const response = await fetch(url, {
mode: 'cors',
cache: 'no-cache',
credentials: 'same-origin',
mode: "cors",
cache: "no-cache",
credentials: "same-origin",
headers: {
'Accept': 'image/*'
"Accept": "image/*"
}
});
@ -72,7 +72,7 @@ export async function fetchImageAsBlob(url: string): Promise<Blob> {
0x05, 0x00, 0x01, 0x0D, 0x0A, 0x2D, 0xB4, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4E, 0x44, 0xAE,
0x42, 0x60, 0x82
])
], { type: 'image/png' });
], { type: "image/png" });
}
}

View file

@ -24,7 +24,7 @@ import {
UserStore,
} from "@webpack/common";
///
// /
// Create an in-memory cache (temporary, lost on restart)
const ttsCache = new Map<string, string>();
@ -68,7 +68,7 @@ async function setCachedVoiceInDB(cacheKey: string, blob: Blob): Promise<void> {
});
}
///
// /
interface VoiceState {
userId: string;
channelId?: string;
@ -88,7 +88,7 @@ const VoiceStateStore = findByPropsLazy(
// Filtering out events is not as simple as just dropping duplicates, as otherwise mute, unmute, mute would
// not say the second mute, which would lead you to believe they're unmuted
///
// /
async function speak(text: string) {
if (text.trim().length === 0) return;
@ -169,7 +169,7 @@ async function speak(text: string) {
audio.play();
}
///
// /
function clean(str: string) {
const replacer = settings.store.latinOnly
? /[^\p{Script=Latin}\p{Number}\p{Punctuation}\s]/gu