Androz2091 / discord-giveaways

🎉 Complete framework to facilitate the creation of giveaways using discord.js
https://discord-giveaways.js.org
MIT License
335 stars 127 forks source link

Custom Giveaways Manager #400

Closed irasakipkm closed 2 years ago

irasakipkm commented 3 years ago

hello I have the impression that my bot does not take into account my configuration file because I am using CustomGiveawaysManager

for example I have deactivated the everyone mention, but it still displays this message to me, what should I do?

https://i.ibb.co/0q4cR33/bot.png

class CustomGiveawaysManager extends GiveawaysManager { generateMainEmbed(giveaway) { const embed = new Discord.MessageEmbed(); embed

        .setTitle(giveaway.prize)
        .setColor("RANDOM")

        .setDescription(`${giveaway.prize} \n  <t:${Math.round(giveaway.endAt / 1000)}:R>

        `)

    return embed;
}

how to remove the text which appears above the embed? ":tada: :tada: GIVEAWAY :tada: :tada:" Can you help me please ?

Nico105 commented 3 years ago

https://discord-giveaways.js.org/global.html#GiveawayMessages

irasakipkm commented 3 years ago

https://discord-giveaways.js.org/global.html#GiveawayMessages

Thanks but how to configure it so that it does not display it?

I have this in my messages.js file

giveaway: (config.everyoneMention ? "@everyone\n\n" : "")+"🎉🎉 GIVEAWAY 🎉🎉", giveawayEnded: (config.everyoneMention ? "@everyone\n\n" : "")+"🎉🎉 GIVEAWAY ENDED 🎉🎉",

**and my config.json** 

   "everyoneMention": false,

   but it shows it anyway
Nico105 commented 3 years ago

https://discord-giveaways.js.org/global.html#GiveawayMessages

Thanks but how to configure it so that it does not display it?

I have this in my messages.js file

giveaway: (config.everyoneMention ? "@everyone\n\n" : "")+"🎉🎉 GIVEAWAY 🎉🎉", giveawayEnded: (config.everyoneMention ? "@everyone\n\n" : "")+"🎉🎉 GIVEAWAY ENDED 🎉🎉",

**and my config.json** 

   "everyoneMention": false,

   but it shows it anyway

You should learn how ternary operators work: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Conditional_Operator

config.everyoneMention is only responsible for the "@everyone\n\n" part. The +"🎉🎉 GIVEAWAY 🎉🎉" will always be there because it is outside of the brackets () for the ? : So you have to adjust that.