Files
discord-decomp/modules/rpc/server/commands/voiceChannelChat.tsx
T
2026-11-01 12:12:55 +02:00

27 lines
859 B
TypeScript

// Metro module 13567 (f13568).
import { RPC_LOCAL_SCOPE } from "../../Constants";
import { RPCErrors, RPCCommands } from "../../../../Constants";
import createRpcJoiSchemaObject from "../../helpers/createRpcJoiSchemaObject";
import { toggleVoiceChannelChat } from "../../../calls/toggleVoiceChannelChat";
import RPCError from "../../RPCError";
const r19 = {};
r19[RPCCommands.TOGGLE_VOICE_CHANNEL_CHAT] = {
scope: RPC_LOCAL_SCOPE,
validation: (a0) => createRpcJoiSchemaObject(a0).keys({
open: a0.boolean()
}),
handler: (a0) => {
const r14 = toggleVoiceChannelChat(a0.args.open);
if (r14 == null) {
throw new RPCError({
errorCode: RPCErrors.INVALID_CHANNEL
}, "Not connected to a guild voice channel");
}
return {
channel_id: r14.channelId,
chat_open: r14.chatOpen
};
}
};
export default r19;