fix(pk-compat-proxy): extracting message from proxied message

This commit is contained in:
Rye committed 2026-03-26 14:39:44 +01:00
1 parent 5f22d86a04
commit ba18d25bc2
2 files changed
+9

No files matched your search

+2
View File
@@ -728,6 +728,8 @@ export const RoomInput = forwardRef<HTMLDivElement, RoomInputProps>(
// check if its a pk command
if (pkCompatEnable && PKitCommandMessageHandler.isPKCommand(plainText)) {
pluralkitCmdMessageHandler.handleMessage(plainText);
resetEditor(editor); // clear the editor
return; // don't do anything besides handling the command
}
if (commandName) {
@@ -79,6 +79,13 @@ export class PKitProxyMessageHandler {
return getPerMessageProfileById(this.mx, profileId);
}
/**
* this runs synchronously, so it needs to be inited beforehand
*
* @param {string} message the message you want to extract from
* @return {*} {(string | undefined)} the message without the proxy
* @memberof PKitProxyMessageHandler
*/
public stripProxyFromMessage(message: string): string | undefined {
if (!this.succInit) throw new Error('PK proxy message handler is not initialized');
let m;