{"id":17736197,"url":"https://github.com/whapi-cloud/whatsapp-simple-node-js-bot","last_synced_at":"2026-05-04T08:37:20.581Z","repository":{"id":259199115,"uuid":"876572777","full_name":"Whapi-Cloud/whatsapp-simple-node-js-bot","owner":"Whapi-Cloud","description":"A simple WhatsApp bot built with Node.js, perfect for beginners. It can respond to various commands using both text and images, providing an easy introduction to WhatsApp bot development.","archived":false,"fork":false,"pushed_at":"2024-10-22T11:25:41.000Z","size":111,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-23T11:13:45.063Z","etag":null,"topics":["guide","newbie","node-js","nodejs","script","whatsapp","whatsapp-api","whatsapp-automation","whatsapp-bot","whatsappbot"],"latest_commit_sha":null,"homepage":"https://whapi.cloud","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Whapi-Cloud.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-22T07:44:45.000Z","updated_at":"2024-10-22T20:07:06.000Z","dependencies_parsed_at":"2024-10-23T12:45:31.275Z","dependency_job_id":null,"html_url":"https://github.com/Whapi-Cloud/whatsapp-simple-node-js-bot","commit_stats":null,"previous_names":["whapi-cloud/whatsapp-simple-node-js-bot"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Whapi-Cloud%2Fwhatsapp-simple-node-js-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Whapi-Cloud%2Fwhatsapp-simple-node-js-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Whapi-Cloud%2Fwhatsapp-simple-node-js-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Whapi-Cloud%2Fwhatsapp-simple-node-js-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Whapi-Cloud","download_url":"https://codeload.github.com/Whapi-Cloud/whatsapp-simple-node-js-bot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246523896,"owners_count":20791444,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["guide","newbie","node-js","nodejs","script","whatsapp","whatsapp-api","whatsapp-automation","whatsapp-bot","whatsappbot"],"created_at":"2024-10-26T00:04:53.573Z","updated_at":"2025-10-25T09:15:10.253Z","avatar_url":"https://github.com/Whapi-Cloud.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple WhatsApp Bot - Node.js\n\nThis project is a simple WhatsApp bot built with **Node.js**. It’s an ideal solution for beginner developers looking to get started with WhatsApp bot development. The bot is capable of responding to several commands with both text and images.\n\n## Prerequisites\n\nBefore you get started, ensure that you have **Node.js** installed on your machine. If you haven't installed it yet, you can download it from the official [Node.js website](https://nodejs.org/).\n\n## Setup Instructions\n\nTo get the bot up and running, follow these steps:\n\n1. **Obtain an API token from [Whapi.Cloud](https://panel.whapi.cloud/register):**\n   - Once you have the token, insert it into the `config.json` file under the `token` field. To get started with Whapi.Cloud and find your token, check out this article: [Getting Started with Whapi.Cloud](https://support.whapi.cloud/help-desk/getting-started/getting-started).\n\n2. **Set up a webhook:**\n   - You will also need to provide a webhook URL in `config.json`. \n   - If you're unsure where to get a webhook URL, refer to our [Knowledge Base article](https://support.whapi.cloud/help-desk/receiving/webhooks/where-to-find-the-webhook-url).\n\n3. **Install dependencies and run the bot:**\n   - Run the following commands:\n     ```bash\n     npm install\n     npm run start\n     ```\n\n## Project Structure\n\n- **index.js:**\n  - This file checks the functionality of the WhatsApp channel and verifies the token. It also sets up the webhook through the API (there's no need to set up the webhook manually through the interface).\n  \n- **/modules/channel.ts:**\n  - Functions to check channel health (`checkHealth()`), send messages (`sendMessage()`), set the webhook (`setWebHook()`), check existing webhooks (`getWebHooks()`), and send images (`sendLocalJPG()`). The `sendLocalJPG()` function converts a JPG file from the `/images/` folder into Base64 format.\n\n- **/endpoints/hook.ts:**\n  - Contains the core bot logic:\n    - It listens for incoming messages and skips outgoing ones.\n    - It processes incoming messages, fetching the sender's number and text.\n    - Non-text messages are ignored.\n    - A switch-case logic is implemented to handle different incoming commands and respond accordingly.\n\n## Usage\n\nAfter setting up the bot, you can test its functionality by sending messages to the connected WhatsApp channel. Once the WhatsApp account is connected to the channel, it becomes a bot. To test it, send a message to the connected number from a different phone number. Depending on the command you send, the bot will respond with either text or an image.\n- On receiving the message `help`, the bot will reply with **Text1**.\n- For the message `command`, it will respond with **Text2**.\n- On the `image` command, it will send a message.\nYou will be able to change this yourself in the script.\n\n## Learn More\n\nFor a detailed walkthrough on how to configure and use this bot, check out our YouTube tutorial: [YouTube Video Link].\n\n---\n\n### Need Help?\n\nIf you have any questions or issues, feel free to refer to our [Knowledge Base](https://support.whapi.cloud/help-desk/source-code/whatsapp-chatbot/whatsapp-node-js-bot) or reach out to our support team at **care@whapi.cloud**.\n\nHappy Coding!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhapi-cloud%2Fwhatsapp-simple-node-js-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwhapi-cloud%2Fwhatsapp-simple-node-js-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhapi-cloud%2Fwhatsapp-simple-node-js-bot/lists"}