let talkedRecently = 0;
let talkedRecentlyDAYS = 0;
let talkedRecentlyHOURS = 0;
let talkedRecentlyMINUTES = 0;
let talkedRecentlySECUNDES = 0;
if(message.content.startsWith(prefix + "day")) {
if (talkedRecently > 0) {
message.channel.send(`Вы уже использовали эту команду. Повторите через ${Math.floor(talkedRecentlyDAYS)} дней / ${Math.floor(talkedRecentlyHOURS)} часов / ${Math.floor(talkedRecentlyMINUTES)} минут / ${talkedRecentlySECUNDES} секунд.`)
} else {
message.channel.send("Успешно!")
talkedRecently = 86400000;
talkedRecentlyDAYS = talkedRecently/86400000;
let time = setInterval(() => {
if (talkedRecently <= 0) { clearInterval(time); return; }
talkedRecentlySECUNDES -= 1;
if (talkedRecentlySECUNDES < 0) { talkedRecentlySECUNDES = 59; talkedRecentlyMINUTES -= 1; }
if (talkedRecentlyMINUTES < 0) { talkedRecentlyMINUTES = 59; talkedRecentlyHOURS -= 1; }
if (talkedRecentlyHOURS < 0) { talkedRecentlyHOURS = 23; talkedRecentlyDAYS -= 1; }
talkedRecently -= 1000;
}, 1000);
}
}
async function timemembercount() {
let members = bot.guilds.cache.get("GuildID").memberCount
bot.channels.cache.get("ChannelID").setName(`Котиков: ${members}`);
}
var interval = setInterval(function () { timemembercount(); }, 20000 );