hotfixes & QOL
This commit is contained in:
+6
-3
@@ -37,12 +37,13 @@ class Bot:
|
||||
password = self.password,
|
||||
user_agent = self.useragent
|
||||
)
|
||||
self.sr_list: list[str] = ["bytedicetesting"]
|
||||
self.sr = None
|
||||
self.data_f: TextIOWrapper = None
|
||||
self.data: dict = {}
|
||||
|
||||
async def initialize(self):
|
||||
self.sr = await self.r.subreddit("bytedicetesting")
|
||||
self.sr = await self.r.subreddit("+".join(self.sr_list))
|
||||
|
||||
async def set_args(self, args: dict):
|
||||
self.args = args
|
||||
@@ -57,11 +58,13 @@ class Bot:
|
||||
|
||||
async def update_cfg_str(self, new_cfg: str) -> bool:
|
||||
json_cfg = toml.loads(new_cfg)
|
||||
self.sr = await self.r.subreddit(json_cfg[CFG_DATA_RE]["subreddits"])
|
||||
self.sr_list = json_cfg[CFG_DATA_RE]["subreddits"].split("+")
|
||||
self.sr = await self.r.subreddit("+".join(self.sr_list))
|
||||
self.fetch_limit = json_cfg[CFG_DATA_RE]["fetch_limit"]
|
||||
return True
|
||||
|
||||
async def update_cfg(self, new_cfg: dict) -> bool:
|
||||
self.sr = await self.r.subreddit(new_cfg[CFG_DATA_RE]["subreddits"])
|
||||
self.sr_list = new_cfg[CFG_DATA_RE]["subreddits"].split("+")
|
||||
self.sr = await self.r.subreddit("+".join(self.sr_list))
|
||||
self.fetch_limit = new_cfg[CFG_DATA_RE]["fetch_limit"]
|
||||
return True
|
||||
Reference in New Issue
Block a user