Cockatrice/webclient/src/websocket/commands/admin/adjustMod.ts
2026-04-16 12:40:47 -05:00

14 lines
569 B
TypeScript

import { create } from '@bufbuild/protobuf';
import { Command_AdjustMod_ext, Command_AdjustModSchema } from '@app/generated';
import { WebClient } from '../../WebClient';
export function adjustMod(userName: string, shouldBeMod?: boolean, shouldBeJudge?: boolean): void {
WebClient.instance.protobuf.sendAdminCommand(
Command_AdjustMod_ext,
create(Command_AdjustModSchema, { userName, shouldBeMod, shouldBeJudge }),
{
onSuccess: () => {
WebClient.instance.response.admin.adjustMod(userName, shouldBeMod, shouldBeJudge);
},
}
);
}