started on new help command
This commit is contained in:
@@ -55,6 +55,12 @@ class Bot:
|
||||
|
||||
return False
|
||||
|
||||
async def update_cfg_str(self, new_cfg: str) -> bool:
|
||||
json_cfg = json.loads(new_cfg)
|
||||
self.sr = await self.r.subreddit(json_cfg[BK_WEEK]["subreddits"])
|
||||
self.fetch_limit = json_cfg[BK_WEEK]["fetch_limit"]
|
||||
return True
|
||||
|
||||
async def update_cfg(self, new_cfg: dict) -> bool:
|
||||
self.sr = await self.r.subreddit(new_cfg[BK_WEEK]["subreddits"])
|
||||
self.fetch_limit = new_cfg[BK_WEEK]["fetch_limit"]
|
||||
|
||||
@@ -82,7 +82,7 @@ async def json_to_func(v: dict, bot: botPy.Bot) -> dict:
|
||||
case "set_approve_post": r = data .set_approve_post (bot, *v["args"])
|
||||
case "set_vote_post": r = data .set_vote_post (bot, *v["args"])
|
||||
case "remove_old_posts": r = data .remove_old_posts (bot, *v["args"])
|
||||
case "update_cfg": r = await bot .update_cfg (*v["args"])
|
||||
case "update_cfg": r = await bot .update_cfg_str (*v["args"])
|
||||
case "stop_praw": r = await bot .stop ()
|
||||
case _: value_supported = False
|
||||
|
||||
|
||||
Reference in New Issue
Block a user