templates/discord-bot: init
This commit is contained in:
parent
7de0f37a07
commit
b29f007e69
8 changed files with 313 additions and 0 deletions
25
templates/discord-bot/rename/db.py
Normal file
25
templates/discord-bot/rename/db.py
Normal file
|
@ -0,0 +1,25 @@
|
|||
import aiosqlite
|
||||
|
||||
|
||||
async def setup_db(db_file):
|
||||
db = await aiosqlite.connect(db_file)
|
||||
|
||||
await db.executescript("""
|
||||
BEGIN;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS guilds (
|
||||
guild_id INTEGER NOT NULL PRIMARY KEY,
|
||||
prefix TEXT NOT NULL DEFAULT ">"
|
||||
)
|
||||
WITHOUT ROWID;
|
||||
|
||||
# DB Setup here
|
||||
|
||||
COMMIT;
|
||||
|
||||
PRAGMA optimize(0x10002);
|
||||
PRAGMA main.synchronous = NORMAL;
|
||||
""")
|
||||
|
||||
return db
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue