diff --git a/README.md b/README.md index 0a1f1c1..68a0da1 100644 --- a/README.md +++ b/README.md @@ -53,10 +53,10 @@ macOS | Windows | Linux ## Supported Platforms Following platforms are supported by Wbot: -**macOS** +**macOS:** The minimum version supported is macOS 10.9. -**Windows** +**Windows:** Windows 7 and later are supported. **Linux:** @@ -69,7 +69,7 @@ Windows 7 and later are supported. ### STEPS -After downloading, extract the zip file and navigate to that location in your terminal. There will be a file named wbot-* . Run it and you should be good to go. +After downloading, extract the zip file and navigate to that location in your terminal. There will be a file named ```wbot-*``` . Run it and you should be good to go. For Linux you need to provide executable permission before you execute the binary. Run the command - @@ -77,14 +77,14 @@ Run the command - chmod +x wbot-linux && wbot-linux ``` -Note: on Linux you need a running display server (X11 or Wayland). -If you run Linux on a headless server or wan't to run chmomium without visible display try ```xvfb-run wbot-linux```. +Note: On Linux you need a running display server (X11 or Wayland). +If you run Linux on a headless server or want to run chmomium without visible display try ```xvfb-run wbot-linux```. *I haven't tested Mac and Linux binaries. If you find any issues using them feel free to raise one from [here](https://github.com/vasani-arpit/WBOT/issues/new)* ### Configurations -Basic configuration is in bot.json file like replying to Hi, hello and happy birthday. You can add/remove yours if you need. Keep in mind that you need to restart the wbot to see the effects of your changes. Make sure the JSON is valid. Use VSCode or [jsonlint](https://jsonlint.com/) to validate the JSON. +Basic configuration is in ```bot.json``` file like replying to ```Hi, hello and happy birthday```. You can change this config file as per your need. Keep in mind that you need to restart the wbot to see the effects of your changes. Make sure the JSON is valid. Use VSCode or [jsonlint](https://jsonlint.com/) to validate the JSON. ### bot.json @@ -92,29 +92,29 @@ Basic configuration is in bot.json file like replying to Hi, hello and happy bir This is where all the application related (node application behavior and such things) config will stay. Will add more in future. -- **headless** whether to start chrome as headless or not. this is regarding #4. Apparently, Whatsapp doesn't allow headless instances. -- **isGroupReply** whether to send replies in group or not. If set to false, Bot will not reply if message received in group chat. +- **headless:** whether to start chrome as headless or not. this is regarding #4. Apparently, Whatsapp doesn't allow headless instances. +- **isGroupReply:** whether to send replies in group or not. If set to false, Bot will not reply if message received in group chat. -- **webhook** A URL which will be called for every message with payload data. this can be useful if you want do other operation over messages in your server. for example server code take a look [here](https://github.com/vasani-arpit/WBOT/blob/master/docs/Webhook-example.md) +- **webhook:** A URL which will be called for every message with payload data. This can be useful if you want to do other operation over messages in your server. For example: server code take a look [here](https://github.com/vasani-arpit/WBOT/blob/master/docs/Webhook-example.md) -- **downloadMedia** Whether to download incoming message media or not. +- **downloadMedia:** Whether to download incoming message media or not. -- **replyUnreadMsg** If there are pending unread messages which bot hasn't replied to then by making this flag true bot will respond to those messages. Keep in mind that bot will not be able to mark those messages as read/seen. Please open the chat manually in the phone to mark that chat as read other wise bot will reply to it at every start. +- **replyUnreadMsg:** If there are pending unread messages which bot hasn't replied to then by making this flag true, bot will respond to those messages. Keep in mind that bot will not be able to mark those messages as read/seen. Please open the chat manually in the phone to mark that chat as read otherwise bot will reply to it at every start. **bot** An array of objects. Properties of Object are self explanatory. -- **Contains** If message has one of that word anywhere in the message -- **exact** If message is exactly as one of the messages form array +- **Contains:** If message has one of that word anywhere in the message +- **exact:** If message is exactly as one of the messages form array -- **Response** If any of the above conditions becomes true then corresponding response string or [spintax](https://spintaxtool.appspot.com/) will be sent as message to the user or group. there is two variables name and phoneNumber which you can use to create custom message for sender. sample message with variable is in `bot.json` +- **Response:** If any of the above conditions becomes true then corresponding response string or [spintax](https://spintaxtool.appspot.com/) will be sent as message to the user or group. There are two variable: `name` and `phoneNumber` which you can use to create custom message for sender. Sample message with variable is in `bot.json`. -- **file** name of the file (from current directory) which you want to send along with response +- **file:** Name of the file (from current directory) which you want to send along with response. -- **afterSeconds** number of seconds bot should wait before sending a reply. -- **Webhook** you can call your webhook on certain keywords as well instead of calling it on every message. -- **responseAsCaption** this will be applied in case you want to reply with image. If true then response block will be sent as a caption of the image. If false response block will be shared as separate text message. +- **afterSeconds:** Number of seconds bot should wait before sending a reply. +- **Webhook:** You can call your webhook on certain keywords as well instead of calling it on every message. +- **responseAsCaption:** This will be applied in case you want to reply with image. If true then response block will be sent as a caption of the image. If false then response block will be shared as separate text message. **Blocked** @@ -122,7 +122,7 @@ Array of numbers with county code to which this bot will not reply to. **noMatch** -Default reply message or [spintax](https://spintaxtool.appspot.com/) when no exact match found in BOT +Default reply message or [spintax](https://spintaxtool.appspot.com/) when no exact match found in WBOT **smartreply** *(This feature is under maintenance at the moment.)* @@ -136,11 +136,11 @@ here is how that looks ![smart reply gif](https://user-images.githubusercontent.com/6497827/58412366-f1653380-8093-11e9-8427-1ca19235faed.gif) -## Run the latest code from github +## Run the latest code from Github -**This is only recommended for advanced 'node.js' users.** +**This is only recommended for advanced 'node.js' users or development purpose.** -open a Terminal and create a new directory in your home directory, e.g. 'node' and goto there. +Open a Terminal and create a new directory in your home directory, e.g. 'node' and goto there. Now download and run the latest code from github by: ``` @@ -150,7 +150,7 @@ npm install node src/index.js ``` -If you run Linux on a headless server or wan't to run chmomium without visible display try ```xvfb-run wbot-linux```. +If you run Linux on a headless server or want to run chromium without visible display try ```xvfb-run wbot-linux```. ## Known bugs Sometimes, closing the `node` server directly does not clear browser cache. Next time when the bot is started, it runs into errors due to which smart reply is not setup correctly. A temporary fix to this is to clear `node` cache. diff --git a/package-lock.json b/package-lock.json index c840c87..58f4ec1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "wbot", - "version": "0.20.0", + "version": "0.21.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 71586f9..98d3583 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wbot", - "version": "0.20.0", + "version": "0.21.0", "description": "A simple whatsapp reply bot using puppeteer.", "main": "src/index.js", "scripts": {