Run python script only once a day per alert received

Hi, I’m trying to build a Python bot that receives an alert from TradingView. This alert could be received by the bot multiple time in a day. I would like to sort of stop the script when it receives the alert for the second/third/fourth/etc… time, and restart it once a new day has begun. I tried with global variables but for some reason, it doesn’t work. Any ideas ?