🤖 Receive and Reply to Your Messages Quickly 🚀
Whatsapp.ts is a Whatsapp Handler that uses Typescript that you can develop according to your needs.
We provide code that is friendly to understand so that it is easy to develop in the future.
Whatsapp.ts uses Baileys as its Whastapp Library.
Whatsapp.ts provides a Users management feature that is integrated with MongoDB which can make it easier for you to manage your users.
Whatsapp.ts is written using Typescript.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
First, you must clone and install the necessary dependencies for this project
git clone https://github.com/DutaKey/whatsapp.ts
cd whatsapp.ts
npm install
Rename .env.example
to .env
or create new file called .env
.
And, Input Your MONGO_URI
Next you can run Build to Build the Application
npm run build
After that you can run the application by doing so:
npm run start
you can also run this if you want to directly build and run the app
npm run start:build
And scan the QR that appears using the Whatsapp that you want to make into a Bot ✨
We provide 4 built-in features for you to be an example and a guide for you to create features for the future.
ping
to ping your bot
.help
to see list feature on your bot
.runtime
to see how long your bot live
and
.get
to get html on website
Send bot command from another whatsapp number to your bot number message.
Create a new file in src/commands/{category}/
then fill the file with type:
declare type Commands = {
name: string;
alias: string[];
category: string;
description: string;
prefix: boolean;
run: () => unknown;
};
import type { Commands } from "../../types/command";
import axios from "axios";
export default <Commands>{
name: "get",
alias: [],
category: "fetch",
description: "Get Web Using Axios",
prefix: true,
async run({ msg, sock, client }) {
const { body } = msg;
const url = body.split(" ")[1] || false;
if (!url) msg.reply("Please Provide Url");
axios
.get(url)
.then((res) => {
const responseData = res.data;
msg.reply(responseData.toString());
})
.catch((err) => {
msg.reply(err.toString());
});
},
};
Save and Try The Feature👍✨
- @DutaKey - Idea & Initial work
See also the list of contributors who participated in this project.
- Hat tip to anyone whose code was used
- Inspiration
- References