whatsauto.js 0.1.2 → 1.0.0
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 +3 -3
- package/dist/Defaults/index.d.ts +2 -1
- package/dist/Defaults/index.d.ts.map +1 -1
- package/dist/Defaults/index.js +1 -0
- package/dist/Error/index.d.ts +2 -2
- package/dist/Error/index.d.ts.map +1 -1
- package/dist/Error/index.js +7 -7
- package/dist/Logger/index.d.ts +8 -4
- package/dist/Logger/index.d.ts.map +1 -1
- package/dist/Logger/index.js +41 -4
- package/dist/Types/index.d.ts +55 -55
- package/dist/Types/index.d.ts.map +1 -1
- package/dist/Types/index.js +0 -18
- package/dist/Utils/helper.d.ts +4 -2
- package/dist/Utils/helper.d.ts.map +1 -1
- package/dist/Utils/helper.js +55 -25
- package/dist/Utils/index.d.ts +0 -1
- package/dist/Utils/index.d.ts.map +1 -1
- package/dist/Utils/index.js +0 -1
- package/dist/Utils/make-stiker.d.ts.map +1 -1
- package/dist/Utils/make-stiker.js +13 -6
- package/dist/WhatsApp/AutoWA.d.ts +35 -9
- package/dist/WhatsApp/AutoWA.d.ts.map +1 -1
- package/dist/WhatsApp/AutoWA.js +294 -144
- package/dist/WhatsApp/AutoWAEvent.d.ts +29 -28
- package/dist/WhatsApp/AutoWAEvent.d.ts.map +1 -1
- package/dist/WhatsApp/AutoWAEvent.js +3 -0
- package/dist/WhatsApp/index.d.ts +2 -1
- package/dist/WhatsApp/index.d.ts.map +1 -1
- package/dist/WhatsApp/index.js +2 -1
- package/dist/index.d.ts +2 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -5
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -9,19 +9,19 @@ Stand above [Baileys](https://github.com/WhiskeySockets/Baileys) Library. This l
|
|
|
9
9
|
Install package using npm
|
|
10
10
|
|
|
11
11
|
```
|
|
12
|
-
npm i whatsauto.js
|
|
12
|
+
npm i whatsauto.js@latest
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
Then import the library
|
|
16
16
|
|
|
17
17
|
```ts
|
|
18
|
-
import
|
|
18
|
+
import AutoWA from "whatsauto.js";
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
or
|
|
22
22
|
|
|
23
23
|
```ts
|
|
24
|
-
const
|
|
24
|
+
const { default: AutoWA } = require("whatsauto.js");
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
## 🗒️ Insight
|
package/dist/Defaults/index.d.ts
CHANGED
|
@@ -29,7 +29,8 @@ export declare enum CALLBACK_KEY {
|
|
|
29
29
|
ON_DISCONNECTED = "disconnected",
|
|
30
30
|
ON_CONNECTING = "connecting",
|
|
31
31
|
ON_MESSAGE_UPDATED = "message-updated",
|
|
32
|
-
ON_PAIRING_CODE = "pairing-code"
|
|
32
|
+
ON_PAIRING_CODE = "pairing-code",
|
|
33
|
+
ON_GROUP_MEMBER_UPDATE = "on-group-member-update"
|
|
33
34
|
}
|
|
34
35
|
export declare abstract class Messages {
|
|
35
36
|
static sessionAlreadyExist: (sessionId: string) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Defaults/index.ts"],"names":[],"mappings":"AAAA,8BAAsB,WAAW;IAC/B,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAc;IACrC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAY;CAClC;AAED,oBAAY,YAAY;IACtB,UAAU,YAAY;IACtB,gBAAgB,kBAAkB;IAClC,kBAAkB,oBAAoB;IACtC,mBAAmB,qBAAqB;IACxC,yBAAyB,2BAA2B;IACpD,2BAA2B,6BAA6B;IACxD,eAAe,iBAAiB;IAChC,qBAAqB,uBAAuB;IAC5C,uBAAuB,yBAAyB;IAChD,QAAQ,UAAU;IAClB,iBAAiB,mBAAmB;IACpC,aAAa,eAAe;IAC5B,WAAW,aAAa;IACxB,oBAAoB,sBAAsB;IAC1C,gBAAgB,kBAAkB;IA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AC,kBAAkB,UAAW,MAAM,EAAE,GAAG,MAAM,YAGpC;IAEjB,MAAM,CAAC,kBAAkB,UAAW,MAAM,EAAE,GAAG,MAAM,YAGnC;CACnB"}
|
package/dist/Defaults/index.js
CHANGED
|
@@ -35,6 +35,7 @@ var CALLBACK_KEY;
|
|
|
35
35
|
CALLBACK_KEY["ON_CONNECTING"] = "connecting";
|
|
36
36
|
CALLBACK_KEY["ON_MESSAGE_UPDATED"] = "message-updated";
|
|
37
37
|
CALLBACK_KEY["ON_PAIRING_CODE"] = "pairing-code";
|
|
38
|
+
CALLBACK_KEY["ON_GROUP_MEMBER_UPDATE"] = "on-group-member-update";
|
|
38
39
|
})(CALLBACK_KEY || (exports.CALLBACK_KEY = CALLBACK_KEY = {}));
|
|
39
40
|
class Messages {
|
|
40
41
|
}
|
package/dist/Error/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export declare class
|
|
1
|
+
export declare class AutoWAError extends Error {
|
|
2
2
|
constructor(message: string);
|
|
3
|
-
static
|
|
3
|
+
static isAutoWAError(error: any): error is AutoWAError;
|
|
4
4
|
}
|
|
5
5
|
export declare class ValidationError extends Error {
|
|
6
6
|
constructor(message: string);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Error/index.ts"],"names":[],"mappings":"AAAA,qBAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Error/index.ts"],"names":[],"mappings":"AAAA,qBAAa,WAAY,SAAQ,KAAK;gBACxB,OAAO,EAAE,MAAM;IAM3B,MAAM,CAAC,aAAa,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,WAAW;CAGvD;AAED,qBAAa,eAAgB,SAAQ,KAAK;gBAC5B,OAAO,EAAE,MAAM;IAM3B,MAAM,CAAC,iBAAiB,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,eAAe;CAG/D"}
|
package/dist/Error/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ValidationError = exports.
|
|
4
|
-
class
|
|
3
|
+
exports.ValidationError = exports.AutoWAError = void 0;
|
|
4
|
+
class AutoWAError extends Error {
|
|
5
5
|
constructor(message) {
|
|
6
6
|
super(message);
|
|
7
|
-
this.name = "
|
|
8
|
-
Object.setPrototypeOf(this,
|
|
7
|
+
this.name = "AutoWAError";
|
|
8
|
+
Object.setPrototypeOf(this, AutoWAError.prototype);
|
|
9
9
|
}
|
|
10
|
-
static
|
|
11
|
-
return error instanceof
|
|
10
|
+
static isAutoWAError(error) {
|
|
11
|
+
return error instanceof AutoWAError || error instanceof Error;
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
-
exports.
|
|
14
|
+
exports.AutoWAError = AutoWAError;
|
|
15
15
|
class ValidationError extends Error {
|
|
16
16
|
constructor(message) {
|
|
17
17
|
super(message);
|
package/dist/Logger/index.d.ts
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
import { AutoWA } from "../WhatsApp";
|
|
1
2
|
export default class Logger {
|
|
2
3
|
private name;
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
private autoWA;
|
|
5
|
+
constructor(name: string, autoWA: AutoWA);
|
|
6
|
+
private formatMessage;
|
|
7
|
+
debug(message: any): Promise<void>;
|
|
8
|
+
info(message: any): Promise<void>;
|
|
9
|
+
warn(message: any): Promise<void>;
|
|
10
|
+
error(message: any): Promise<void>;
|
|
7
11
|
}
|
|
8
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Logger/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Logger/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,MAAM,CAAC,OAAO,OAAO,MAAM;IACzB,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,MAAM,CAAS;gBAEX,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;YAK1B,aAAa;IAgBd,KAAK,CAAC,OAAO,EAAE,GAAG;IAIlB,IAAI,CAAC,OAAO,EAAE,GAAG;IAIjB,IAAI,CAAC,OAAO,EAAE,GAAG;IAIjB,KAAK,CAAC,OAAO,EAAE,GAAG;CAGhC"}
|
package/dist/Logger/index.js
CHANGED
|
@@ -1,17 +1,54 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
2
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const colorette_1 = require("colorette");
|
|
3
13
|
class Logger {
|
|
4
|
-
constructor(name) {
|
|
14
|
+
constructor(name, autoWA) {
|
|
5
15
|
this.name = name;
|
|
16
|
+
this.autoWA = autoWA;
|
|
17
|
+
}
|
|
18
|
+
formatMessage(level, message) {
|
|
19
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
const levelColors = {
|
|
21
|
+
DEBUG: colorette_1.blue,
|
|
22
|
+
INFO: colorette_1.green,
|
|
23
|
+
WARN: colorette_1.yellow,
|
|
24
|
+
ERROR: colorette_1.red,
|
|
25
|
+
};
|
|
26
|
+
const timestamp = new Date().toISOString();
|
|
27
|
+
const tag = levelColors[level](`[${level}]`);
|
|
28
|
+
const scope = (0, colorette_1.cyan)(`[${this.name}]`);
|
|
29
|
+
const msg = typeof message === "string" ? message : JSON.stringify(message, null, 2);
|
|
30
|
+
return `${(0, colorette_1.gray)(timestamp)} ${tag} ${scope} ${msg}`;
|
|
31
|
+
});
|
|
6
32
|
}
|
|
7
33
|
debug(message) {
|
|
8
|
-
|
|
34
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
+
this.autoWA.options.logging && console.debug(yield this.formatMessage("DEBUG", message));
|
|
36
|
+
});
|
|
9
37
|
}
|
|
10
38
|
info(message) {
|
|
11
|
-
|
|
39
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
+
this.autoWA.options.logging && console.info(yield this.formatMessage("INFO", message));
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
warn(message) {
|
|
44
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
+
this.autoWA.options.logging && console.warn(yield this.formatMessage("WARN", message));
|
|
46
|
+
});
|
|
12
47
|
}
|
|
13
48
|
error(message) {
|
|
14
|
-
|
|
49
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
50
|
+
this.autoWA.options.logging && console.error(yield this.formatMessage("ERROR", message));
|
|
51
|
+
});
|
|
15
52
|
}
|
|
16
53
|
}
|
|
17
54
|
exports.default = Logger;
|
package/dist/Types/index.d.ts
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
import { WAMessageUpdate, proto } from "@whiskeysockets/baileys";
|
|
1
|
+
import { ParticipantAction, WAMessageUpdate, proto } from "@whiskeysockets/baileys";
|
|
2
2
|
export interface IWAutoSendMessage {
|
|
3
3
|
to: string | number;
|
|
4
4
|
text?: string;
|
|
5
5
|
isGroup?: boolean;
|
|
6
6
|
answering?: proto.IWebMessageInfo;
|
|
7
|
+
mentions?: string[];
|
|
7
8
|
}
|
|
8
9
|
export interface IWAutoSendMedia extends IWAutoSendMessage {
|
|
9
10
|
/**
|
|
10
11
|
* Media you want to send
|
|
11
12
|
*/
|
|
12
|
-
media
|
|
13
|
+
media: string | Buffer;
|
|
14
|
+
voiceNote?: boolean;
|
|
15
|
+
failMsg?: string;
|
|
13
16
|
}
|
|
14
17
|
export interface IWAutoSendTyping extends IWAutoSendMessage {
|
|
15
18
|
/**
|
|
@@ -23,7 +26,37 @@ export interface IWAutoSendRead {
|
|
|
23
26
|
*/
|
|
24
27
|
key: proto.IMessageKey;
|
|
25
28
|
}
|
|
26
|
-
export interface
|
|
29
|
+
export interface Repliable {
|
|
30
|
+
/**
|
|
31
|
+
* reply this message with text
|
|
32
|
+
*/
|
|
33
|
+
replyWithText: (text: string, opts: IWAutoSendMessage) => Promise<proto.WebMessageInfo>;
|
|
34
|
+
/**
|
|
35
|
+
* reply this message with Audio
|
|
36
|
+
*/
|
|
37
|
+
replyWithAudio: (data: IWAutoSendMedia) => Promise<proto.WebMessageInfo>;
|
|
38
|
+
/**
|
|
39
|
+
* reply this message with Video
|
|
40
|
+
*/
|
|
41
|
+
replyWithVideo: (data: IWAutoSendMedia) => Promise<proto.WebMessageInfo>;
|
|
42
|
+
/**
|
|
43
|
+
* reply this message with Image
|
|
44
|
+
*/
|
|
45
|
+
replyWithImage: (data: IWAutoSendMedia) => Promise<proto.WebMessageInfo>;
|
|
46
|
+
/**
|
|
47
|
+
* reply this message with Sticker
|
|
48
|
+
*/
|
|
49
|
+
replyWithSticker: (data: IWAutoSendMedia & IStickerOptions) => Promise<proto.WebMessageInfo>;
|
|
50
|
+
/**
|
|
51
|
+
* reply this message with Typing
|
|
52
|
+
*/
|
|
53
|
+
replyWithTyping: (duration: number) => Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* reply this message with Recording
|
|
56
|
+
*/
|
|
57
|
+
replyWithRecording: (duration: number) => Promise<void>;
|
|
58
|
+
}
|
|
59
|
+
export interface IWAutoMessage extends proto.IWebMessageInfo, Repliable {
|
|
27
60
|
/**
|
|
28
61
|
* Your Session ID
|
|
29
62
|
*/
|
|
@@ -65,6 +98,10 @@ export interface IWAutoMessage extends proto.IWebMessageInfo {
|
|
|
65
98
|
* @example "./my_media"
|
|
66
99
|
*/
|
|
67
100
|
downloadMedia: (path: string) => Promise<string>;
|
|
101
|
+
/**
|
|
102
|
+
* react this message
|
|
103
|
+
*/
|
|
104
|
+
react: (reaction: string) => Promise<proto.WebMessageInfo>;
|
|
68
105
|
}
|
|
69
106
|
export interface IWAutoMessageReceived extends IWAutoMessage {
|
|
70
107
|
/**
|
|
@@ -90,6 +127,10 @@ export type WAutoMessageUpdated = WAMessageUpdate & {
|
|
|
90
127
|
messageStatus: "error" | "pending" | "server" | "delivered" | "read" | "played";
|
|
91
128
|
};
|
|
92
129
|
export interface IWAutoSessionConfig {
|
|
130
|
+
/**
|
|
131
|
+
* Print logs into Terminal
|
|
132
|
+
*/
|
|
133
|
+
logging?: boolean;
|
|
93
134
|
/**
|
|
94
135
|
* Print QR Code into Terminal
|
|
95
136
|
*/
|
|
@@ -99,58 +140,6 @@ export interface IWAutoSessionConfig {
|
|
|
99
140
|
*/
|
|
100
141
|
phoneNumber?: string;
|
|
101
142
|
}
|
|
102
|
-
export declare class WAutoMessageCompleteClass implements Partial<WAutoMessageComplete> {
|
|
103
|
-
/**
|
|
104
|
-
* Your Session ID
|
|
105
|
-
*/
|
|
106
|
-
sessionId: string;
|
|
107
|
-
/**
|
|
108
|
-
* Message author Jid
|
|
109
|
-
*/
|
|
110
|
-
author: string;
|
|
111
|
-
/**
|
|
112
|
-
* Is this message have media?
|
|
113
|
-
*/
|
|
114
|
-
hasMedia: boolean;
|
|
115
|
-
/**
|
|
116
|
-
* Media type of this message
|
|
117
|
-
*/
|
|
118
|
-
mediaType: string;
|
|
119
|
-
/**
|
|
120
|
-
* Text of this message
|
|
121
|
-
*/
|
|
122
|
-
text: string;
|
|
123
|
-
/**
|
|
124
|
-
* is this message a story?
|
|
125
|
-
*/
|
|
126
|
-
isStory: boolean;
|
|
127
|
-
/**
|
|
128
|
-
* is this message from a group?
|
|
129
|
-
*/
|
|
130
|
-
isGroup: boolean;
|
|
131
|
-
/**
|
|
132
|
-
* is this message a reaction?
|
|
133
|
-
*/
|
|
134
|
-
isReaction: boolean;
|
|
135
|
-
/**
|
|
136
|
-
* Quoted message by this message
|
|
137
|
-
*/
|
|
138
|
-
quotedMessage: IWAutoMessage;
|
|
139
|
-
/**
|
|
140
|
-
* @param path save media location path without extension
|
|
141
|
-
* @example "./my_media"
|
|
142
|
-
*/
|
|
143
|
-
downloadMedia: (path: string) => Promise<string>;
|
|
144
|
-
/**
|
|
145
|
-
* Message sender Jid
|
|
146
|
-
*/
|
|
147
|
-
from: string;
|
|
148
|
-
/**
|
|
149
|
-
* Message sender Jid
|
|
150
|
-
*/
|
|
151
|
-
receiver: string;
|
|
152
|
-
constructor(message: WAutoMessageComplete);
|
|
153
|
-
}
|
|
154
143
|
export interface IStickerOptions {
|
|
155
144
|
filePath: string;
|
|
156
145
|
pack?: string;
|
|
@@ -158,4 +147,15 @@ export interface IStickerOptions {
|
|
|
158
147
|
transparent?: boolean;
|
|
159
148
|
bgColor?: string;
|
|
160
149
|
}
|
|
150
|
+
export interface GroupMemberUpdate extends Repliable {
|
|
151
|
+
sessionId: string;
|
|
152
|
+
id: string;
|
|
153
|
+
author: string;
|
|
154
|
+
participants: string[];
|
|
155
|
+
action: ParticipantAction;
|
|
156
|
+
}
|
|
157
|
+
export interface WAutoGroupMemberActionOptions {
|
|
158
|
+
participants: string[];
|
|
159
|
+
to: string;
|
|
160
|
+
}
|
|
161
161
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+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CAAC;IAClB;;OAEG;IACH,aAAa,EAAE,OAAO,GAAG,SAAS,GAAG,QAAQ,GAAG,WAAW,GAAG,MAAM,GAAG,QAAQ,CAAC;CACjF,CAAC;AAEF,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,iBAAkB,SAAQ,SAAS;IAClD,SAAS,EAAE,MAAM,CAAC;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,MAAM,EAAE,iBAAiB,CAAC;CAC3B;AAED,MAAM,WAAW,6BAA6B;IAC5C,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,EAAE,EAAE,MAAM,CAAC;CACZ"}
|
package/dist/Types/index.js
CHANGED
|
@@ -1,20 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WAutoMessageCompleteClass = void 0;
|
|
4
|
-
class WAutoMessageCompleteClass {
|
|
5
|
-
constructor(message) {
|
|
6
|
-
this.sessionId = message.sessionId;
|
|
7
|
-
this.author = message.author;
|
|
8
|
-
this.hasMedia = message.hasMedia;
|
|
9
|
-
this.mediaType = message.mediaType;
|
|
10
|
-
this.text = message.text;
|
|
11
|
-
this.isStory = message.isStory;
|
|
12
|
-
this.isGroup = message.isGroup;
|
|
13
|
-
this.isReaction = message.isReaction;
|
|
14
|
-
this.quotedMessage = message.quotedMessage;
|
|
15
|
-
this.downloadMedia = message.downloadMedia;
|
|
16
|
-
this.from = message.from;
|
|
17
|
-
this.receiver = message.receiver;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
exports.WAutoMessageCompleteClass = WAutoMessageCompleteClass;
|
package/dist/Utils/helper.d.ts
CHANGED
|
@@ -2,10 +2,10 @@ import { proto } from "@whiskeysockets/baileys";
|
|
|
2
2
|
import { IWAutoMessage, WAutoMessageUpdated } from "../Types";
|
|
3
3
|
export declare const getMediaMimeType: (msg: IWAutoMessage) => string;
|
|
4
4
|
export declare const parseMessageStatusCodeToReadable: (code: proto.WebMessageInfo.Status) => WAutoMessageUpdated["messageStatus"];
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const phoneToJid: ({ to, isGroup, }: {
|
|
5
|
+
export declare const phoneToJid: ({ to, isGroup, reverse, }: {
|
|
7
6
|
to: string | number;
|
|
8
7
|
isGroup?: boolean;
|
|
8
|
+
reverse?: boolean;
|
|
9
9
|
}) => string;
|
|
10
10
|
export declare const createDelay: (duration?: number) => Promise<unknown>;
|
|
11
11
|
export declare const is: {
|
|
@@ -19,4 +19,6 @@ export declare const to: {
|
|
|
19
19
|
string: (str: any) => string;
|
|
20
20
|
undefined: (str: any, defaultValue?: any) => string | number | undefined;
|
|
21
21
|
};
|
|
22
|
+
export declare const isSessionExist: (sessionId: string) => boolean;
|
|
23
|
+
export declare const setCredentialsDir: (dirname: string) => void;
|
|
22
24
|
//# sourceMappingURL=helper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../../src/Utils/helper.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../../src/Utils/helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAM9D,eAAO,MAAM,gBAAgB,QAAS,aAAa,KAAG,MAwBrD,CAAC;AAEF,eAAO,MAAM,gCAAgC,SACrC,KAAK,CAAC,cAAc,CAAC,MAAM,KAChC,mBAAmB,CAAC,eAAe,CAerC,CAAC;AAEF,eAAO,MAAM,UAAU,8BAIpB;IACD,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,KAAG,MAgBH,CAAC;AAEF,eAAO,MAAM,WAAW,cAAoB,MAAM,qBAMjD,CAAC;AAEF,eAAO,MAAM,EAAE;mBACE,GAAG,KAAG,OAAO;sBAGV,GAAG,KAAG,OAAO;iBAGlB,GAAG,KAAG,OAAO;qBAGT,GAAG,KAAG,OAAO;kBAGhB,GAAG,KAAG,OAAO;CAG5B,CAAC;AAEF,eAAO,MAAM,EAAE;kBACC,GAAG,KAAG,MAAM;qBAIT,GAAG,iBAAgB,GAAG,KAAe,MAAM,GAAG,MAAM,GAAG,SAAS;CAIlF,CAAC;AAEF,eAAO,MAAM,cAAc,cAAwB,MAAM,YASxD,CAAC;AAEF,eAAO,MAAM,iBAAiB,YAAa,MAAM,SAOhD,CAAC"}
|
package/dist/Utils/helper.js
CHANGED
|
@@ -41,53 +41,64 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
41
41
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
42
42
|
});
|
|
43
43
|
};
|
|
44
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
45
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
46
|
+
};
|
|
44
47
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
|
-
exports.
|
|
46
|
-
const baileys_1 =
|
|
48
|
+
exports.setCredentialsDir = exports.isSessionExist = exports.to = exports.is = exports.createDelay = exports.phoneToJid = exports.parseMessageStatusCodeToReadable = exports.getMediaMimeType = void 0;
|
|
49
|
+
const baileys_1 = require("@whiskeysockets/baileys");
|
|
47
50
|
const Error_1 = require("../Error");
|
|
51
|
+
const fs = __importStar(require("fs"));
|
|
52
|
+
const path_1 = __importDefault(require("path"));
|
|
53
|
+
const Defaults_1 = require("../Defaults");
|
|
48
54
|
const getMediaMimeType = (msg) => {
|
|
49
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
55
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
50
56
|
if (!(msg === null || msg === void 0 ? void 0 : msg.message))
|
|
51
57
|
return "";
|
|
52
|
-
if (msg.message.documentWithCaptionMessage)
|
|
58
|
+
if ((_a = msg.message) === null || _a === void 0 ? void 0 : _a.documentWithCaptionMessage)
|
|
53
59
|
msg = Object.assign(Object.assign({}, msg), { message: msg.message.documentWithCaptionMessage.message });
|
|
60
|
+
else if ((_b = msg.message) === null || _b === void 0 ? void 0 : _b.ephemeralMessage)
|
|
61
|
+
msg = Object.assign(Object.assign({}, msg), { message: msg.message.ephemeralMessage.message });
|
|
54
62
|
const { imageMessage, stickerMessage, videoMessage, documentMessage, audioMessage, documentWithCaptionMessage, } = msg === null || msg === void 0 ? void 0 : msg.message;
|
|
55
|
-
return exports.to.string((
|
|
63
|
+
return exports.to.string((_g = (_f = (_e = (_d = (_c = imageMessage === null || imageMessage === void 0 ? void 0 : imageMessage.mimetype) !== null && _c !== void 0 ? _c : stickerMessage === null || stickerMessage === void 0 ? void 0 : stickerMessage.mimetype) !== null && _d !== void 0 ? _d : audioMessage === null || audioMessage === void 0 ? void 0 : audioMessage.mimetype) !== null && _e !== void 0 ? _e : videoMessage === null || videoMessage === void 0 ? void 0 : videoMessage.mimetype) !== null && _f !== void 0 ? _f : documentMessage === null || documentMessage === void 0 ? void 0 : documentMessage.mimetype) !== null && _g !== void 0 ? _g : (_j = (_h = documentWithCaptionMessage === null || documentWithCaptionMessage === void 0 ? void 0 : documentWithCaptionMessage.message) === null || _h === void 0 ? void 0 : _h.documentMessage) === null || _j === void 0 ? void 0 : _j.mimetype);
|
|
56
64
|
};
|
|
57
65
|
exports.getMediaMimeType = getMediaMimeType;
|
|
58
66
|
const parseMessageStatusCodeToReadable = (code) => {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
switch (code) {
|
|
68
|
+
case baileys_1.proto.WebMessageInfo.Status.PENDING:
|
|
69
|
+
return "pending";
|
|
70
|
+
case baileys_1.proto.WebMessageInfo.Status.SERVER_ACK:
|
|
71
|
+
return "server";
|
|
72
|
+
case baileys_1.proto.WebMessageInfo.Status.DELIVERY_ACK:
|
|
73
|
+
return "delivered";
|
|
74
|
+
case baileys_1.proto.WebMessageInfo.Status.READ:
|
|
75
|
+
return "read";
|
|
76
|
+
case baileys_1.proto.WebMessageInfo.Status.PLAYED:
|
|
77
|
+
return "played";
|
|
78
|
+
default:
|
|
79
|
+
return "error";
|
|
80
|
+
}
|
|
70
81
|
};
|
|
71
82
|
exports.parseMessageStatusCodeToReadable = parseMessageStatusCodeToReadable;
|
|
72
|
-
const
|
|
73
|
-
return Object.keys(baileys_1.default).some((key) => {
|
|
74
|
-
return phone.startsWith(key);
|
|
75
|
-
});
|
|
76
|
-
};
|
|
77
|
-
exports.isPhoneNumberValidCountry = isPhoneNumberValidCountry;
|
|
78
|
-
const phoneToJid = ({ to, isGroup = false, }) => {
|
|
83
|
+
const phoneToJid = ({ to, isGroup = false, reverse = false, }) => {
|
|
79
84
|
if (!to)
|
|
80
|
-
throw new Error_1.ValidationError('
|
|
85
|
+
throw new Error_1.ValidationError('"to" parameter is required!');
|
|
81
86
|
let number = to.toString();
|
|
82
|
-
if (
|
|
87
|
+
if (number.includes("@broadcast"))
|
|
88
|
+
return number;
|
|
89
|
+
if (isGroup || number.includes("@g.us")) {
|
|
83
90
|
number = number.replace(/\s|[+]|[-]/gim, "");
|
|
84
91
|
if (!number.includes("@g.us"))
|
|
85
92
|
number = number + "@g.us";
|
|
93
|
+
if (reverse)
|
|
94
|
+
number = number.replace("@g.us", "");
|
|
86
95
|
}
|
|
87
96
|
else {
|
|
88
97
|
number = number.replace(/\s|[+]|[-]/gim, "");
|
|
89
98
|
if (!number.includes("@s.whatsapp.net"))
|
|
90
99
|
number = number + "@s.whatsapp.net";
|
|
100
|
+
if (reverse)
|
|
101
|
+
number = number.replace("@s.whatsapp.net", "");
|
|
91
102
|
}
|
|
92
103
|
return number;
|
|
93
104
|
};
|
|
@@ -127,3 +138,22 @@ exports.to = {
|
|
|
127
138
|
return defaultValue;
|
|
128
139
|
},
|
|
129
140
|
};
|
|
141
|
+
const isSessionExist = function (sessionId) {
|
|
142
|
+
if (fs.existsSync(path_1.default.resolve(Defaults_1.CREDENTIALS.DIR_NAME)) &&
|
|
143
|
+
fs.existsSync(path_1.default.resolve(Defaults_1.CREDENTIALS.DIR_NAME, sessionId + Defaults_1.CREDENTIALS.PREFIX)) &&
|
|
144
|
+
fs.readdirSync(path_1.default.resolve(Defaults_1.CREDENTIALS.DIR_NAME, sessionId + Defaults_1.CREDENTIALS.PREFIX)).length) {
|
|
145
|
+
return true;
|
|
146
|
+
}
|
|
147
|
+
return false;
|
|
148
|
+
};
|
|
149
|
+
exports.isSessionExist = isSessionExist;
|
|
150
|
+
const setCredentialsDir = (dirname) => {
|
|
151
|
+
if (typeof dirname !== "string") {
|
|
152
|
+
throw new Error_1.ValidationError("Parameter dirname must be a string!");
|
|
153
|
+
}
|
|
154
|
+
else if (dirname === "") {
|
|
155
|
+
throw new Error_1.ValidationError("Parameter dirname must not be empty!");
|
|
156
|
+
}
|
|
157
|
+
Defaults_1.CREDENTIALS.DIR_NAME = dirname;
|
|
158
|
+
};
|
|
159
|
+
exports.setCredentialsDir = setCredentialsDir;
|
package/dist/Utils/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
|
package/dist/Utils/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"make-stiker.d.ts","sourceRoot":"","sources":["../../src/Utils/make-stiker.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAG3C,eAAO,MAAM,cAAc,YAAmB,eAAe,KAAG,OAAO,CAAC,MAAM,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"make-stiker.d.ts","sourceRoot":"","sources":["../../src/Utils/make-stiker.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAG3C,eAAO,MAAM,cAAc,YAAmB,eAAe,KAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CA4DpF,CAAC;AAEF,eAAO,MAAM,iBAAiB,QAAO,MAA2D,CAAC"}
|
|
@@ -25,9 +25,9 @@ const makeWebpBuffer = (options) => __awaiter(void 0, void 0, void 0, function*
|
|
|
25
25
|
return buffer;
|
|
26
26
|
const data = JSON.stringify({
|
|
27
27
|
"sticker-pack-id": (0, exports.generateStickerID)(),
|
|
28
|
-
"sticker-pack-name":
|
|
29
|
-
"sticker-pack-publisher":
|
|
30
|
-
emojis: ["
|
|
28
|
+
"sticker-pack-name": author,
|
|
29
|
+
"sticker-pack-publisher": pack,
|
|
30
|
+
emojis: ["🐾"],
|
|
31
31
|
});
|
|
32
32
|
const exif = Buffer.concat([
|
|
33
33
|
Buffer.from([
|
|
@@ -43,13 +43,20 @@ const makeWebpBuffer = (options) => __awaiter(void 0, void 0, void 0, function*
|
|
|
43
43
|
.input(filePath)
|
|
44
44
|
.on("error", () => {
|
|
45
45
|
fs_1.default.unlinkSync(filePath);
|
|
46
|
+
if (fs_1.default.existsSync(randomName))
|
|
47
|
+
fs_1.default.unlinkSync(randomName);
|
|
46
48
|
resolve(buffer);
|
|
47
49
|
})
|
|
48
50
|
.on("end", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
49
51
|
let image = yield (() => __awaiter(void 0, void 0, void 0, function* () {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
try {
|
|
53
|
+
const img = new Image();
|
|
54
|
+
yield img.load(randomName);
|
|
55
|
+
return img;
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
return resolve(buffer);
|
|
59
|
+
}
|
|
53
60
|
}))();
|
|
54
61
|
image.exif = exif;
|
|
55
62
|
buffer = yield image.save(null);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { WASocket, proto } from "@whiskeysockets/baileys";
|
|
2
|
-
import {
|
|
2
|
+
import { IWAutoSendMessage, IWAutoSendRead, IWAutoSendTyping, IWAutoSessionConfig, IStickerOptions, WAutoGroupMemberActionOptions, IWAutoSendMedia } from "../Types";
|
|
3
3
|
import AutoWAEvent from "./AutoWAEvent";
|
|
4
|
-
import { AutoWAManager } from "./AutoWAManager";
|
|
5
4
|
export declare class AutoWA {
|
|
6
5
|
private logger;
|
|
7
6
|
private callback;
|
|
@@ -10,14 +9,14 @@ export declare class AutoWA {
|
|
|
10
9
|
sessionId: string;
|
|
11
10
|
options: IWAutoSessionConfig;
|
|
12
11
|
event: AutoWAEvent;
|
|
13
|
-
private
|
|
14
|
-
constructor(sessionId: string, options
|
|
12
|
+
private pairingCode?;
|
|
13
|
+
constructor(sessionId: string, options: IWAutoSessionConfig);
|
|
14
|
+
setLogging(logging: boolean): Promise<void>;
|
|
15
15
|
initialize(): Promise<void>;
|
|
16
16
|
private startWhatsApp;
|
|
17
17
|
private startSocket;
|
|
18
18
|
private setupWASocket;
|
|
19
|
-
|
|
20
|
-
end(): void;
|
|
19
|
+
destroy(): Promise<void>;
|
|
21
20
|
isExist({ to, isGroup }: IWAutoSendMessage): Promise<boolean>;
|
|
22
21
|
private downloadMedia;
|
|
23
22
|
private validateReceiver;
|
|
@@ -27,11 +26,38 @@ export declare class AutoWA {
|
|
|
27
26
|
sendDocument({ to, text, isGroup, media, filename, ...props }: IWAutoSendMedia & {
|
|
28
27
|
filename: string;
|
|
29
28
|
}): Promise<proto.WebMessageInfo | undefined>;
|
|
30
|
-
|
|
31
|
-
sendReaction({ to, text, isGroup, answering }:
|
|
29
|
+
sendAudio({ to, isGroup, media, voiceNote, ...props }: Omit<IWAutoSendMedia, "text">): Promise<proto.WebMessageInfo | undefined>;
|
|
30
|
+
sendReaction({ to, text, isGroup, answering }: IWAutoSendMessage): Promise<proto.WebMessageInfo>;
|
|
32
31
|
sendTyping({ to, duration, isGroup }: IWAutoSendTyping): Promise<void>;
|
|
33
32
|
sendRecording({ to, duration, isGroup }: IWAutoSendTyping): Promise<void>;
|
|
34
33
|
readMessage({ key }: IWAutoSendRead): Promise<void>;
|
|
35
|
-
sendSticker({ to, isGroup, filePath, pack, author, ...props }: IWAutoSendMedia & IStickerOptions): Promise<proto.WebMessageInfo | undefined>;
|
|
34
|
+
sendSticker({ to, isGroup, filePath, pack, author, failMsg, ...props }: IWAutoSendMedia & IStickerOptions): Promise<proto.WebMessageInfo | undefined>;
|
|
35
|
+
getProfileInfo(target: string): Promise<{
|
|
36
|
+
profilePictureUrl: string;
|
|
37
|
+
status: {
|
|
38
|
+
status: string | undefined;
|
|
39
|
+
setAt: Date;
|
|
40
|
+
};
|
|
41
|
+
}>;
|
|
42
|
+
addMemberToGroup({ participants, to }: WAutoGroupMemberActionOptions): Promise<{
|
|
43
|
+
status: string;
|
|
44
|
+
jid: string;
|
|
45
|
+
content: import("@whiskeysockets/baileys").BinaryNode;
|
|
46
|
+
}[]>;
|
|
47
|
+
removeMemberFromGroup({ participants, to }: WAutoGroupMemberActionOptions): Promise<{
|
|
48
|
+
status: string;
|
|
49
|
+
jid: string;
|
|
50
|
+
content: import("@whiskeysockets/baileys").BinaryNode;
|
|
51
|
+
}[]>;
|
|
52
|
+
promoteMemberGroup({ participants, to }: WAutoGroupMemberActionOptions): Promise<{
|
|
53
|
+
status: string;
|
|
54
|
+
jid: string;
|
|
55
|
+
content: import("@whiskeysockets/baileys").BinaryNode;
|
|
56
|
+
}[]>;
|
|
57
|
+
demoteMemberGroup({ participants, to }: WAutoGroupMemberActionOptions): Promise<{
|
|
58
|
+
status: string;
|
|
59
|
+
jid: string;
|
|
60
|
+
content: import("@whiskeysockets/baileys").BinaryNode;
|
|
61
|
+
}[]>;
|
|
36
62
|
}
|
|
37
63
|
//# sourceMappingURL=AutoWA.d.ts.map
|