mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 00:24:47 -07:00
14 lines
673 B
TypeScript
14 lines
673 B
TypeScript
import { create } from '@bufbuild/protobuf';
|
|
import webClient from '../../WebClient';
|
|
import { Command_GetBanHistory_ext, Command_GetBanHistorySchema } from 'generated/proto/moderator_commands_pb';
|
|
import { ModeratorPersistence } from '../../persistence';
|
|
import { Response_BanHistory_ext } from 'generated/proto/response_ban_history_pb';
|
|
|
|
export function getBanHistory(userName: string): void {
|
|
webClient.protobuf.sendModeratorCommand(Command_GetBanHistory_ext, create(Command_GetBanHistorySchema, { userName }), {
|
|
responseExt: Response_BanHistory_ext,
|
|
onSuccess: (response) => {
|
|
ModeratorPersistence.banHistory(userName, response.banList);
|
|
},
|
|
});
|
|
}
|