Coder Social home page Coder Social logo

whatsapp.ts's Introduction

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

whatsapp.ts's People

Contributors

dutakey avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.