Cockatrice/webclient/src/websocket/commands/admin/adjustMod.ts
2026-04-14 14:39:46 -05:00

12 lines
589 B
TypeScript

import { create } from '@bufbuild/protobuf';
import webClient from '../../WebClient';
import { Command_AdjustMod_ext, Command_AdjustModSchema } from 'generated/proto/admin_commands_pb';
import { AdminPersistence } from '../../persistence';
export function adjustMod(userName: string, shouldBeMod?: boolean, shouldBeJudge?: boolean): void {
webClient.protobuf.sendAdminCommand(Command_AdjustMod_ext, create(Command_AdjustModSchema, { userName, shouldBeMod, shouldBeJudge }), {
onSuccess: () => {
AdminPersistence.adjustMod(userName, shouldBeMod, shouldBeJudge);
},
});
}