119
rated 0 times
[
121]
[
2]
/ answers: 1 / hits: 28220
/ 6 Years ago, tue, april 3, 2018, 12:00:00
My problem is that I want my discordbot wait during the giveaway until the giveway is out
Here's my code :
const Discord = require('discord.js');
const client = new Discord.Client();
const config = require(./config.json);
var prefix = config.prefix;
client.login(config.token);
client.on('ready',() => {
console.log('I'm online');
})
client.on('message', message => {
const args = message.content.slice(prefix.length).trim().split(/ +/g);
const command = args.shift().toLowerCase();
if (command === 'gstart') {
var channel = args[0].slice(2).slice(0, -1);
var price = args[1];
var End = args[2];
var EndMS = End*1000;
client.channels.get(channel).send({embed: {
color: 3447003,
author: {
name: '',
icon_url: ''
},
title: ,
url: ,
description: ,
fields: [{
name: 'a Giveaway just started !',
value: 'Put'🎉' in react of this message to try to win '' + price + ''.'
},
],
timestamp: '',
footer: {
icon_url: '',
text: 'End in ' + End + ' secondes !'
}
}
})
.then(msg => {
msg.react('🎉');
client.channels.get(channel).send('STUFF')(EndMS); // my problem is here
})
}
He must wait EndMS milis and, after, choose a winner but for now, he send instantly STUFF, for choosing the winner, I will not ask it for you.
All I want is he wait before sending Stuff.
Thanks you for helping me.
More From » wait