I've been doing this all wrong for a long time
This commit is contained in:
parent
27b62feb5f
commit
b6558ccdd5
7 changed files with 43 additions and 31 deletions
|
@ -6,15 +6,15 @@ from util import hook
|
|||
# If False, all channels without a setting will have regex disabled
|
||||
default_enabled = True
|
||||
|
||||
db_already_initiated = False
|
||||
db_ready = False
|
||||
|
||||
|
||||
def db_init(db):
|
||||
global db_already_initiated
|
||||
if not db_already_initiated:
|
||||
db_already_initiated = True
|
||||
global db_ready
|
||||
if not db_ready:
|
||||
db.execute("CREATE TABLE IF NOT EXISTS regexchans(channel PRIMARY KEY, status)")
|
||||
db.commit()
|
||||
db_ready = True
|
||||
|
||||
|
||||
def get_status(db, channel):
|
||||
|
|
Reference in a new issue