From e4df23516f058e7b7ebf33ca6a5b66c54c0795ea Mon Sep 17 00:00:00 2001 From: Mohammed Ashab Uddin Date: Thu, 6 Aug 2020 13:05:02 +0400 Subject: [PATCH] getInput needs await and message as parameter --- whatsapp-web.js/src/userInteraction/messages.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/whatsapp-web.js/src/userInteraction/messages.js b/whatsapp-web.js/src/userInteraction/messages.js index b54d477..b7d76df 100644 --- a/whatsapp-web.js/src/userInteraction/messages.js +++ b/whatsapp-web.js/src/userInteraction/messages.js @@ -188,7 +188,6 @@ const commands = [ ]; - module.exports= onMessage = async (message, client) => { let command = null; @@ -213,13 +212,12 @@ module.exports= onMessage = async (message, client) => { let input = {}; //check if the command requires input if(command.requireInput){ - input = command.getInput(message.body); + input = await command.getInput(message); } //determine the user logic.setUser(message.id.remote); //determine the input logic.setInput(input); - //call callback function in the command //await is used, so that if a command is an async function //the program will wait until it is finished