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.
@@ -5,7 +5,6 @@ const {
5
5
  UserSelectMenuBuilder,
6
6
  ActionRowBuilder,
7
7
  ButtonBuilder,
8
- WebhookClient,
9
8
  } = require("discord.js");
10
9
 
11
10
  const axios = require("axios");
package/handler/helper.js CHANGED
@@ -302,7 +302,7 @@ async function update(client, id, webhookURL) {
302
302
  `https://registry.npmjs.org/djs-builder/latest`
303
303
  );
304
304
  const new_version = data.version;
305
- const note = data.description || "";
305
+ const note = data.note || "";
306
306
 
307
307
 
308
308
  if (
@@ -29,7 +29,7 @@ async function starter(client, options) {
29
29
 
30
30
  //////////////////////////////////////////* status set !////////////////////////////////////////////////////////
31
31
  client.login(token);
32
- client.once("clientReady", () => {
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
- client.on("messageCreate", async (message) => {
154
- if (message.author.bot) return;
153
+ client.on("messageCreate", async (message) => {
154
+ if (message.author.bot) return;
155
155
 
156
- const content = message.content.trim();
156
+ const content = message.content.trim();
157
+ let command_name = null;
158
+ let pre = false;
157
159
 
158
- let command_name = null;
159
- let pre = false;
160
+ let usedPrefix = prefix?.prefix || "!";
160
161
 
161
- if (prefix && content.startsWith(prefix.prefix)) {
162
- command_name = content.slice(prefix.prefix.length).split(/\s+/)[0];
163
- pre = true;
164
- } else {
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("clientReady", async () => {
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.21",
4
- "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\nšŸ”— Learn more on [NPM](https://www.npmjs.com/package/djs-builder)",
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",