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.
Files changed (2) hide show
  1. package/handler/starter.js +18 -10
  2. package/package.json +4 -4
@@ -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);
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
-
2
1
  {
3
2
  "name": "djs-builder",
4
- "version": "0.6.20",
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\nšŸ”— Learn more on [NPM](https://www.npmjs.com/package/djs-builder)",
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.17.0"
13
+ "mongoose": "^8.18.0"
14
14
  }
15
15
  }