Move database into data
folder
This commit is contained in:
parent
248c2b0347
commit
cb6d68140c
@ -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))"
|
||||
|
Loading…
x
Reference in New Issue
Block a user