-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
56 lines (49 loc) · 1.2 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
"use strict";
const { checkVars, checkCmd } = require("./utils/functions");
const makeAction = require("./utils/makeAction");
const { DefFunc } = require("./utils/classes");
/** @type {aliceSend} */
module.exports = (
myCreds,
scenario_name = "Голос",
command_type,
data,
is_debug = true
) => {
const defFunc = new DefFunc({
send() { },
status() { },
log(args) { return console.log(args); }
}, is_debug);
const creds = {
get() {
return myCreds;
},
update(newCreds) {
myCreds = { ...this.get(), ...newCreds };
}
};
let { cookies, speaker_id_all, scenario_id,
is_cookies_set, is_speaker_set, is_scenario_set } = checkVars(creds.get());
let { text, is_cmd, should_update } = checkCmd({
command_type,
data,
previous: { is_cmd: false, text: null },
...defFunc
});
makeAction(
creds,
is_debug,
is_cookies_set,
is_speaker_set,
is_scenario_set,
is_cmd,
text,
should_update,
cookies,
scenario_id,
scenario_name,
speaker_id_all,
defFunc
).then();
};