Skip to content

five-on-it / packages/protocol/src/social / encodeRoomCommand

Function: encodeRoomCommand() ​

encodeRoomCommand(command): string

Defined in: packages/protocol/src/social.ts:75

Serializes a room command as a text frame.

Parameters ​

command ​

{ op: "say"; text: string; type: "room"; } | { op: "quick"; phrase: "wait" | "follow" | "go" | "hello" | "thanks" | "sorry" | "help" | "nice"; type: "room"; } | { emote: "wave" | "laugh" | "shrug" | "facepalm" | "clap" | "thumbsUp"; op: "emote"; type: "room"; } | { op: "voteKick"; target: number; type: "room"; } | { op: "vote"; type: "room"; yes: boolean; }

Returns ​

string