aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorParker <contact@pkrm.dev>2024-06-26 18:14:07 -0500
committerParker <contact@pkrm.dev>2024-06-26 18:14:07 -0500
commitcb6d68140c6829af75c375140318bc067d6b3cc7 (patch)
tree1a12ecef4bb9e1fbfa9314a259252cfa233d4a9d
parent248c2b034780147e22b9ea4bef9c60a6acb75b95 (diff)
Move database into `data` folder
-rw-r--r--code/cogs/owner/stats.py6
1 files changed, 5 insertions, 1 deletions
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))"