Closed Jujugin closed 4 years ago
Are you using the latest version of the package?
@SoulHarsh007 I used the documentation (https://www.npmjs.com/package/discord-giveaways) by taking all the codes well but at the end of the giveaway it puts me this error "Giveaway canceled, no valid participations."
Here is my code:
`const Discord = require("discord.js"), client = new Discord.Client(), settings = { prefix: "g!", token: "my token" };
// Requires Manager from discord-giveaways const { GiveawaysManager } = require("discord-giveaways"); // Starts updating currents giveaways const manager = new GiveawaysManager(client, { storage: "./giveaways.json", updateCountdownEvery: 5000, default: { botsCanWin: false, exemptPermissions: [ "MANAGE_MESSAGES", "ADMINISTRATOR" ], embedColor: "#FF0000", reaction: "🎉" } });
client.on("message", (message) => {
const ms = require("ms"); // npm install ms
const args = message.content.slice(settings.prefix.length).trim().split(/ +/g);
const command = args.shift().toLowerCase();
if(command === "start-giveaway"){
// g!start-giveaway 2d 1 Awesome prize!
// will create a giveaway with a duration of two days, with one winner and the prize will be "Awesome prize!"
client.giveawaysManager.start(message.channel, {
time: ms(args[0]),
prize: args.slice(2).join(" "),
winnerCount: parseInt(args[1])
}).then((gData) => {
console.log(gData); // {...} (messageid, end date and more)
});
// And the giveaway has started!
}
});
client.on("message", (message) => {
const ms = require("ms"); // npm install ms
const args = message.content.slice(settings.prefix.length).trim().split(/ +/g);
const command = args.shift().toLowerCase();
if(command === "reroll"){
let messageID = args[0];
client.giveawaysManager.reroll(messageID).then(() => {
message.channel.send("Success! Giveaway rerolled!");
}).catch((err) => {
message.channel.send("No giveaway found for "+messageID+", please check and try again");
});
}
});
client.on("message", (message) => {
const args = message.content.slice(settings.prefix.length).trim().split(/ +/g);
const command = args.shift().toLowerCase();
if(command === "edit"){
let messageID = args[0];
client.giveawaysManager.edit(messageID, {
newWinnerCount: 3,
newPrize: "New Prize!",
addTime: 5000
}).then(() => {
message.channel.send("Success! Giveaway will updated in less than "+(manager.updateCountdownEvery/1000)+" seconds.");
}).catch((err) => {
message.channel.send("No giveaway found for "+messageID+", please check and try again");
});
}
});
client.on("message", (message) => {
const args = message.content.slice(settings.prefix.length).trim().split(/ +/g);
const command = args.shift().toLowerCase();
if(command === "delete"){
let messageID = args[0];
client.giveawaysManager.delete(messageID).then(() => {
message.channel.send("Success! Giveaway deleted!");
}).catch((err) => {
message.channel.send("No giveaway found for "+messageID+", please check and try again");
});
}
});
// We now have a giveawaysManager property to access the manager everywhere! client.giveawaysManager = manager;
client.on("ready", () => { console.log("I'm ready !"); });
client.login(settings.token);`
@Jujugin are you sure that the people who reacted doesn't have the manage messages permissions?
@Androz2091 I managed to get the error, it's this:
function Error () {[native code]}
What do you mean? Did you see my question? https://github.com/Androz2091/discord-giveaways/issues/33#issuecomment-593121076
yes, I made a giveaway on my server of +100 members so I believe that there must be 1 who had the permissions ...
I wanted to know if there was at least one member who doesn't have the member. If I well understood, yes.
Also, did you use a custom reaction?
no i use the basic reaction
All right, and what Discord.js version are you using? (run npm list
to know)
discord.js@11.6.1
vous êtes français ?
Peut-être que c'est a cause de ça
Maybe it's because of that
Oui, je n'avais pas lu que tu avais utilisé google trad. Normalement ça ne devrait pas poser de problèmes. Tu n'utilises que les commandes de giveaways dans ton bot ?
oui je n'utilise que les commande de giveaway car avant de l'incruster dans mon bot principal je voulais voir si sa marchait.
D'accord, et tu n'as aucune erreur dans la console?
non 0 erreur juste dans le chat
C'est étrange... Tu peux réessayer comme ça ?
const manager = new GiveawaysManager(client, {
storage: "./giveaways.json",
updateCountdownEvery: 5000,
default: {
botsCanWin: true,
exemptPermissions: [],
embedColor: "#FF0000",
reaction: "🎉"
}
});
Merci sa marche ! Je vous en remercie ! D'ailleurs j'ai regarder votre github et j'ai été bluffé vraiment ! Bravo d'avoir quelqu'un qui s'y connaisse vraiment et qui partagent son code ! Merci ! Sinon j'ai une question est-ce que les commandes ont une verification de permissions déjà créer ? Ou je doit le faire moi même.
Parfait 👍 Tu dois ajouter toi-même les permissions que tu veux. Tu peux regarder ce bot pour exemple: https://github.com/Androz2091/giveaways-bot
Hello, I installed the module as well as the code everything works well I launch the giveaway everything works well but at the end or its must choose the winner and well its said to me in the embed of the giveaway:
"Giveaway canceled, no valid participations . "
I who thought it was because there were not enough participants I did a test on my server and 10 people participated but its made the same mistake.I really need help!
The code seems to work really well and developed but this error means that I cannot use it.
Thank you for your help
(I translated on google translation because I'm French maybe there is an error in the translation)