Skip to content

Commit

Permalink
auth user fix
Browse files Browse the repository at this point in the history
  • Loading branch information
imranbarbhuiya committed Jan 3, 2022
1 parent 115910e commit 7ad998e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
CommandInteraction,
ContextMenuInteraction,
EmojiIdentifierResolvable,
GuildMember,
InteractionReplyOptions,
Message,
MessageActionRow,
Expand Down Expand Up @@ -710,7 +709,8 @@ class Pagination extends MessageEmbed {
return this;
}
/**
*
* Set authorized users who can use this pagination buttons.
* Leave it a empty array to allow everyone to use this pagination.
* @param authorizedUsers
* @returns
* @example
Expand All @@ -725,7 +725,7 @@ class Pagination extends MessageEmbed {
return this;
}
/**
*
* Add a authorized user who can use this pagination buttons.
* @param authorizedUser
* @returns
* @example
Expand All @@ -740,7 +740,7 @@ class Pagination extends MessageEmbed {
return this;
}
/**
*
* Add multiple authorized users who can use this pagination buttons.
* @param authorizedUsers
* @returns
* @example
Expand Down Expand Up @@ -1182,7 +1182,7 @@ class Pagination extends MessageEmbed {
collector.on("collect", async (i: ButtonInteraction) => {
if (
this.authorizedUsers.length &&
this.authorizedUsers.includes((i.member as GuildMember).id)
!this.authorizedUsers.includes(i.user.id)
)
return i.deferUpdate();
// here filter isn't used just to avoid the `interaction failed` error
Expand Down

0 comments on commit 7ad998e

Please sign in to comment.