Skip to content

Latest commit

 

History

History
189 lines (133 loc) · 4.84 KB

README.md

File metadata and controls

189 lines (133 loc) · 4.84 KB

Banner Logo

Contributors Forks Stargazers Issues GPL3 License


🤖 Receive and Reply to Your Messages Quickly 🚀

📝 Table of Contents

🧐 About

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.

🎥 Demo / Working

Working

💭 How it works

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.

🏁 Getting Started

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.

Prerequisites

Installing

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 ✨

🎈 Usage

We provide 4 built-in features for you to be an example and a guide for you to create features for the future.

features we provide are

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

Example:

Send bot command from another whatsapp number to your bot number message.

Banner Logo

⛏️ Add Commands/Feature

Create a new file in src/commands/{category}/

Example On : src/commands/general/game.ts

then fill the file with type:

declare type Commands = {
	name: string;
	alias: string[];
	category: string;
	description: string;
	prefix: boolean;
	run: () => unknown;
};

Example

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👍✨

✍️ Authors

See also the list of contributors who participated in this project.

🎉 Acknowledgements

  • Hat tip to anyone whose code was used
  • Inspiration
  • References