How to check if randomServerWithAd blacklisted the server that is running this command.

module.exports = {
data: new SlashCommandBuilder()
.setName("partner")
.setDescription("Partner with a random guild"),

async execute(interaction) {
const guildData = db.collection("guild-data");
const [randomServerWithAd, randomAd, yourGuildData] = await Promise.all([
guildData.aggregate([
{ $match: { guildId: { $ne: interaction.guildId }, "advertisement.message": { $exists: true }, "allowPartners": true } },
{ $sample: { size: 1 } }
]).next(),
guildData.aggregate([
{ $match: { "short_ad.ad": { $exists: true } } },
{ $sample: { size: 1 } }
]).next(),
guildData.findOne({ guildId: interaction.guildId })
]);


module.exports = {
data: new SlashCommandBuilder()
.setName("partner")
.setDescription("Partner with a random guild"),

async execute(interaction) {
const guildData = db.collection("guild-data");
const [randomServerWithAd, randomAd, yourGuildData] = await Promise.all([
guildData.aggregate([
{ $match: { guildId: { $ne: interaction.guildId }, "advertisement.message": { $exists: true }, "allowPartners": true } },
{ $sample: { size: 1 } }
]).next(),
guildData.aggregate([
{ $match: { "short_ad.ad": { $exists: true } } },
{ $sample: { size: 1 } }
]).next(),
guildData.findOne({ guildId: interaction.guildId })
]);


Hi, I'm trying to check if the variable "randomServerWithAd" blacklisted the server that is using the command from partnering with them. All blacklisted servers are stored through a DB. here is a look on how they are stored.
No description
2 Replies
d.js toolkit
d.js toolkit8mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by OP
Steve Jobs
Steve JobsOP8mo ago
Oh lol Thanks
Want results from more Discord servers?
Add your server