js-discord-modularcommand 3.2.2 → 3.2.3

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.
@@ -375,9 +375,13 @@ function createButtonExecutor(command) {
375
375
  const buttonObject = command.buttons.get(interaction.customId.split('_')[1]);
376
376
  if (!buttonObject)
377
377
  return;
378
- if (!buttonObject.allowOthers && interaction.user.id !== interaction.message.author.id) {
379
- await interaction.reply({ content: locales_1.LOCALE_FORBIDDEN[interaction.locale], flags: discord_js_1.MessageFlags.Ephemeral });
380
- return;
378
+ // Check if the button is allowed to be used by others
379
+ if (buttonObject.allowOthers === false) {
380
+ const interactionData = interaction.message.interactionMetadata;
381
+ if (interactionData !== null && interactionData.user.id !== interaction.user.id) {
382
+ await interaction.reply({ content: locales_1.LOCALE_FORBIDDEN[interaction.locale], flags: discord_js_1.MessageFlags.Ephemeral });
383
+ return;
384
+ }
381
385
  }
382
386
  await buttonObject.execute({
383
387
  interaction,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "js-discord-modularcommand",
3
- "version": "3.2.2",
3
+ "version": "3.2.3",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "discord",