diff --git a/whatsapp-web.js/src/models/data.js b/whatsapp-web.js/src/models/data.js index d792761..2ec48b1 100644 --- a/whatsapp-web.js/src/models/data.js +++ b/whatsapp-web.js/src/models/data.js @@ -1,24 +1,23 @@ const { User } = require("./user"); const { Website } = require("./website"); -module.exports.data = new StructuredData(); class StructuredData { constructor() { this.data={}; } - + addUser(id){ if(this.data[id] != undefined) { this.data[id] = new User(id); return true } - + return false; } - + /** * * @param {number} id @@ -27,20 +26,22 @@ class StructuredData { getUser(id){ return this.data[id]; } - + deleteUser(id){ if(this.data[id] != undefined) { return delete this.data[id]; } - + return false; } - - + + } +module.exports.data = new StructuredData(); + /* data structured: data = { diff --git a/whatsapp-web.js/src/userInteraction/messages.js b/whatsapp-web.js/src/userInteraction/messages.js index e23b262..5884fee 100644 --- a/whatsapp-web.js/src/userInteraction/messages.js +++ b/whatsapp-web.js/src/userInteraction/messages.js @@ -28,7 +28,7 @@ const commands = [ -const onMessage = (message, client) => { +module.exports= onMessage = (message, client) => { let command = null; @@ -54,6 +54,6 @@ const onMessage = (message, client) => { }; -module.exports.onMessage = onMessage; + //export default onMessage; \ No newline at end of file