mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
19 lines
445 B
TypeScript
19 lines
445 B
TypeScript
import webClient from '../../WebClient';
|
|
|
|
export function roomSay(roomId: number, message: string): void {
|
|
const trimmed = message.trim();
|
|
|
|
if (!trimmed) {
|
|
return;
|
|
}
|
|
|
|
const CmdRoomSay = webClient.protobuf.controller.Command_RoomSay.create({
|
|
'message': trimmed
|
|
});
|
|
|
|
const rc = webClient.protobuf.controller.RoomCommand.create({
|
|
'.Command_RoomSay.ext': CmdRoomSay
|
|
});
|
|
|
|
webClient.protobuf.sendRoomCommand(roomId, rc);
|
|
}
|