I am trying to make a bot clear an interval if my config file says "off" but leave it running if it says "on".
I've already tried doing
discord.js
config.Interval = setInterval(() => {
WallCheck.send(WallCheckembed);
}, 500);
clearInterval(off)
};
but when I put in the "config.Interval" its setting the setInterval to "config.Interval".
discord.js
config.Interval = setInterval(() => {
WallCheck.send(WallCheckembed);
}, 500);
This is my code. And my config file is:
"Interval": "off"
The only error I'm getting is this:
(node:6844) UnhandledPromiseRejectionWarning: ReferenceError: off is not defined
And the variable "off" is referring to the "off" in my clear interval.