whatsbotcord 2.0.0-RC.1 → 2.0.0-RC.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,130 +1,130 @@
1
- <div align="center">
2
- <img src="https://raw.githubusercontent.com/KristanLaimon/WhatsBotCord.js/refs/heads/main/.github/media/whatsbotcord_logo.png" width="30%"/>
3
- </div>
4
- <h1 align="center"> Whatsbotcord.js </h1>
5
-
6
- ![NPM Version](https://img.shields.io/npm/v/whatsbotcord)
7
- [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/KristanLaimon/WhatsBotCord.js)
8
- ![NPM Last Update](https://img.shields.io/npm/last-update/whatsbotcord)
9
- ![NPM License](https://img.shields.io/npm/l/whatsbotcord)
10
-
11
- **_WhatsBotCord_** is a lightweight, TypeScript-based library for building WhatsApp bots with a Discord-inspired command system (e.g., **!yourcommand**, **@everyone**, and _more_). Built as a wrapper around Baileys.js, it abstracts complex Baileys.js internals, providing an intuitive, type-safe interface for managing WhatsApp groups and individual chats. Designed from developers to developers to create custom bots with ease.
12
- **🔥 Want to know what's new?** Check out the [**latest releases**](https://github.com/KristanLaimon/WhatsBotCord.js/releases) for documentation and usage examples.
13
-
14
- <div align="center">
15
- <a href="https://whats-bot-cord-js-documentation.vercel.app/">🟢 Official Documentation Site</a>
16
- <span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
17
- <a href="https://deepwiki.com/KristanLaimon/WhatsBotCord.js">📃 Documentation with AI (DeepWiki)</a>
18
- </div>
19
-
20
- ## Features
21
-
22
- - 🤖 **Discord-Inspired Command System**: Create commands (e.g., !hello) with a simple, familiar syntax inspired by Discord bots.
23
- - 🔵 **TypeScript Support**: Fully typed with TypeScript for robust development and autocompletion.
24
- - ✨ **Simplified Baileys Wrapper**: Abstracts complex Baileys internals, making it easy to manage groups, individual senders, and message handling.
25
- - 💬 **Group and Individual Messaging**: Seamlessly interact with WhatsApp groups and individual chats.
26
- - 🧩 **Extensible Architecture**: Modular design for adding custom commands and functionality.
27
- - 🚀 **Lightweight and Performant**: Optimized for speed and efficiency if using Bun.js (optional).
28
-
29
- ## Importing support
30
-
31
- This library works with:
32
-
33
- - ESM Modules (import and export)
34
- - CJS CommonJs (const & require)
35
-
36
- ## Installation
37
-
38
- ```shell
39
- npm install whatsbotcord
40
- ```
41
-
42
- or
43
-
44
- ```shell
45
- bun i whatsbotcord
46
- ```
47
-
48
- - **_WhatsApp Account_**: You NEED an active WhatsApp account on a mobile device to scan a QR code for Web Device Login (not an official WhatsApp Business API).
49
-
50
- ## Getting started
51
-
52
- Import the library and you can use this minimal code to get started with your first command:
53
-
54
- ### Javascript
55
-
56
- ```js
57
- import Whatsbotcord, { CommandType } from "whatsbotcord";
58
-
59
- const bot = new Whatsbotcord({
60
- commandPrefix: "!",
61
- tagPrefix: "@",
62
- credentialsFolder: "./auth",
63
- loggerMode: "recommended",
64
- });
65
- bot.Commands.Add(
66
- {
67
- name: "ping",
68
- async run(chat, api, commandArgs) {
69
- await chat.SendText("pong!");
70
- },
71
- },
72
- CommandType.Normal
73
- );
74
- bot.Start();
75
- ```
76
-
77
- ### Typescript
78
-
79
- ```ts
80
- import Whatsbotcord, { type AdditionalAPI, type CommandArgs, type IChatContext, CommandType } from "whatsbotcord";
81
-
82
- const bot = new Whatsbotcord({
83
- commandPrefix: "!",
84
- tagPrefix: "@",
85
- credentialsFolder: "./auth",
86
- loggerMode: "recommended",
87
- });
88
- bot.Commands.Add(
89
- {
90
- name: "ping",
91
- async run(chat: IChatContext, _api: AdditionalAPI, _commandArgs: CommandArgs): Promise<void> {
92
- await chat.SendText("pong!");
93
- },
94
- },
95
- CommandType.Normal
96
- );
97
- bot.Start();
98
- ```
99
-
100
- Want to know more?, check the [official documentation site (In progress)](https://whats-bot-cord-js-documentation.vercel.app/)
101
-
102
- # Acknowledgment
103
-
104
- Thanks to the awesome library [Baileys.js](https://github.com/WhiskeySockets/Baileys) to make
105
- possible to use whatsapp web for automation purposes. Huge congrats for them, without it, this proyect wouldn't even
106
- be possible.
107
-
108
- # License
109
-
110
- MIT License
111
-
112
- Copyright (c) 2025 KristanLaimon
113
-
114
- Permission is hereby granted, free of charge, to any person obtaining a copy
115
- of this software and associated documentation files (the "Software"), to deal
116
- in the Software without restriction, including without limitation the rights
117
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
118
- copies of the Software, and to permit persons to whom the Software is
119
- furnished to do so, subject to the following conditions:
120
-
121
- The above copyright notice and this permission notice shall be included in all
122
- copies or substantial portions of the Software.
123
-
124
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
125
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
126
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
127
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
128
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
129
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
130
- SOFTWARE.
1
+ <div align="center">
2
+ <img src="https://raw.githubusercontent.com/KristanLaimon/WhatsBotCord.js/refs/heads/main/.github/media/whatsbotcord_logo.png" width="30%"/>
3
+ </div>
4
+ <h1 align="center"> Whatsbotcord.js </h1>
5
+
6
+ ![NPM Version](https://img.shields.io/npm/v/whatsbotcord)
7
+ [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/KristanLaimon/WhatsBotCord.js)
8
+ ![NPM Last Update](https://img.shields.io/npm/last-update/whatsbotcord)
9
+ ![NPM License](https://img.shields.io/npm/l/whatsbotcord)
10
+
11
+ **_WhatsBotCord_** is a lightweight, TypeScript-based library for building WhatsApp bots with a Discord-inspired command system (e.g., **!yourcommand**, **@everyone**, and _more_). Built as a wrapper around Baileys.js, it abstracts complex Baileys.js internals, providing an intuitive, type-safe interface for managing WhatsApp groups and individual chats. Designed from developers to developers to create custom bots with ease.
12
+ **🔥 Want to know what's new?** Check out the [**latest releases**](https://github.com/KristanLaimon/WhatsBotCord.js/releases) for documentation and usage examples.
13
+
14
+ <div align="center">
15
+ <a href="https://whatsbotcord.sbs">🟢 Official Documentation Site</a>
16
+ <span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
17
+ <a href="https://deepwiki.com/KristanLaimon/WhatsBotCord.js">📃 Documentation with AI (DeepWiki)</a>
18
+ </div>
19
+
20
+ ## Features
21
+
22
+ - 🤖 **Discord-Inspired Command System**: Create commands (e.g., !hello) with a simple, familiar syntax inspired by Discord bots.
23
+ - 🔵 **TypeScript Support**: Fully typed with TypeScript for robust development and autocompletion.
24
+ - ✨ **Simplified Baileys Wrapper**: Abstracts complex Baileys internals, making it easy to manage groups, individual senders, and message handling.
25
+ - 💬 **Group and Individual Messaging**: Seamlessly interact with WhatsApp groups and individual chats.
26
+ - 🧩 **Extensible Architecture**: Modular design for adding custom commands and functionality.
27
+ - 🚀 **Lightweight and Performant**: Optimized for speed and efficiency if using Bun.js (optional).
28
+
29
+ ## Importing support
30
+
31
+ This library works with:
32
+
33
+ - ESM Modules (import and export)
34
+ - CJS CommonJs (const & require)
35
+
36
+ ## Installation
37
+
38
+ ```shell
39
+ npm install whatsbotcord
40
+ ```
41
+
42
+ or
43
+
44
+ ```shell
45
+ bun i whatsbotcord
46
+ ```
47
+
48
+ - **_WhatsApp Account_**: You NEED an active WhatsApp account on a mobile device to scan a QR code for Web Device Login (not an official WhatsApp Business API).
49
+
50
+ ## Getting started
51
+
52
+ Import the library and you can use this minimal code to get started with your first command:
53
+
54
+ ### Javascript
55
+
56
+ ```js
57
+ import Whatsbotcord, { CommandType } from "whatsbotcord";
58
+
59
+ const bot = new Whatsbotcord({
60
+ commandPrefix: "!",
61
+ tagPrefix: "@",
62
+ credentialsFolder: "./auth",
63
+ loggerMode: "recommended",
64
+ });
65
+ bot.Commands.Add(
66
+ {
67
+ name: "ping",
68
+ async run(chat, api, commandArgs) {
69
+ await chat.SendText("pong!");
70
+ },
71
+ },
72
+ CommandType.Normal
73
+ );
74
+ bot.Start();
75
+ ```
76
+
77
+ ### Typescript
78
+
79
+ ```ts
80
+ import Whatsbotcord, { type AdditionalAPI, type CommandArgs, type IChatContext, CommandType } from "whatsbotcord";
81
+
82
+ const bot = new Whatsbotcord({
83
+ commandPrefix: "!",
84
+ tagPrefix: "@",
85
+ credentialsFolder: "./auth",
86
+ loggerMode: "recommended",
87
+ });
88
+ bot.Commands.Add(
89
+ {
90
+ name: "ping",
91
+ async run(chat: IChatContext, _api: AdditionalAPI, _commandArgs: CommandArgs): Promise<void> {
92
+ await chat.SendText("pong!");
93
+ },
94
+ },
95
+ CommandType.Normal
96
+ );
97
+ bot.Start();
98
+ ```
99
+
100
+ Want to know more?, check the [official documentation site](https://whatsbotcord.sbs)
101
+
102
+ # Acknowledgment
103
+
104
+ Thanks to the awesome library [Baileys.js](https://github.com/WhiskeySockets/Baileys) to make
105
+ possible to use whatsapp web for automation purposes. Huge congrats for them, without it, this proyect wouldn't even
106
+ be possible.
107
+
108
+ # License
109
+
110
+ MIT License
111
+
112
+ Copyright (c) 2025 KristanLaimon
113
+
114
+ Permission is hereby granted, free of charge, to any person obtaining a copy
115
+ of this software and associated documentation files (the "Software"), to deal
116
+ in the Software without restriction, including without limitation the rights
117
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
118
+ copies of the Software, and to permit persons to whom the Software is
119
+ furnished to do so, subject to the following conditions:
120
+
121
+ The above copyright notice and this permission notice shall be included in all
122
+ copies or substantial portions of the Software.
123
+
124
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
125
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
126
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
127
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
128
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
129
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
130
+ SOFTWARE.