mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2024-11-17 09:23:07 +02:00
fix: guild selector not filtering guilds (closes #408)
This commit is contained in:
parent
fa921fa5a6
commit
739efdcc3a
@ -2,14 +2,11 @@ const { PermissionsBitField } = require('discord.js');
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param {import("client")} client
|
* @param {import("discord.js").Client} client
|
||||||
* @param {string} userId
|
* @param {string} userId
|
||||||
* @returns {Promise<Collection<import("discord.js").Guild>}
|
* @returns {Promise<Collection<import("discord.js").Guild>}
|
||||||
*/
|
*/
|
||||||
module.exports.getCommonGuilds = async (client, userId) => await client.guilds.cache.filter(async guild => {
|
module.exports.getCommonGuilds = (client, userId) => client.guilds.cache.filter(guild => guild.members.cache.has(userId));
|
||||||
const member = await guild.members.fetch(userId);
|
|
||||||
return !!member;
|
|
||||||
});
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {import("discord.js").Guild} guild
|
* @param {import("discord.js").Guild} guild
|
||||||
|
Loading…
Reference in New Issue
Block a user