WhatsApp Message Using CommandLine

Introduction

In this article, we will learn how to send WhatsApp messages using Command Line. To achieve this we have used MudSlide Tools. The Mudslide tool can send WhatsApp messages from the Command Line.

It is based on Bailey's WhatsApp API Library. 

Now to run this we need command NPX. We have created a typescript project. I have uploaded the code, you can download it and use it.

STEP 1

Install Mudslide tools, Install only Nodejs 16 or higher version

Command

npm install -g mudslide

WhatsApp Message Using CommandLine

STEP 2

Check the version and confirm that this tool is installed

Command

npx mudslide -V 

WhatsApp Message Using CommandLine

STEP 3

Command List of mudslide

Command

npx mudslide --help

WhatsApp Message Using CommandLine

STEP 4 - Login to WhatsApp

Login to WhatsApp, just like Web.Whatsapp.com. You are shown the QR Code. Scan it and log-in to it.

Command

npx mudslide login

WhatsApp Message Using CommandLine

After showing the QR you open WhatsApp on your phone. Go to Settings and go to the linked device and now scan the QR. After the QR scan, you are shown the Command Line √ Success message.

WhatsApp Message Using CommandLine

STEP 5 - Sending Message

There are two methods of sending Messages. You can send it to yourself and you can send to any other WhatsApp number.

1> Send to yourself

Command

npx mudslide send me "Hello World"

WhatsApp Message Using CommandLine

2 > Send to any other number

Command

npx mudslide send 91XXXXXX "Hello World"

XXXXX - Replace the mobile number where you want to send the message. Remember to always add the country code before the mobile number, in India country code is 91.

STEP 6 - List the WhatsApp Groups

Command

npx mudslide groups

WhatsApp Message Using CommandLine

In the output, you see the id and subject. The id is the Group id and Subject is your Group name.

STEP 7 - Send a message to a Group

To send a message to any Group you just need the group id and pass only numerical 

Command

npx mudslide send-group 120363028580195954 "Hello"

WhatsApp Message Using CommandLine

STEP 8 - Show Current User Info

Command

npx mudslide me

WhatsApp Message Using CommandLine

Step 9 - Logout

Command

npx mudslide logout

WhatsApp Message Using CommandLine

Conclusion

In this article, we have learned how to easily send messages without using selenium or any other browser.

HAPPY CODING.


Similar Articles