Stay hydrated

I noticed people like hydration bot when it comes to some peoples channels so i figured it might be nice to have an option to have that in phantombot, with customizable water oz sizes, and a command to check the water level instead of only waiting for it to show up. Not sure if anyone else has done this before, but i didn’t see anything when searching. Its not the most elegant code but it works. I would like some feedback on what i can improve in the code if anyone wants to take a look at it.
hydrationSystem.js (1.2 KB)

Realized there is an issue where it tells you at the start of the stream to have 0oz, not a major issue, but I fixed that here:
hydrationSystem.js (1.2 KB)
added a check for uptime being > than 1 hour on line 12

1 Like

I have an issue with the bot duplicating the post in twitch after the first hour.

I’ve seen that happen when the twitch servers lag and the bot gets errors in console which delays the bot and prevents the timer the module uses from continuing to move. I suppose I could add a check on the last time it was activated vs current time, but it mainly seems to be an internal timer issue so I’m not sure if it will fix it. I will try though :slight_smile: Also did the issue just start recently?

I only recently started using phantom bot with hydration bot, so to my knowledge yes

srry i think i figured it out added to scripts/systems?

had a slight problem, it posts twice about 5 seconds apart. not sure why.

1 Like

same problem on my chat. No Warning/Error in logs.

I think the issue happens when the bot lags and isnt able to reset the timer properly. it checks your uptime every minute or so to check if its a current hour interval like 1hr 0min or 2hr 0min. So if your bot lags then the minute timer reset might not be triggering so it still thinks it needs to tell you because the uptime is still a 0min mark. So i dont think there is anything i can do to actually fix it :frowning: since it seems to only happen when the bot has issues elsewhere.

1 Like

Ya it only did it a couple times just after installing. It seems to fix its self after after a few uses.