Fixed pagination and typing in DMs

This commit is contained in:
Essem 2021-08-13 21:34:44 -05:00
parent a75c55a1ca
commit e3fca9f4e9
No known key found for this signature in database
GPG key ID: 7D497397CC3A2A8C
6 changed files with 6 additions and 6 deletions

View file

@ -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);

View file

@ -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);