Fixed pagination and typing in DMs
This commit is contained in:
parent
a75c55a1ca
commit
e3fca9f4e9
6 changed files with 6 additions and 6 deletions
|
@ -10,7 +10,7 @@ class InteractionCollector extends EventEmitter {
|
|||
this.bot = client;
|
||||
this.listener = async (packet) => {
|
||||
if (packet.t !== "INTERACTION_CREATE") return;
|
||||
await this.verify(packet.d.message, packet.d.data.custom_id, packet.d.id, packet.d.token, packet.d.member);
|
||||
await this.verify(packet.d.message, packet.d.data.custom_id, packet.d.id, packet.d.token, packet.d.member ? packet.d.member.id : packet.d.user.id);
|
||||
};
|
||||
this.bot.on("rawWS", this.listener);
|
||||
if (options.time) setTimeout(() => this.stop("time"), options.time);
|
||||
|
|
|
@ -74,7 +74,7 @@ module.exports = async (client, message, pages, timeout = 120000) => {
|
|||
if (pages.length > 1) {
|
||||
const interactionCollector = new InteractionCollector(client, currentPage, { time: timeout });
|
||||
interactionCollector.on("interaction", async (msg, interaction, id, token, member) => {
|
||||
if (member.user.id === message.author.id) {
|
||||
if (member === message.author.id) {
|
||||
switch (interaction) {
|
||||
case "back":
|
||||
await fetch(`https://discord.com/api/v8/interactions/${id}/${token}/callback`, ackOptions);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue