-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfirst_run.py
42 lines (40 loc) · 1.46 KB
/
first_run.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
with open("constants.txt", "w+") as f:
f.write(
f"TOKEN:{input('Enter the bot token: ')}\nGENERAL_CHANNEL:{input('Enter the general channel ID: ')}\nSUPPORT_CHANNEL:{input('Enter the support channel ID: ')}\nLOGGING_CHANNEL:{input('Enter the logging channel ID: ')}\nFAQ_CHANNEL:{input('Enter the FAQ channel ID: ')}\nSTAFF_ROLE:{input('Enter the staff role ID: ')}\nSUPPORTER_ROLE:{input('Enter the supporter role ID: ')}\nDEVELOPER_ROLE:{input('Enter the developer role ID: ')}\nREPORT_CHANNEL:{input('Enter the report channel ID: ')}\nRP_LOG_CHANNEL:{input('Enter the RP log channel ID: ')}\n"
)
import sqlite3
import os
if not os.path.exists("Data"):
os.makedirs("Data")
# Check if the file exists, if not create it
if not os.path.isfile("Data/RP.db"):
conn = sqlite3.connect("Data/RP.db")
c = conn.cursor()
c.execute(
"""
CREATE TABLE IF NOT EXISTS RP (
id INTEGER PRIMARY KEY,
RP_given INTEGER DEFAULT 0,
RP_received INTEGER DEFAULT 0
)
"""
)
conn.commit()
c.close()
conn.close()
if not os.path.isfile("Data/warns.db"):
conn = sqlite3.connect("Data/warns.db")
c = conn.cursor()
c.execute(
"""
CREATE TABLE IF NOT EXISTS warnings (
username TEXT,
userid INTEGER,
warn_date TEXT,
reason TEXT
)
"""
)
conn.commit()
c.close()
conn.close()