add support for emotes and running /commands
this does not yet include autocomplete for commands
This commit is contained in:
parent
cc82353d8f
commit
88cc1c428d
3 changed files with 86 additions and 27 deletions
|
@ -56,3 +56,15 @@ export function textSerialize(model) {
|
|||
}
|
||||
}, "");
|
||||
}
|
||||
|
||||
export function containsEmote(model) {
|
||||
const firstPart = model.parts[0];
|
||||
return firstPart && firstPart.type === "plain" && firstPart.text.startsWith("/me ");
|
||||
}
|
||||
|
||||
export function stripEmoteCommand(model) {
|
||||
// trim "/me "
|
||||
model = model.clone();
|
||||
model.removeText({index: 0, offset: 0}, 4);
|
||||
return model;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue