five-on-it / packages/protocol/src/social / parseRoomCommand
Function: parseRoomCommand()
parseRoomCommand(
text): {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; } |undefined
Defined in: packages/protocol/src/social.ts:80
Parses a text frame as a room command; undefined when it is not one.
Parameters
text
string
Returns
{ 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; } | undefined