decord/source/modules/rpc/server/commands/voiceChannelChat.tsx
github-actions ecf26fc058 chore: update source for alpha 347.2
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4823.js (118.4 MB)
2026-09-16 07:03:15 +00:00

36 lines
1.3 KiB
TypeScript

// Module ID: 14628
// Function ID: 14629
// Name: voiceChannelChat
// Dependencies: [4542, 1074, 9700, 14629, 9697, 2]
// Module 14628 (voiceChannelChat)
import Constants2 from "Constants" /* 4542 */;
import RPCErrorDefault from "RPCError" /* 9697 */;
import createRpcJoiSchemaObjectDefault from "createRpcJoiSchemaObject" /* 9700 */;
import toggleVoiceChannelChat from "toggleVoiceChannelChat" /* 14629 */;
import Constants from "Constants" /* 1074 */;
import size from "module_2" /* 2 */;
const RPCErrors = Constants.RPCErrors;
let result = size.fileFinishedImporting("modules/rpc/server/commands/voiceChannelChat.tsx");
export default {
[Constants.RPCCommands.TOGGLE_VOICE_CHANNEL_CHAT]: {
scope: Constants2.RPC_LOCAL_SCOPE,
validation(boolean) {
const obj = createRpcJoiSchemaObjectDefault(boolean);
return obj.keys({ open: boolean.boolean() });
},
handler(args) {
const result = toggleVoiceChannelChat.toggleVoiceChannelChat(args.args.open);
if (null == result) {
const obj3 = { errorCode: RPCErrors.INVALID_CHANNEL };
const tmp8 = new RPCErrorDefault(obj3, "Not connected to a guild voice channel");
throw tmp8;
} else {
({ channelId: obj2.channel_id, chatOpen: obj2.chat_open } = result);
return { channel_id: null, chat_open: null };
}
}
}
};