Update node.js
This commit is contained in:
parent
93ceaec93a
commit
ffeb9354c8
1 changed files with 39 additions and 36 deletions
73
node.js
73
node.js
|
@ -72,7 +72,9 @@ client.on('message', message => {
|
||||||
message.channel.send("Henlooo " + message.author.username + " " + emojis[randomNum]);
|
message.channel.send("Henlooo " + message.author.username + " " + emojis[randomNum]);
|
||||||
}
|
}
|
||||||
else if (message.mentions.channels.first() && yes) {
|
else if (message.mentions.channels.first() && yes) {
|
||||||
|
message.channel.send("Láskavo ma necrashuj...");
|
||||||
|
|
||||||
|
/*
|
||||||
if (args.length === 1) {
|
if (args.length === 1) {
|
||||||
message.react('🐮');
|
message.react('🐮');
|
||||||
let channelId = "";
|
let channelId = "";
|
||||||
|
@ -94,7 +96,7 @@ client.on('message', message => {
|
||||||
getChannel.send(storedLink);
|
getChannel.send(storedLink);
|
||||||
}
|
}
|
||||||
|
|
||||||
yes = false;
|
yes = false;*/
|
||||||
}
|
}
|
||||||
else if (msg.startsWith("how ye") && message.author.bot === false) {
|
else if (msg.startsWith("how ye") && message.author.bot === false) {
|
||||||
let randomNum = Math.floor(Math.random() * 5);
|
let randomNum = Math.floor(Math.random() * 5);
|
||||||
|
@ -111,35 +113,6 @@ client.on('message', message => {
|
||||||
});
|
});
|
||||||
|
|
||||||
function countdowns(plus) {
|
function countdowns(plus) {
|
||||||
now = new Date().getTime();
|
|
||||||
|
|
||||||
remainingSjl = calcTime(sjl - now);
|
|
||||||
remainingMat = calcTime(mat - now);
|
|
||||||
remainingDok = calcTime(dokument - now);
|
|
||||||
remainingMartin = calcTime(martinovOdpocet - now);
|
|
||||||
remainingPeter = calcTime(petrovOdpocet - now);
|
|
||||||
|
|
||||||
const embed = new Discord.MessageEmbed()
|
|
||||||
.addField("Čas do odovzdania dokumentácie: ", remainingDok)
|
|
||||||
.addField("", "")
|
|
||||||
.addField("Čas do maturity zo Slovenského jazyka: ", remainingSjl)
|
|
||||||
.addField("", "")
|
|
||||||
.addField("Čas do maturity z Matematiky ", remainingMat)
|
|
||||||
.addField("", "")
|
|
||||||
.addField("Martinov nenápadný odpočet: ", remainingMartin)
|
|
||||||
.addField("", "")
|
|
||||||
.addField("Odpočet do Peťovho sklamania: ", remainingPeter)
|
|
||||||
.setColor("RANDOM");
|
|
||||||
|
|
||||||
|
|
||||||
if(remainingPeter > 0){
|
|
||||||
embed.spliceFields(8);
|
|
||||||
}
|
|
||||||
if (remainingMartin > 0) {
|
|
||||||
embed.spliceFields(6, 3);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
left += plus;
|
left += plus;
|
||||||
|
|
||||||
if(first == true || plus == 0){
|
if(first == true || plus == 0){
|
||||||
|
@ -152,19 +125,17 @@ function countdowns(plus) {
|
||||||
countdownChannel.send(responses[responseNo]);
|
countdownChannel.send(responses[responseNo]);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
countdownChannel.send(embed);
|
sendEmbed();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
countdownChannel.send(embed);
|
sendEmbed();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (left == ping) {
|
if (left == ping) {
|
||||||
left = 0;
|
left = 0;
|
||||||
countdownChannel.send(embed);
|
sendEmbed();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -209,4 +180,36 @@ function calcTime(time){
|
||||||
return returnNo;
|
return returnNo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function sendEmbed(){
|
||||||
|
now = new Date().getTime();
|
||||||
|
|
||||||
|
remainingSjl = calcTime(sjl - now);
|
||||||
|
remainingMat = calcTime(mat - now);
|
||||||
|
remainingDok = calcTime(dokument - now);
|
||||||
|
remainingMartin = calcTime(martinovOdpocet - now);
|
||||||
|
remainingPeter = calcTime(petrovOdpocet - now);
|
||||||
|
|
||||||
|
const embed = new Discord.MessageEmbed()
|
||||||
|
.addField("Čas do odovzdania dokumentácie: ", remainingDok)
|
||||||
|
.addField("", "")
|
||||||
|
.addField("Čas do maturity zo Slovenského jazyka: ", remainingSjl)
|
||||||
|
.addField("", "")
|
||||||
|
.addField("Čas do maturity z Matematiky ", remainingMat)
|
||||||
|
.addField("", "")
|
||||||
|
.addField("Martinov nenápadný odpočet: ", remainingMartin)
|
||||||
|
.addField("", "")
|
||||||
|
.addField("Odpočet do Peťovho sklamania: ", remainingPeter)
|
||||||
|
.setColor("RANDOM");
|
||||||
|
|
||||||
|
|
||||||
|
if(remainingPeter > 0){
|
||||||
|
embed.spliceFields(8);
|
||||||
|
}
|
||||||
|
if (remainingMartin > 0) {
|
||||||
|
embed.spliceFields(6, 3);
|
||||||
|
}
|
||||||
|
|
||||||
|
countdownChannel.send(embed);
|
||||||
|
}
|
||||||
|
|
||||||
client.login(process.env.token);
|
client.login(process.env.token);
|
Loading…
Reference in a new issue