SoundboardLogger: Fix Find

This commit is contained in:
thororen1234 2025-12-31 23:13:08 -05:00
parent ebc5c975dc
commit 40e62074a0
No known key found for this signature in database

View file

@ -6,11 +6,10 @@
import { playAudio } from "@api/AudioPlayer";
import { classNameFactory } from "@utils/css";
import { proxyLazy } from "@utils/lazy";
import { LazyComponent } from "@utils/react";
import { saveFile } from "@utils/web";
import type { User } from "@vencord/discord-types";
import { findByCode, findByProps, findByPropsLazy } from "@webpack";
import { findByCode, findByPropsLazy } from "@webpack";
import settings from "./settings";
@ -32,11 +31,11 @@ export interface SoundLogEntry extends SoundEvent {
}
export const cl = classNameFactory("vc-soundlog-");
const EmojiManager = findByPropsLazy("getEmojiColors", "getURL");
export function getEmojiUrl(emoji) {
const { getURL } = proxyLazy(() => findByProps("getEmojiColors", "getURL"));
if (!emoji) return getURL("❓"); // If the sound doesn't have a related emoji
return emoji.id ? `https://cdn.discordapp.com/emojis/${emoji.id}.png?size=32` : getURL(emoji.name);
if (!emoji) return EmojiManager.getURL("❓"); // If the sound doesn't have a related emoji
return emoji.id ? `https://cdn.discordapp.com/emojis/${emoji.id}.png?size=32` : EmojiManager.getURL(emoji.name);
}
export const playSound = id => {