djs-builder 0.7.0 → 0.7.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/function/dash.js +20 -35
- package/handler/helper.js +31 -0
- package/handler/starter.js +6 -5
- package/package.json +1 -1
package/function/dash.js
CHANGED
|
@@ -10,35 +10,27 @@ const session = require("express-session");
|
|
|
10
10
|
const passport = require("passport");
|
|
11
11
|
const DiscordStrategy = require("passport-discord").Strategy;
|
|
12
12
|
const path = require("path");
|
|
13
|
+
const Table = require("cli-table3");
|
|
14
|
+
const chalk = require("chalk");
|
|
15
|
+
|
|
16
|
+
|
|
13
17
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
Glist = djsBuilder.Glist;
|
|
31
|
-
Gpause = djsBuilder.Gpause;
|
|
32
|
-
Gresume = djsBuilder.Gresume;
|
|
33
|
-
Gdelete = djsBuilder.Gdelete;
|
|
34
|
-
Gdata = djsBuilder.Gdata;
|
|
35
|
-
isBlacklisted = djsBuilder.isBlacklisted;
|
|
36
|
-
addToBlacklist = djsBuilder.addToBlacklist;
|
|
37
|
-
removeFromBlacklist = djsBuilder.removeFromBlacklist;
|
|
38
|
-
getBlacklist = djsBuilder.getBlacklist;
|
|
39
|
-
} catch (e) {
|
|
40
|
-
console.log("⚠️ djs-builder models not fully loaded:", e.message);
|
|
41
|
-
}
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
const { Level } = require("./level");
|
|
21
|
+
const {
|
|
22
|
+
Blacklist,
|
|
23
|
+
addToBlacklist,
|
|
24
|
+
removeFromBlacklist,
|
|
25
|
+
} = require("./blacklist");
|
|
26
|
+
const {
|
|
27
|
+
giveaway,
|
|
28
|
+
Gcheck,
|
|
29
|
+
Greroll,
|
|
30
|
+
Gpause,
|
|
31
|
+
Gresume,
|
|
32
|
+
Gdelete
|
|
33
|
+
} = require("./giveaway");
|
|
42
34
|
|
|
43
35
|
/**
|
|
44
36
|
* دالة لإنشاء وتشغيل لوحة التحكم
|
|
@@ -624,13 +616,6 @@ app.set("views", path.join(__dirname, "views"));
|
|
|
624
616
|
res.status(404).render("404", { botStats: getBotStats() });
|
|
625
617
|
});
|
|
626
618
|
|
|
627
|
-
// تشغيل الخادم
|
|
628
|
-
app.listen(port, () => {
|
|
629
|
-
console.log(`\n🌐 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━`);
|
|
630
|
-
console.log(` DJS-Builder Dashboard v2.0`);
|
|
631
|
-
console.log(` 🔗 http://localhost:${port}`);
|
|
632
|
-
console.log(`━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n`);
|
|
633
|
-
});
|
|
634
619
|
|
|
635
620
|
return app;
|
|
636
621
|
}
|
package/handler/helper.js
CHANGED
|
@@ -4,6 +4,8 @@ const chalk = require("chalk");
|
|
|
4
4
|
const path = require("path");
|
|
5
5
|
const fs = require("fs");
|
|
6
6
|
const axios = require("axios");
|
|
7
|
+
const { dashboard } = require("../function/dash");
|
|
8
|
+
|
|
7
9
|
|
|
8
10
|
async function cooldowns(client, name, time, user) {
|
|
9
11
|
const cooldownKey = `${name}_${user.id}`;
|
|
@@ -124,11 +126,40 @@ async function terminalInfo(client, options, data) {
|
|
|
124
126
|
}
|
|
125
127
|
}
|
|
126
128
|
|
|
129
|
+
let dashTable
|
|
130
|
+
if (options.dashboard) {
|
|
131
|
+
|
|
132
|
+
await dashboard(client, options.dashboard);
|
|
133
|
+
const port = options.dashboard?.port || 3000;
|
|
134
|
+
dashTable = new Table({
|
|
135
|
+
head: [chalk.bold.cyan("🌐 Dashboard"), chalk.bold.green("📌 Value")],
|
|
136
|
+
colWidths: [25, 45],
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
dashTable.push(
|
|
141
|
+
[rowColors[0]("Status"), rowColors[0]("✅ Online")],
|
|
142
|
+
[rowColors[1]("URL"), rowColors[1](`http://localhost:${port}`)],
|
|
143
|
+
[rowColors[2]("Port"), rowColors[2](port)],
|
|
144
|
+
[rowColors[3]("Version"), rowColors[3]("v2.0.0")]
|
|
145
|
+
);
|
|
146
|
+
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
|
|
127
150
|
console.log(chalk.bold.green("\n✅ Bot Information:\n"));
|
|
128
151
|
console.log(firstTable.toString());
|
|
129
152
|
|
|
130
153
|
console.log(chalk.bold.blue("\n⚙️ Developer Settings:\n"));
|
|
131
154
|
console.log(secondTable.toString());
|
|
155
|
+
|
|
156
|
+
if (options.dashboard) {
|
|
157
|
+
console.log(chalk.bold.cyan("\n🌐 Dashboard Information:\n"));
|
|
158
|
+
console.log(dashTable.toString());
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
|
|
132
163
|
}
|
|
133
164
|
|
|
134
165
|
async function data_conecter(url) {
|
package/handler/starter.js
CHANGED
|
@@ -150,17 +150,17 @@ async function starter(client, options) {
|
|
|
150
150
|
const events = options.events || null;
|
|
151
151
|
const anticrash = options.anticrash || null;
|
|
152
152
|
const terminal = options.terminal || null;
|
|
153
|
-
|
|
153
|
+
|
|
154
|
+
|
|
154
155
|
|
|
155
|
-
//////////////////////////////////////////? Dashboard Loader ////////////////////////////////////////////////////////
|
|
156
|
-
if (dashboard) {
|
|
157
|
-
await dashboard(client, dashboard);
|
|
158
|
-
}
|
|
159
156
|
//////////////////////////////////////////! terminal info !////////////////////////////////////////////////////////
|
|
160
157
|
if (terminal) {
|
|
161
158
|
console.log("🚀 Bot is starting...");
|
|
162
159
|
}
|
|
163
160
|
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
|
|
164
164
|
//////////////////////////////////////////* status set !////////////////////////////////////////////////////////
|
|
165
165
|
client.login(token);
|
|
166
166
|
client.once("clientReady", () => {
|
|
@@ -517,6 +517,7 @@ const { Wait, CreateBar, CreateRow, GetUser } = require("../function/function");
|
|
|
517
517
|
const { Level, addXP, UserLevel, leaderboard } = require("../function/level");
|
|
518
518
|
const { log } = require("../function/log");
|
|
519
519
|
const { dashboard } = require("../function/dash");
|
|
520
|
+
|
|
520
521
|
const {
|
|
521
522
|
Blacklist,
|
|
522
523
|
isBlacklisted,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "djs-builder",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"note": "🎉 Package Update! 🥏\n\n- 🌐 NEW: Dashboard System - Modern web-based control panel!\n • Discord OAuth2 Login\n • Server Management\n • Level System Control\n • Giveaway Management\n • Blacklist Management\n- � Documentation: Full Dashboard guide added to README.\n- ✨ Standalone Usage: Use Dashboard with or without Starter!\n\n🔗 Learn more on [NPM](https://www.npmjs.com/package/djs-builder)",
|
|
5
5
|
"description": "🎉 NEW: Dashboard System - Web Control Panel! 🌐",
|
|
6
6
|
"main": "handler/starter.js",
|