-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdatabase.py
More file actions
42 lines (32 loc) · 1010 Bytes
/
database.py
File metadata and controls
42 lines (32 loc) · 1010 Bytes
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
import sqlite3
class Database ():
"""
class `Database`
Carries methods related to the SQL bot database.
"""
def __init__():
pass
def initialise():
"""
method `Database.initialise`
Method of `Database`.
Initialises the database when called in a file.
"""
# Connection and cursor
CONN = sqlite3.connect('bot.db')
cursor = CONN.cursor()
ECONOMY_TABLE = """CREATE TABLE IF NOT EXISTS Economy (
user_id integer PRIMARY KEY,
user_name text,
wallet integer,
bank_balance integer
); """
MUTED_PEOPLE_TABLE = """CREATE TABLE IF NOT EXISTS Muted (
user_id integer PRIMARY KEY,
user_name text,
duration integer
); """
cursor.execute(ECONOMY_TABLE)
cursor.execute(MUTED_PEOPLE_TABLE)
if __name__ == '__main__':
Database.initialise()