#help
12 messages · Page 1 of 1 (latest)
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!
✅Marked as resolved by OP
the error is quite straight forward, it wants a fuction, not a promise
client.on("messageCreate", async (message) => {
if (message.embeds.length && message.author.id == '302050872383242240' && message.embeds[0].data.description.indexOf("Server ID") > -1) {
if (message.channel.id !== "1150080982809059419") return;
const channel = message.channel;
const count = await db.get("bumpCount.count");
const time = Date.now() + 7200000;
message.react("🔔");
channel.permissionOverwrites.edit(message.guild.id, { SendMessages: false });
channel.setName("『🔴』bumpable-in-" + convertHM(7200000).replace("0h-", "").replace("0m", ""));
channel.send({ content: `# Thx for bumping <@${message.interaction.user.id}> , We’re now on \`${count + 1}\`, bumps!\n\n__**🔐 Channel will be unlocked after 2 hours**__` });
await db.set("bumpUser", { user: message.interaction.user.id });
await db.set("bumpCount", { count: count + 1 });
await db.set("bumpTime", { time: time });
const interval = setInterval(checkTime(), 600000);
async function checkTime() {
const time2 = await db.get("bumpTime.time");
if (isNegative(time - Date.now()) === false) {
const channel2 = client.channels.cache.get("1150080982809059419");
channel2.setName("『🔴』bumpable-in-" + convertHM(time2 - Date.now()).replace("0h-", "").replace("-0m", ""))()
} else if (isNegative(time2 - Date.now()) === true) {
const channel2 = client.channels.cache.get("1150080982809059419");
if (channel2.name === "『👊』bump-now") return;
channel2.setName("『👊』bump-now");
const embed = new EmbedBuilder()
.setTitle("Bump timer's out!")
.setDescription("It's time to bump again!")
.setColor("F5A278")
.setFooter({ text: 'Use /bump to bump! | Oji0721#3915' })
.setTimestamp();
channel2.send({ content: `<@${userId}>`, embeds: [embed] });
channel2.permissionOverwrites.edit(message.guild.id, { SendMessages: false });
clearInterval(interval);
}
}
}
});```
my code
wdym
checkTime, not checkTime()
setInterval wants a function to execute, not a return value of an executed function
setInterval(checkTime, ...)
yes
tysm
the clearInterval is right or no