webfast 0.1.21 → 0.1.25
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +21 -3
- package/index.js +2 -1
- package/modules/bots/applications/telegram.js +10 -2
- package/package.json +1 -1
package/README.md
CHANGED
@@ -84,11 +84,29 @@ module.exports = {
|
|
84
84
|
}
|
85
85
|
}
|
86
86
|
|
87
|
-
|
88
|
-
|
87
|
+
## Important Note on Including WebFast
|
88
|
+
|
89
|
+
When integrating WebFast into your project, consider the following instructions:
|
90
|
+
|
91
|
+
```javascript
|
92
|
+
// If you want to set up your own paths, add "paths: true" when requiring WebFast.
|
93
|
+
// This will prompt WebFast to look for specific folders within your project directory.
|
89
94
|
|
90
|
-
|
95
|
+
const program = require('webfast')({
|
96
|
+
paths: true,
|
97
|
+
path: __dirname
|
98
|
+
});
|
91
99
|
```
|
100
|
+
In this configuration:
|
101
|
+
|
102
|
+
The paths: true option instructs WebFast to search for specific folders within the project directory.
|
103
|
+
|
104
|
+
The path: __dirname parameter sets the base directory for WebFast, where it will look for the following essential folders:
|
105
|
+
|
106
|
+
bots
|
107
|
+
ejs
|
108
|
+
routes
|
109
|
+
Within these folders, you can establish a dynamic setup, as exemplified in the module itself.
|
92
110
|
|
93
111
|
```
|
94
112
|
## License
|
package/index.js
CHANGED
@@ -264,7 +264,8 @@ module.exports = async function(program,folder) {
|
|
264
264
|
console.error(`Error Setting URL`);
|
265
265
|
}
|
266
266
|
|
267
|
-
|
267
|
+
let teleData = program.path.join(__dirname,`telegram`);
|
268
|
+
|
268
269
|
let moduleData = await program.modules.walkDirectory(teleData);
|
269
270
|
// Loop Through
|
270
271
|
let telegram = {
|
@@ -296,6 +297,10 @@ module.exports = async function(program,folder) {
|
|
296
297
|
}
|
297
298
|
|
298
299
|
let middleWareFolder = program.path.join(__dirname,`telegram`,`middleware`);
|
300
|
+
if (program.set.path != undefined) {
|
301
|
+
middleWareFolder = program.path.join(program.set.path,`bots`,`telegram`,`middleware`);
|
302
|
+
}
|
303
|
+
|
299
304
|
console.log(`MiddleWare:`,middleWareFolder);
|
300
305
|
|
301
306
|
let middleWareData = program.fs.readdirSync(middleWareFolder);
|
@@ -333,7 +338,10 @@ module.exports = async function(program,folder) {
|
|
333
338
|
telegram.middleware = middleWarFuncs;
|
334
339
|
|
335
340
|
// Process scripts
|
336
|
-
|
341
|
+
let scriptsPath = program.path.join(__dirname,`telegram`,`scripts`);
|
342
|
+
if (program.set.path != undefined) {
|
343
|
+
scriptsPath = program.path.join(program.set.path,`bots`,`telegram`,`scripts`);
|
344
|
+
}
|
337
345
|
|
338
346
|
// Loop Through scripts folder
|
339
347
|
let scriptsData = await program.modules.walkDirectory(scriptsPath);
|