2022-12-10 23:40:35 +01:00
|
|
|
import sqlite3
|
2023-03-31 14:09:06 +02:00
|
|
|
|
|
|
|
|
conn = sqlite3.connect("../database/data.db")
|
2022-12-10 23:40:35 +01:00
|
|
|
c = conn.cursor()
|
|
|
|
|
import time
|
2023-03-31 14:09:06 +02:00
|
|
|
|
|
|
|
|
# the database is: c.execute('''CREATE TABLE IF NOT EXISTS data (guild_id text, channel_id text, api_key text, is_active boolean, max_tokens integer, temperature real, frequency_penalty real, presence_penalty real, uses_count_today integer, prompt_size integer, prompt_prefix text, tts boolean, pretend_to_be text, pretend_enabled boolean)''')
|
|
|
|
|
# set the uses_count_today to 0 for all guilds every 24 hours
|
2022-12-10 23:40:35 +01:00
|
|
|
while True:
|
2022-12-10 23:53:21 +01:00
|
|
|
c.execute("UPDATE data SET uses_count_today = 0")
|
2022-12-10 23:40:35 +01:00
|
|
|
conn.commit()
|
2023-03-31 14:09:06 +02:00
|
|
|
time.sleep(86400)
|