I'm currently doing a bot project, and having a giveaway feature, so basically I do p!start
the bot only send "Giveaway started in (channel name)"
but not showing the message regarding the giveaway
Here's my code, any solution for this, appreciate for your time
run: async (bot, message, args) => {
if(!message.member.hasPermission('MANAGE_MESSAGES') && !message.member.roles.cache.some((r) => r.name === "Giveaways")){
return message.channel.send(':x: You need to have the manage messages permissions to start giveaways.');
}
let giveawayChannel = message.mentions.channels.first();
if(!giveawayChannel){
return message.channel.send(':x: You have to mention a valid channel!');
}
let giveawayDuration = args[1];
if(!giveawayDuration || isNaN(ms(giveawayDuration))){
return message.channel.send(':x: You have to specify a valid duration!');
}
let giveawayNumberWinners = args[2];
if(isNaN(giveawayNumberWinners) || (parseInt(giveawayNumberWinners) <= 0)){
return message.channel.send(':x: You have to specify a valid number of winners!');
}
let giveawayPrize = args.slice(3).join(' ');
if(!giveawayPrize){
return message.channel.send(':x: You have to specify a valid prize!');
}
bot.giveawaysManager.start(giveawayChannel, {
time: ms(giveawayDuration),
prize: giveawayPrize,
winnerCount: giveawayNumberWinners,
hostedBy: message.author,
message: {
giveaway: "🎉🎉 **GIVEAWAY** 🎉🎉",
giveawayEnded: "🎉🎉 **GIVEAWAY ENDED** 🎉🎉",
timeRemaining: "Time remaining: **{duration}**!",
inviteToParticipate: "React with 🎉 to participate!",
winMessage: "Congratulations, {winners}! You won **{prize}**!",
embedFooter: "Giveaways",
noWinner: "Giveaway cancelled, no valid participations.",
hostedBy: "Hosted by: {user}",
winners: "winner(s)",
endedAt: "Ended at",
units: {
seconds: "seconds",
minutes: "minutes",
hours: "hours",
days: "days",
pluralS: false
}
}
});
}
message.channel.send(`Giveaway started in ${giveawayChannel}!`);
}
}