djs-builder 0.6.20 ā 0.6.22
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/handler/starter.js +18 -10
- package/package.json +4 -4
package/handler/starter.js
CHANGED
|
@@ -150,20 +150,28 @@ async function starter(client, options) {
|
|
|
150
150
|
|
|
151
151
|
//////////////////////////////////////////* prefix run !////////////////////////////////////////////////////////
|
|
152
152
|
|
|
153
|
-
|
|
154
|
-
|
|
153
|
+
client.on("messageCreate", async (message) => {
|
|
154
|
+
if (message.author.bot) return;
|
|
155
155
|
|
|
156
|
-
|
|
156
|
+
const content = message.content.trim();
|
|
157
|
+
let command_name = null;
|
|
158
|
+
let pre = false;
|
|
157
159
|
|
|
158
|
-
|
|
159
|
-
let pre = false;
|
|
160
|
+
let usedPrefix = prefix?.prefix || "!";
|
|
160
161
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
command_name = content.split(/\s+/)[0];
|
|
162
|
+
if (options.prefix && options.prefix.custom_prefix && message.guild) {
|
|
163
|
+
const guildId = message.guild.id;
|
|
164
|
+
if (options.prefix.custom_prefix[guildId]) {
|
|
165
|
+
usedPrefix = options.prefix.custom_prefix[guildId];
|
|
166
166
|
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
if (content.startsWith(usedPrefix)) {
|
|
170
|
+
command_name = content.slice(usedPrefix.length).split(/\s+/)[0];
|
|
171
|
+
pre = true;
|
|
172
|
+
} else {
|
|
173
|
+
command_name = content.split(/\s+/)[0];
|
|
174
|
+
}
|
|
167
175
|
|
|
168
176
|
if (!command_name) return;
|
|
169
177
|
const command = client.prefixCommands.get(command_name);
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
2
1
|
{
|
|
3
2
|
"name": "djs-builder",
|
|
4
|
-
"version": "0.6.
|
|
5
|
-
"
|
|
3
|
+
"version": "0.6.22",
|
|
4
|
+
"note" : "123123",
|
|
5
|
+
"description": "š Package Update! š„\n- Add option `disabled` to the selectMenu options \nNew features added:\n- `GetUser`: Easily fetch a user from **ID**, **mention**, or even from a **reply**.\n\nš Fixes:\n- Minor bugs fixed\n- Improved stability and error handling\n- Custom prefix : add custom prefix for etch server\n\nš Learn more on [NPM](https://www.npmjs.com/package/djs-builder)",
|
|
6
6
|
"main": "handler/starter.js",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"axios": "^1.11.0",
|
|
@@ -10,6 +10,6 @@
|
|
|
10
10
|
"cli-table3": "^0.6.5",
|
|
11
11
|
"discord-inviter": "^0.9.3",
|
|
12
12
|
"discord.js": "^14.21.0",
|
|
13
|
-
"mongoose": "^8.
|
|
13
|
+
"mongoose": "^8.18.0"
|
|
14
14
|
}
|
|
15
15
|
}
|