diff --git a/LICENSE b/website-generator/LICENSE similarity index 100% rename from LICENSE rename to website-generator/LICENSE diff --git a/whatsapp-web.js/website_test.js b/whatsapp-web.js/website_test.js index fa27168..29acc5c 100644 --- a/whatsapp-web.js/website_test.js +++ b/whatsapp-web.js/website_test.js @@ -83,6 +83,29 @@ client.on('message', async msg => cost = 0; product_image = ""; } + /* + ------------------------- Show Templates -------------------------------- + -> Returns all possible templates avaliable + */ + else if(msg.body == 'show templates') + { + request({ + url: process.argv[2]+"/template_info", + method: "GET", + headers: { + "content-type": "application/json", // <--Very important!!! + }, + body: j + }, function (error, response, body){ + // Gets Url from the Argument + for(var i = 0;i < JSON.parse(response.body).templates; i++){ + client.sendMessage(msg.from, process.argv[2] + "*Template name* : " + JSON.parse(response.body).templates[i].template_name); + client.sendMessage(msg.from, process.argv[2] + "/templates/" + JSON.parse(response.body).templates[i].template_name); + } + + }); + + } else if (msg.body.startsWith('product id:')) { id = check_id(msg.id.remote);