mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-06 05:23:56 -07:00
14 lines
569 B
TypeScript
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);
|
|
},
|
|
}
|
|
);
|
|
}
|