decord/source/modules/rpc/server/commands/voiceChannelChat.tsx
github-actions 03cf168fbc chore: update source for alpha 347.3
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4825.js (118.4 MB)
2026-09-17 08:17:09 +00:00

36 lines
1.3 KiB
TypeScript

// Module ID: 14636
// Function ID: 14637
// Name: voiceChannelChat
// Dependencies: [4544, 1074, 9711, 14637, 9708, 2]
// Module 14636 (voiceChannelChat)
import Constants2 from "Constants" /* 4544 */;
import RPCErrorDefault from "RPCError" /* 9708 */;
import createRpcJoiSchemaObjectDefault from "createRpcJoiSchemaObject" /* 9711 */;
import toggleVoiceChannelChat from "toggleVoiceChannelChat" /* 14637 */;
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 };
}
}
}
};