fix VoiceMessages plugin

This commit is contained in:
Vendicated 2026-01-28 03:15:58 +01:00
parent 2ffa14fe2b
commit d8dbbf0c81
No known key found for this signature in database
GPG key ID: D66986BAF75ECF18
2 changed files with 9 additions and 8 deletions

View file

@ -32,7 +32,7 @@ import definePlugin from "@utils/types";
import { chooseFile } from "@utils/web";
import { CloudUpload as TCloudUpload } from "@vencord/discord-types";
import { CloudUploadPlatform } from "@vencord/discord-types/enums";
import { findCssClassesLazy, findLazy, findStoreLazy } from "@webpack";
import { findLazy, findStoreLazy } from "@webpack";
import { Button, Constants, FluxDispatcher, Forms, lodash, Menu, MessageActions, PermissionsBits, PermissionStore, RestAPI, SelectedChannelStore, showToast, SnowflakeUtils, Toasts, useEffect, useState } from "@webpack/common";
import { ComponentType } from "react";
@ -43,7 +43,6 @@ import { VoiceRecorderWeb } from "./WebRecorder";
const CloudUpload: typeof TCloudUpload = findLazy(m => m.prototype?.trackUploadFinished);
const PendingReplyStore = findStoreLazy("PendingReplyStore");
const OptionClasses = findCssClassesLazy("optionName", "optionIcon", "optionLabel");
export const cl = classNameFactory("vc-vmsg-");
export type VoiceRecorder = ComponentType<{
@ -59,12 +58,12 @@ const ctxMenuPatch: NavContextMenuPatchCallback = (children, props) => {
children.push(
<Menu.MenuItem
id="vc-send-vmsg"
label={
<div className={OptionClasses.optionLabel}>
<Microphone className={OptionClasses.optionIcon} height={24} width={24} />
<div className={OptionClasses.optionName}>Send Voice Message</div>
</div>
}
iconLeft={Microphone}
leadingAccessory={{
type: "icon",
icon: Microphone
}}
label="Send Voice Message"
action={() => openModal(modalProps => <Modal modalProps={modalProps} />)}
/>
);

View file

@ -598,6 +598,8 @@ export function findCssClasses<S extends string>(...classes: S[]): Record<S, str
if (!res) {
handleModuleNotFound("findCssClasses", ...classes);
if (IS_REPORTER) return null as any;
return {} as Record<S, string>;
}