From 5b1f81ae60292538649c9769e6c3088dc4d60822 Mon Sep 17 00:00:00 2001 From: Oj Date: Sun, 4 Apr 2021 21:30:43 +0100 Subject: [PATCH] [PCCompat > Global] api.commands.registerCommand: redo result implementation --- moduleWrappers/powercord/entities.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/moduleWrappers/powercord/entities.js b/moduleWrappers/powercord/entities.js index 140e91a..7173cfb 100644 --- a/moduleWrappers/powercord/entities.js +++ b/moduleWrappers/powercord/entities.js @@ -10,8 +10,12 @@ export const powercord = { ( { args: [ { text } ] } ) => { const out = executor(text.split(' ')); // Run original executor func - if (!out.send) return; // PC impl. sends internal message when out.send === true, so we also do the same via our previous Patcher API function, seen below - goosemodScope.patcher.internalMessage(out.result); + if (!out.send) return goosemodScope.patcher.internalMessage(out.result); // PC impl. sends internal message when out.send === false, so we also do the same via our previous Patcher API function + // When send is true, we send it as a message via returning obj with content + + return { + content: out.result + }; }, [ { type: 3, required: false, name: 'args', description: 'Arguments for PC command' } // Argument for any string for compat. with PC's classical commands ]);