webfast 0.1.49 → 0.1.50
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.
@@ -4,6 +4,7 @@ module.exports = async function(req,res,body,params,command,middleValue,received
|
|
4
4
|
|
5
5
|
// Do the script thing
|
6
6
|
if (middleValue.text.startsWith(`/`)) {
|
7
|
+
middleValue.origin = middleValue.text;
|
7
8
|
middleValue.text = `start`;
|
8
9
|
const scripting = await program.modules.telegram.script.function.check(program,command,middleValue.from.id,middleValue,received);
|
9
10
|
console.log(`Scripting`);
|
@@ -42,6 +42,13 @@ module.exports = {
|
|
42
42
|
let current;
|
43
43
|
|
44
44
|
let theUUID = program.uuid.v4();
|
45
|
+
|
46
|
+
if (program.modules.telegram.functions.que.line[chatID] != undefined && middleValue.origin != undefined) {
|
47
|
+
if (middleValue.origin.startsWith(`/`)) {
|
48
|
+
delete program.modules.telegram.functions.que.line[chatID];
|
49
|
+
}
|
50
|
+
}
|
51
|
+
|
45
52
|
if (program.modules.telegram.functions.que.line[chatID] != undefined) {
|
46
53
|
// It's original que
|
47
54
|
// Process response
|
@@ -91,7 +98,13 @@ module.exports = {
|
|
91
98
|
case command:
|
92
99
|
console.log(`It's the dynamic thing`);
|
93
100
|
matched = matchCheck;
|
94
|
-
let variable
|
101
|
+
let variable;
|
102
|
+
if (data.message != undefined) {
|
103
|
+
variable = data.message[command]
|
104
|
+
} else if (data.callback_query != undefined) {
|
105
|
+
variable = data.callback_query
|
106
|
+
}
|
107
|
+
|
95
108
|
anwserData = {
|
96
109
|
type : command,
|
97
110
|
data : variable
|
@@ -112,7 +125,7 @@ module.exports = {
|
|
112
125
|
// Send command when wrong // or buttons like reset button
|
113
126
|
// check what to do
|
114
127
|
// check if stop
|
115
|
-
if (middleValue.text == `reset` || middleValue.text `stop`) {
|
128
|
+
if (String(middleValue.text) == `reset` || String(middleValue.text) == `stop`) {
|
116
129
|
delete program.modules.telegram.functions.que.line[chatID];
|
117
130
|
}
|
118
131
|
return false;
|
@@ -159,6 +172,13 @@ module.exports = {
|
|
159
172
|
// Get item
|
160
173
|
const theScript = script[scriptStart];
|
161
174
|
|
175
|
+
if (scriptStart == `finish`) {
|
176
|
+
// Delete from list
|
177
|
+
setTimeout(function(){
|
178
|
+
delete program.modules.telegram.functions.que.line[chatID];
|
179
|
+
},150);
|
180
|
+
}
|
181
|
+
|
162
182
|
// Create replacelist
|
163
183
|
let replace = {
|
164
184
|
"{{URL}}" : process.env.url,
|