So I have a discord bot which basically loops every minute checking if a user needs to be unmuted. Currently I'm just storing their ID, the time for them to be unmuted, and if its an active mute.
The problem right now is that every time the loop restarts, it always gets the next query regardless of the current time. So lets say the next mute was logged at 7:15 and currently its 7:10. Peewee just gets the next query regardless of the time condition not being met.
I've checked the database and the time was being logged correctly.
This is my query statement:
timestamp = datetime.now()
CurrentTime = timestamp.strftime(r"%H:%M")
#CurrentTime prints out 7:10
query = database.Infraction.select().where(database.Infraction.MuteTimeRelease == CurrentTime and database.Infraction.ActiveMute == "True").get()
#Peewee brings back a record due at 7:15
What's even weirder is that it was able to access all of its attributes and im not sure why this is happening.