From 5eb7c3395292974a8e6894809cf7c35fa7fe2d89 Mon Sep 17 00:00:00 2001 From: Ben Brady Date: Thu, 21 Oct 2021 16:24:57 +0100 Subject: [PATCH] Moved default settings to Guild.py instead of settings.json --- src/Data/Settings.json | 8 -------- src/Modules/Guilds.py | 14 ++++++-------- 2 files changed, 6 insertions(+), 16 deletions(-) delete mode 100644 src/Data/Settings.json diff --git a/src/Data/Settings.json b/src/Data/Settings.json deleted file mode 100644 index 4345151..0000000 --- a/src/Data/Settings.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "rEnabled": true, - "rDelete": true, - "rTimeout": 604800, - "rThreshold": 10, - "rChannels": [864282912631291905], - "rDetected_msg": ["> {AUTHOR},You seem to have posted a repost"] -} \ No newline at end of file diff --git a/src/Modules/Guilds.py b/src/Modules/Guilds.py index de22534..09cad69 100644 --- a/src/Modules/Guilds.py +++ b/src/Modules/Guilds.py @@ -15,12 +15,12 @@ Guilds = {} class Guild: - rEnabled:bool; "Repost Filtering Enabled?" - rDelete:bool; "Reposts Should Be Deleted?" - rTimeout:int; "Time in seconds for a post to be too old" - rThreshold:int; "Repost Threshold" - rChannels:List[int]; "The list of channels for reposts to be captured" - rDetected_msg:List[str]; "The list of recently deleted messages" + rEnabled:bool = True + rDelete:bool = True + rTimeout:int = 604800 + rThreshold:int = 10 + rChannels:List[int] = [864282912631291905] + rDetected_msg:List[str] = ["> {AUTHOR},You seem to have posted a repost"] def __init__(self, ID): Log.debug(f"Guild {ID} retrieved") @@ -33,8 +33,6 @@ def __init__(self, ID): if Settings: self.LoadJSON(Settings[0]) else: - with open(SETTINGS_STORE) as fObj: - self.LoadJSON(fObj.read()) with conn: conn.execute( "Insert into GUILDS values(?,?);",