started on new help command

This commit is contained in:
2025-03-05 22:21:21 +01:00
parent a23cd73b48
commit d0a61f7b16
7 changed files with 116 additions and 72 deletions
+6
View File
@@ -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"]
+1 -1
View File
@@ -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