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

v13 ? #361

Closed irasakipkm closed 3 years ago

irasakipkm commented 3 years ago

Hello can you update the package to discord js v13, because the embed is not working.

thank you

Nico105 commented 3 years ago

You can already install the branch for it if you want. npm i Androz2091/discord-giveaways#discord.js-v13 Tho don't do that with old gaws still running.

Nico105 commented 3 years ago

npm i Androz2091/discord-giveaways#discord.js-v13

` Since I installed version 13 of the giveaway I tried to update the functions the link to the giveaway message no longer works, it redirects me to my friends instead of the giveaway can you help me?

client.giveawaysManager.on('giveawayReactionAdded', async (giveaway, member, reaction) => {
    if (member.user.bot) return;
    try {
      if(giveaway.extraData){
      await client.guilds.cache.get(giveaway.extraData.server).members.fetch(member.id)
      }
      const embed1 = new MessageEmbed()
       // new Discord.MessageEmbed()

          .setTitle(`Giveaway entry approved`)
          .setDescription(
            `Your entry to this giveaway [${giveaway.prize}](https://discord.com/channels/${giveaway.guildID}/${giveaway.channelID}/${giveaway.messageID}) has been approved.`
          )

          .setColor("RANDOM")
          .setTimestamp(`${new Date(giveaway.endAt).toISOString()}`)

      member.send({ embeds: [embed1] });

    } catch (error) {
    }})

Vous pouvez déjà installer la branche pour cela si vous le souhaitez. npm i Androz2091/discord-giveaways#discord.js-v13 Ne fais pas ça avec les vieux gaws toujours en marche.

First, I already mentioned that using try catch like that is a little counterproductive, but nvm.

What do you mean by "I tried to update the functions"? What functions?

And regarding the link, it should work fine. What do you mean with "it redirects me to my friends"? Friends what?

irasakipkm commented 3 years ago

npm i Androz2091/discord-giveaways#discord.js-v13

` Since I installed version 13 of the giveaway I tried to update the functions the link to the giveaway message no longer works, it redirects me to my friends instead of the giveaway can you help me?

client.giveawaysManager.on('giveawayReactionAdded', async (giveaway, member, reaction) => {
    if (member.user.bot) return;
    try {
      if(giveaway.extraData){
      await client.guilds.cache.get(giveaway.extraData.server).members.fetch(member.id)
      }
      const embed1 = new MessageEmbed()
       // new Discord.MessageEmbed()

          .setTitle(`Giveaway entry approved`)
          .setDescription(
            `Your entry to this giveaway [${giveaway.prize}](https://discord.com/channels/${giveaway.guildID}/${giveaway.channelID}/${giveaway.messageID}) has been approved.`
          )

          .setColor("RANDOM")
          .setTimestamp(`${new Date(giveaway.endAt).toISOString()}`)

      member.send({ embeds: [embed1] });

    } catch (error) {
    }})

Vous pouvez déjà installer la branche pour cela si vous le souhaitez. npm i Androz2091/discord-giveaways#discord.js-v13 Ne fais pas ça avec les vieux gaws toujours en marche.

First, I already mentioned that using try catch like that is a little counterproductive, but nvm.

What do you mean by "I tried to update the functions"? What functions?

And regarding the link, it should work fine. What do you mean with "it redirects me to my friends"? Friends what?

the link does not redirect me to the giveaway but to the friends box of Discord

Nico105 commented 3 years ago

.

Ah right, I forgot you're using v13, thingID changed to thingId. you have to adjust that. But honestly, it would be easier if you just use giveaway.messageURL

irasakipkm commented 3 years ago

thanks a lot for your help

.

Ah right, I forgot you're using v13, thingID changed to thingId. you have to adjust that. But honestly, it would be easier if you just use giveaway.messageURL

Androz2091 commented 3 years ago

Discord Giveaways now supports Discord.js v13. Run npm install discord-giveaways@latest to update!