# Start bot with PM2
pm2 start index.js --name "whatsapp-bot"
nano .gitignore
Add:
node_modules/
auth_info.json
session/
*.log
.env
.DS_Store
Meta Description: Learn how to create a powerful WhatsApp bot using Termux on Android and open-source code from GitHub. Step-by-step guide, legal notes, and top repository recommendations.
QR Code not showing:
# Clear session and restart
rm -rf auth_info.json
node index.js
Connection issues:
# Update Node.js
pkg update
pkg upgrade nodejs-lts
git clone https://github.com/TheSpex/Whatsapp-bot.git
cd Whatsapp-bot
# Create repository on GitHub first, then:
git remote add origin https://github.com/yourusername/your-bot-repo.git
git branch -M main
git push -u origin main
Edit the config.js or .env file using Nano:
nano config.js
Set the bot name, owner number, and prefix (e.g., ! or .).
"Bot WhatsApp Termux GitHub" encapsulates a pragmatic, mobile-first approach to building messaging automations: powerful, low-cost, and community-driven, but inherently fragile and fraught with policy, reliability, and security trade-offs. The responsible path favors official APIs, secure practices, and clear ethical boundaries while using Termux and GitHub for fast prototyping and collaboration.
If you'd like, I can:
Creating a WhatsApp Bot using Termux and GitHub: A Step-by-Step Guide
In recent years, WhatsApp has become an essential platform for communication, with billions of users worldwide. With the rise of chatbots, many developers have started creating automated bots to interact with users on WhatsApp. In this article, we will explore how to create a WhatsApp bot using Termux, a popular Android terminal emulator, and GitHub, a web-based platform for version control and collaboration.
Prerequisites
Before we dive into the process, make sure you have the following:
Step 1: Setting up Termux
Termux is a terminal emulator that allows you to run Linux commands on your Android device. If you haven't installed Termux yet, download it from the Google Play Store or F-Droid.
Once installed, open Termux and grant the necessary permissions. You will see a command-line interface where you can type commands.
Step 2: Installing Dependencies
To create a WhatsApp bot, we need to install some dependencies. Run the following commands in Termux:
pkg update
pkg upgrade
pkg install nodejs
pkg install git
These commands update the package list, upgrade the packages, and install Node.js and Git.
Step 3: Creating a GitHub Repository
Create a new repository on GitHub and initialize it with a README file. You can do this by following these steps:
Step 4: Cloning the Repository
In Termux, navigate to the directory where you want to clone the repository. Run the following command:
git clone https://github.com/your-username/your-repo-name.git
Replace your-username and your-repo-name with your actual GitHub username and repository name.
Step 5: Creating the WhatsApp Bot
We will use the whatsapp-web.js library to create our WhatsApp bot. Run the following command in the repository directory:
npm install whatsapp-web.js
Create a new file called bot.js and add the following code:
const Client = require('whatsapp-web.js');
const client = new Client();
client.on('ready', () =>
console.log('Client is ready!');
);
client.on('message', (message) =>
if (message.body === 'hello')
message.reply('Hello! How can I assist you today?');
);
client.start();
This code creates a basic WhatsApp bot that responds to the message "hello."
Step 6: Configuring the Bot
To configure the bot, you need to create a config.json file in the repository directory. Add the following code:
"number": "your-phone-number",
"password": "your-whatsapp-password"
Replace your-phone-number and your-whatsapp-password with your actual WhatsApp phone number and password.
Step 7: Running the Bot
Run the bot using the following command:
node bot.js
The bot will start and connect to WhatsApp. You can test the bot by sending a message to the bot's phone number.
Step 8: Deploying the Bot
To deploy the bot, you can use a service like Heroku or Vercel. Create a new file called Procfile and add the following code:
web: node bot.js
This file specifies the command to run when deploying the bot.
Step 9: Integrating with GitHub Actions
To automate the deployment process, you can use GitHub Actions. Create a new file called .github/workflows/deploy.yml and add the following code:
name: Deploy Bot
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install dependencies
run: npm install
- name: Deploy bot
run: node bot.js
This file specifies the workflow to deploy the bot when pushing code to the main branch.
Conclusion
In this article, we created a WhatsApp bot using Termux, GitHub, and Node.js. We set up a GitHub repository, cloned it to Termux, and created a basic WhatsApp bot. We then configured the bot, ran it, and deployed it using GitHub Actions.
This is just a basic example to get you started. You can extend the bot's functionality by adding more features, such as natural language processing, machine learning, or integrating with other services.
Additional Resources
Running a WhatsApp bot via Termux on Android involves using Git to clone repositories from GitHub and running them with Node.js, allowing for automation features like sticker creation, media conversion, and group management. Users must install prerequisites like Termux and FFmpeg, clone a repository (e.g., jlucaso1/termux-whatsapp-bot
), and scan a QR code in the terminal to link their account. jlucaso1/termux-whatsapp-bot - GitHub
Building a WhatsApp Bot with Termux and GitHub Deploying a WhatsApp bot directly from your Android device using Termux is a popular way to automate chats without needing a dedicated server. By leveraging open-source scripts on GitHub, you can set up powerful automation tools ranging from simple auto-responders to AI-driven assistants. Prerequisites Before starting, ensure your environment is ready:
Android Device: With Termux installed (preferably the version from F-Droid for better compatibility).
WhatsApp Account: A secondary account is recommended to avoid potential spam bans.
Stable Internet: Required for cloning repositories and keeping the bot online. Step-by-Step Installation
Update EnvironmentOpen Termux and ensure all packages are up to date: pkg update && pkg upgrade Use code with caution. Copied to clipboard
Install Required PackagesYou will need git to clone scripts from GitHub and nodejs (or python) depending on the bot's language: pkg install git nodejs -y Use code with caution. Copied to clipboard
Clone a Bot RepositorySearch GitHub for popular repositories like Cheems-Bot or Hizumi-Bot. Once you find one, clone it: git clone cd Use code with caution. Copied to clipboard
Install DependenciesMove into the bot's directory and install the necessary libraries: npm install Use code with caution. Copied to clipboard
Connect Your AccountStart the bot script. It will typically generate a QR code in the terminal. Open WhatsApp on your phone. Navigate to Settings > Linked Devices.
Scan the QR code displayed in the Termux terminal to link the bot. Common Commands
Once active, most GitHub-based bots use a prefix (like . or !) to trigger actions: .menu: Displays all available bot features. .owner: Shows contact info for the bot creator. .sticker: Converts an image into a WhatsApp sticker. Important Safety Tips
Avoid Spam: Sending unsolicited messages can lead to an immediate account ban by WhatsApp.
Stay Updated: Regularly pull updates from the original GitHub repository (git pull) to fix bugs and security vulnerabilities.
Battery Optimization: Disable "Battery Optimization" for Termux in your phone settings to prevent the bot from going offline when the screen is off. How to Deploy a WhatsApp Bot on GitHub for Free
Introduction
WhatsApp bots have become increasingly popular for automating tasks, providing customer support, and even entertainment. In this article, we'll explore how to create a WhatsApp bot using Termux, a terminal emulator for Android, and GitHub, a web-based platform for version control and collaboration.
Prerequisites
Step 1: Set up Termux
Step 2: Create a WhatsApp bot
const Client = require('whatsapp-web.js');
const client = new Client(
// Your WhatsApp number with country code (e.g., +14155552671)
phone: 'YOUR_PHONE_NUMBER',
// Your WhatsApp bot's name
name: 'My WhatsApp Bot',
);
client.on('message', (message) =>
console.log(`Received message: $message.body`);
// Process incoming messages here
);
client.start();
Replace YOUR_PHONE_NUMBER with your WhatsApp number and My WhatsApp Bot with your bot's name.
Step 3: Connect to WhatsApp
Step 4: Host your bot on GitHub
Step 5: Automate your bot
Tips and Variations
Conclusion
In this article, we've created a basic WhatsApp bot using Termux and GitHub. With these steps, you can automate tasks, provide customer support, or even build a simple chatbot. Remember to explore more advanced features and libraries to enhance your bot's capabilities.
Resources
Running a WhatsApp bot through Termux using scripts from GitHub is a popular way to automate tasks like sticker making, auto-responding, and media downloading directly from your Android device. 🛠️ Essential Setup Requirements
Before you can run any GitHub script, you need to prepare the Termux environment with these core tools: Git: To clone (download) the bot repositories.
Node.js: Most modern WhatsApp bots use the Baileys or whatsapp-web.js libraries, which require Node.
FFmpeg: Necessary for bots that handle media, such as converting videos to GIFs or stickers. Libwebp: Required specifically for sticker generation. 🚀 Step-by-Step Installation
To get started, open Termux and run these commands one by one: Update Packages: pkg update && pkg upgrade Install Tools: pkg install git nodejs ffmpeg libwebp -y Clone a Bot: git clone [GITHUB_URL] Enter Directory: cd [REPOSITORY_NAME] Install Dependencies: npm install Start the Bot: node index.js (or npm start) 📦 Top GitHub Repositories for Termux
You can find various bot scripts on GitHub by searching for these popular "bases":
Termux-whatsapp-bot: A specialized script for creating stickers from photos and videos.
WA-BOT Base: A versatile multi-device (MD) bot supporting text-to-speech and media conversion.
Knightbot-MD: Known for easy deployment and "Pair Code" linking, which avoids the need for a second device to scan a QR code. ⚠️ Important Considerations
Linking: You will usually need to scan a QR code using the "Linked Devices" feature in your WhatsApp settings.
Session ID: Some bots, like those from GlobalTechInfo, use a "Session ID" so you don't have to re-scan every time the app restarts.
Ban Risk: WhatsApp's terms of service generally discourage unofficial bots. To stay safe, avoid spamming or using the bot in too many large groups simultaneously.
💡 Pro Tip: Keep your bot running in the background by using the termux-wake-lock command to prevent Android from killing the process when the screen is off.
Running a feature-complete WhatsApp bot through Termux via a GitHub repository allows you to automate your account directly from your Android device. Most modern "Full Feature" bots use the Baileys library for multi-device support, meaning the bot stays online even if your phone's screen is off. Core Features
"Complete" bots typically have over 200 commands. These commands are in categories like group management, media processing, and AI. Group Management:
Admin tools: Tag all members (.tagall), promote/demote, and kick.
Automated security: Anti-link (blocks unwanted URLs), anti-spam, and anti-delete (recovers deleted messages). Media & Fun:
Sticker maker: Converts images/videos into stickers instantly (.sticker).
Downloader: Saves videos and photos from platforms like Instagram, TikTok, and YouTube. Games: Interactive group games like Tic-Tac-Toe. AI & Utilities:
AI Chatbot: Integration with ChatGPT or Gemini for smart responses.
Tools: Text-to-Speech (.tts), weather updates, and image generation. Recommended GitHub Repositories for Termux Bot Name GitHub Link rishabhsahilll/AI-Jarvis-WhatsApp-Bot AI-powered fun and mobile system controls. KnightBot-MD mruniquehacker/Knightbot-md Group administration and security. Tohidkhan6332/TOHID-AI Massive toolkit with auto-view status and media downloads. Termux Installation
To set up a bot on Termux, update the environment and install necessary dependencies:
Running a WhatsApp bot through repository is a popular way to automate tasks like creating stickers, managing groups, or setting up auto-responders directly from an Android device 🛠️ Prerequisites
Before starting, ensure you have these essentials installed on your device: Termux App : Use the version from official Termux Wiki
rather than the Play Store, as the latter is often outdated. GitHub Account : Needed to find and fork your preferred bot repository. Stable Internet
: Crucial for downloading dependencies and maintaining the bot session. 🚀 Setup Guide
Follow these standard terminal commands to get your bot running: Update System Packages pkg update && pkg upgrade -y Use code with caution. Copied to clipboard Install Required Tools
Most bots require Node.js, Git, and FFmpeg (for media/stickers). pkg install git nodejs ffmpeg imagemagick -y Use code with caution. Copied to clipboard Clone a Bot Repository Find a reliable bot on GitHub (e.g., termux-whatsapp-bot ) and clone it.
Creating a personal WhatsApp bot using on Android is a popular way to automate tasks like creating stickers, downloading media, or managing group chats without needing a dedicated server. Why Use Termux for WhatsApp Bots?
Termux is a terminal emulator for Android that allows you to run a Linux environment on your phone. This makes it possible to host a bot directly from your mobile device. By leveraging repositories from , you can quickly deploy bots that use the Baileys library whatsapp-web.js to interact with the WhatsApp Web API. Popular GitHub Repositories termux-whatsapp-bot
: A straightforward bot specifically optimized for Termux, featuring a built-in sticker maker.
: A feature-rich base that includes tools for media conversion, group management (kick/add), and text-to-speech.
: A "next generation" multi-device bot with AI replies and dynamic plugin support. How to Install a Bot on Termux
Most GitHub-based WhatsApp bots follow a similar installation pattern: Update Packages : Open Termux and run: pkg update && pkg upgrade Install Dependencies : Most bots require (for stickers/video): pkg install git nodejs ffmpeg -y Clone the Repository git clone Install Node Modules cd && npm install Run the Bot node index.js Key Features to Look For Sticker Tools
: Convert images, GIFs, and videos into WhatsApp stickers instantly. Media Downloader
: Automated tools to download YouTube videos, Instagram reels, or TikToks directly in the chat. Group Management
: Commands to tag all members, open/close groups, or promote/demote admins. Multi-Device Support
: Newer bots use "Session IDs," allowing them to stay connected even if your phone goes offline after the initial setup. Important Safety Tips whatsapp-bot · GitHub Topics