mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
16 lines
558 B
TypeScript
16 lines
558 B
TypeScript
import { create } from '@bufbuild/protobuf';
|
|
import { Data } from '@app/types';
|
|
import webClient from '../../WebClient';
|
|
import { AdminPersistence } from '../../persistence';
|
|
|
|
export function adjustMod(userName: string, shouldBeMod?: boolean, shouldBeJudge?: boolean): void {
|
|
webClient.protobuf.sendAdminCommand(
|
|
Data.Command_AdjustMod_ext,
|
|
create(Data.Command_AdjustModSchema, { userName, shouldBeMod, shouldBeJudge }),
|
|
{
|
|
onSuccess: () => {
|
|
AdminPersistence.adjustMod(userName, shouldBeMod, shouldBeJudge);
|
|
},
|
|
}
|
|
);
|
|
}
|