From cb6d68140c6829af75c375140318bc067d6b3cc7 Mon Sep 17 00:00:00 2001 From: Parker Date: Wed, 26 Jun 2024 18:14:07 -0500 Subject: [PATCH] Move database into `data` folder --- code/cogs/owner/stats.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/code/cogs/owner/stats.py b/code/cogs/owner/stats.py index ce2af69..c1fac7e 100644 --- a/code/cogs/owner/stats.py +++ b/code/cogs/owner/stats.py @@ -1,6 +1,7 @@ from discord.ext import commands, tasks import sqlite3 import discord +import os from config import BOT_COLOR @@ -10,7 +11,10 @@ class Stats(commands.Cog): self.bot = bot def cog_load(self): - connection = sqlite3.connect("count.db") + if not os.path.exists("data"): + os.makedirs("data") + + connection = sqlite3.connect("data/count.db") cursor = connection.cursor() cursor.execute( "CREATE TABLE IF NOT EXISTS count (command_name, count, PRIMARY KEY (command_name))"