djs-builder 0.6.21 ā 0.6.23
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/function.js +0 -1
- package/handler/helper.js +1 -1
- package/handler/starter.js +20 -12
- package/package.json +3 -2
package/function/function.js
CHANGED
package/handler/helper.js
CHANGED
package/handler/starter.js
CHANGED
|
@@ -29,7 +29,7 @@ async function starter(client, options) {
|
|
|
29
29
|
|
|
30
30
|
//////////////////////////////////////////* status set !////////////////////////////////////////////////////////
|
|
31
31
|
client.login(token);
|
|
32
|
-
client.once("
|
|
32
|
+
client.once("ready", () => {
|
|
33
33
|
if (Status) {
|
|
34
34
|
const activities = Array.isArray(Status.activities)
|
|
35
35
|
? Status.activities
|
|
@@ -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);
|
|
@@ -323,7 +331,7 @@ async function starter(client, options) {
|
|
|
323
331
|
await set_anticrash(anticrash);
|
|
324
332
|
}
|
|
325
333
|
|
|
326
|
-
client.once("
|
|
334
|
+
client.once("ready", async () => {
|
|
327
335
|
if (ownerId) client.owner = await client.users.fetch(ownerId);
|
|
328
336
|
if (client.slashData?.length) {
|
|
329
337
|
await client.application.commands.set(client.slashData);
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "djs-builder",
|
|
3
|
-
"version": "0.6.
|
|
4
|
-
"
|
|
3
|
+
"version": "0.6.23",
|
|
4
|
+
"note": "š 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)",
|
|
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",
|
|
5
6
|
"main": "handler/starter.js",
|
|
6
7
|
"dependencies": {
|
|
7
8
|
"axios": "^1.11.0",
|