diff --git a/.DS_Store b/.DS_Store index 826a342..6f99bef 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/README.md b/README.md index a103886..b28b057 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ If you require more functionality than provided, it'll super easy for you to write an extension (More on this at the end). * __Install__ - Create and cd to your NPM project directory and then in terminal, write: ``` npm install github:adiwajshing/Baileys ``` + Create and cd to your NPM project directory and then in terminal, write: ``` npm install baileys ``` Then import in your code using: ``` javascript const WhatsAppWeb = require('Baileys') diff --git a/WhatsAppWeb.Query.js b/WhatsAppWeb.Query.js index 3803f5a..21b27a6 100644 --- a/WhatsAppWeb.Query.js +++ b/WhatsAppWeb.Query.js @@ -69,7 +69,7 @@ module.exports = { * @param {boolean} [mostRecentFirst] retreive the most recent message first or retreive from the converation start * @return {Promise} Promise of the messages loaded */ - loadConveration: function (jid, count, indexMessage=null, mostRecentFirst=true) { + loadConversation: function (jid, count, indexMessage=null, mostRecentFirst=true) { // construct JSON let json = [ "query", @@ -101,7 +101,7 @@ module.exports = { var offsetID = null const loadMessage = () => { - return this.getMessages(jid, chunkSize, offsetID, mostRecentFirst) + return this.loadConversation(jid, chunkSize, offsetID, mostRecentFirst) .then (json => { if (json[2]) { // callback with most recent message first (descending order of date) @@ -120,10 +120,10 @@ module.exports = { // if there are still more messages if (json[2].length >= chunkSize) { offsetID = lastMessage.key // get the last message - return new Promise ( (resolve, reject) => { + return new Promise ((resolve, reject) => { // send query after 200 ms setTimeout( () => loadMessage().then (resolve).catch(reject), 200) - } ) + }) } } }) diff --git a/WhatsAppWeb.js b/WhatsAppWeb.js index 747317c..91d6e94 100644 --- a/WhatsAppWeb.js +++ b/WhatsAppWeb.js @@ -237,7 +237,7 @@ WhatsAppWeb.prototype.getChats = query.getChats /** Query whether your phone is still connected to this WhatsApp Web */ WhatsAppWeb.prototype.isPhoneConnected = query.isPhoneConnected /** Load the conversation with a group or person */ -WhatsAppWeb.prototype.loadConveration = query.loadConveration +WhatsAppWeb.prototype.loadConversation = query.loadConversation /** Load the entire friggin conversation with a group or person */ WhatsAppWeb.prototype.loadEntireConversation = query.loadEntireConversation /** Create a group */