djs-builder 0.6.15 → 0.6.17

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/README.md CHANGED
@@ -199,7 +199,7 @@ const { Wait } = require('djs-builder');
199
199
  const message = await Wait({
200
200
  context: message, /// message or interaction
201
201
  userId : (message.author.id || interaction.user.id), /// user id
202
- type: "button", /// message or button or both 💪
202
+ type: "interaction", /// message to wait message or interaction to wait button/menu or both 💪
203
203
  time: 30000 /// time in ms
204
204
  message_Wait : message /// message of button (for button or both)
205
205
  });
@@ -73,7 +73,7 @@ async function Wait({
73
73
  }
74
74
  }
75
75
 
76
- if (type === "button") {
76
+ if (type === "interaction") {
77
77
  const message = message_Wait;
78
78
  if (!message)
79
79
  throw new Error(
@@ -187,7 +187,8 @@ function CreateRow(components) {
187
187
  value = false,
188
188
  id = false,
189
189
  max = false,
190
- min = false,
190
+ min = false,
191
+ disabled = false
191
192
  } = options;
192
193
 
193
194
  const selectOptions = data.map((item, index) => {
@@ -224,6 +225,10 @@ function CreateRow(components) {
224
225
  selectMenu.addOptions(selectOptions);
225
226
  }
226
227
 
228
+ if (options.hasOwnProperty("disabled")) {
229
+ selectMenu.setDisabled(options.disabled);
230
+ }
231
+
227
232
  actionRows.push(new ActionRowBuilder().addComponents(selectMenu));
228
233
  } else {
229
234
  throw new Error("Invalid component format");
@@ -240,14 +245,14 @@ async function GetUser(message) {
240
245
  let user = message.mentions.members.first();
241
246
  let new_args = args;
242
247
 
243
- // إذا ماكو منشن → جرب الـ ID
248
+
244
249
  if (!user && args[0]) {
245
250
  const userId = args[0];
246
251
  user = await message.guild.members.fetch(userId).catch(() => null);
247
252
  new_args = args.slice(1);
248
253
  }
249
254
 
250
- // إذا ماكو منشن ولا ID → جرب الرد
255
+
251
256
  if (!user && message.reference) {
252
257
  const repliedMessage = await message.channel.messages
253
258
  .fetch(message.reference.messageId)
@@ -244,7 +244,7 @@ async function starter(client, options) {
244
244
  ) {
245
245
  return interaction.reply({
246
246
  content: "`❌` هذا الأمر محصور لصاحب السيرفر فقط!",
247
- ephemeral: true,
247
+ flags: 64,
248
248
  });
249
249
  }
250
250
 
@@ -255,21 +255,21 @@ async function starter(client, options) {
255
255
  ) {
256
256
  return interaction.reply({
257
257
  content: "`❌` هذا الأمر محصور لصاحب البوت فقط!",
258
- ephemeral: true,
258
+ flags: 64,
259
259
  });
260
260
  }
261
261
 
262
262
  if (command.guildOnly && !interaction.guild) {
263
263
  return interaction.reply({
264
264
  content: "`❌` هذا الأمر محصور لسيرفرات فقط!",
265
- ephemeral: true,
265
+ flags: 64,
266
266
  });
267
267
  }
268
268
 
269
269
  if (command.dmOnly && interaction.guild) {
270
270
  return interaction.reply({
271
271
  content: "`❌` هذا الأمر محصور لمحادثات الخاصة فقط!",
272
- ephemeral: true,
272
+ flags: 64,
273
273
  });
274
274
  }
275
275
 
@@ -282,7 +282,7 @@ async function starter(client, options) {
282
282
  ) {
283
283
  return interaction.reply({
284
284
  content: "`❌` أنت لا تملك صلاحيات كافية لتنفيذ هذا الأمر.",
285
- ephemeral: true,
285
+ flags: 64,
286
286
  });
287
287
  }
288
288
 
@@ -298,12 +298,12 @@ async function starter(client, options) {
298
298
  if (interaction.replied || interaction.deferred) {
299
299
  await interaction.followUp({
300
300
  content: "`❌` حدث خطأ أثناء تنفيذ الأمر.",
301
- ephemeral: true,
301
+ flags: 64,
302
302
  });
303
303
  } else {
304
304
  await interaction.reply({
305
305
  content: "`❌` حدث خطأ أثناء تنفيذ الأمر.",
306
- ephemeral: true,
306
+ flags: 64,
307
307
  });
308
308
  }
309
309
  }
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
 
2
2
  {
3
3
  "name": "djs-builder",
4
- "version": "0.6.15",
5
- "description": "🎉 Package Update! 🥏\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)",
4
+ "version": "0.6.17",
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)",
6
6
  "main": "handler/starter.js",
7
7
  "dependencies": {
8
8
  "axios": "^1.11.0",