djs-builder 0.6.38 → 0.6.40

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
@@ -1800,34 +1800,35 @@ module.exports = {
1800
1800
  data: new SlashCommandBuilder()
1801
1801
  .setName("reload")
1802
1802
  .setDescription("Reload bot commands/events")
1803
- .addStringOption(option =>
1804
- option.setName("type")
1805
- .setDescription("What to reload?")
1806
- .setRequired(true)
1807
- .addChoices(
1808
- { name: "Prefix Commands", value: "prefix" },
1809
- { name: "Slash Commands", value: "slash" },
1810
- { name: "Events", value: "events" },
1811
- { name: "All", value: "all" }
1812
- )
1803
+ .addStringOption((option) =>
1804
+ option
1805
+ .setName("type")
1806
+ .setDescription("What to reload?")
1807
+ .setRequired(true)
1808
+ .addChoices(
1809
+ { name: "Prefix Commands", value: "prefix" },
1810
+ { name: "Slash Commands", value: "slash" },
1811
+ { name: "Events", value: "events" },
1812
+ { name: "All", value: "all" }
1813
+ )
1813
1814
  ),
1815
+ ownerOnly: true,
1814
1816
  async run(interaction, client) {
1815
1817
  // Check for owner permission (Recommended)
1816
- if (interaction.user.id !== client.ownerId) {
1817
- return interaction.reply({ content: "❌ Only the bot owner can use this!", ephemeral: true });
1818
- }
1819
1818
 
1820
1819
  const type = interaction.options.getString("type");
1821
-
1820
+
1822
1821
  try {
1823
- await interaction.deferReply();
1824
- await reload(client, type);
1825
- await interaction.editReply(`✅ Successfully reloaded **${type}**! 🚀`);
1822
+ await interaction.deferReply();
1823
+ await reload(client, type);
1824
+ await interaction.editReply(`✅ Successfully reloaded **${type}**! 🚀`);
1826
1825
  } catch (error) {
1827
- console.error(error);
1828
- await interaction.editReply("❌ Failed to reload. Check console for errors.");
1826
+ console.error(error);
1827
+ await interaction.editReply(
1828
+ "❌ Failed to reload. Check console for errors."
1829
+ );
1829
1830
  }
1830
- }
1831
+ },
1831
1832
  };
1832
1833
  ```
1833
1834
 
@@ -1840,7 +1841,6 @@ module.exports = {
1840
1841
 
1841
1842
  </details>
1842
1843
 
1843
-
1844
1844
  ---
1845
1845
 
1846
1846
  ## ⚡ Commands & Events
@@ -260,14 +260,13 @@ async function starter(client, options) {
260
260
  if (command.dmOnly && message.guild) return;
261
261
  if (
262
262
  command.devOnly &&
263
- client.ownerId &&
264
- message.author.id !== client.ownerId
263
+ message.author.id !== client.owner.id
265
264
  )
266
265
  return;
267
266
  if (
268
267
  command.ownerOnly &&
269
268
  message.guild &&
270
- message.author.id !== message.guild.ownerId
269
+ message.author.id !== (await message.guild.fetchOwner()).id
271
270
  )
272
271
  return;
273
272
 
@@ -316,7 +315,7 @@ async function starter(client, options) {
316
315
  if (
317
316
  command.ownerOnly &&
318
317
  interaction.guild &&
319
- interaction.user.id !== interaction.guild.ownerId
318
+ interaction.user.id !== (await interaction.guild.fetchOwner()).id
320
319
  ) {
321
320
  return interaction.reply({
322
321
  content: "`❌` هذا الأمر محصور لصاحب السيرفر فقط!",
@@ -326,8 +325,7 @@ async function starter(client, options) {
326
325
 
327
326
  if (
328
327
  command.devOnly &&
329
- client.ownerId &&
330
- interaction.user.id !== client.ownerId
328
+ interaction.user.id !== client.owner.id
331
329
  ) {
332
330
  return interaction.reply({
333
331
  content: "`❌` هذا الأمر محصور لصاحب البوت فقط!",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "djs-builder",
3
- "version": "0.6.38",
3
+ "version": "0.6.40",
4
4
  "note": "🎉 Package Update! 🥏\n\n- 📚 Documentation: Added full guide for Giveaway System & Hot Reloading.\n- 🐛 Bug Fixes: Fixed critical issue in Giveaway winner selection.\n\n🔗 Learn more on [NPM](https://www.npmjs.com/package/djs-builder)",
5
5
  "description": "🎉 Package Update! 🥏",
6
6
  "main": "handler/starter.js",