From b6580648042b260ba694ce18234bd2d49424352c Mon Sep 17 00:00:00 2001 From: Oj Date: Sun, 4 Apr 2021 22:17:50 +0100 Subject: [PATCH] [PCCompat > Global] api.commands.registerCommand: await executor incase async --- moduleWrappers/powercord/entities.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/moduleWrappers/powercord/entities.js b/moduleWrappers/powercord/entities.js index 7173cfb..4f85470 100644 --- a/moduleWrappers/powercord/entities.js +++ b/moduleWrappers/powercord/entities.js @@ -7,8 +7,10 @@ export const powercord = { // TODO: implement alias goosemodScope.patcher.commands.add(command, description, - ( { args: [ { text } ] } ) => { - const out = executor(text.split(' ')); // Run original executor func + async ( { args: [ { text } ] } ) => { + const out = await executor(text.split(' ')); // Run original executor func (await incase it's an async function) + + console.log(out); 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