added /bk_week_remove command
This commit is contained in:
+9
-1
@@ -124,4 +124,12 @@ def set_approve_post(bot: botPy.Bot, approved: bool, url: str) -> bool:
|
||||
bot.data[BK_WEEKLY][url]["approved"]["by_human"] = approved
|
||||
return True
|
||||
|
||||
return False
|
||||
return False
|
||||
|
||||
|
||||
def remove_post(bot: botPy.Bot, url: str, removed_by: str = "UNKNOWN") -> bool:
|
||||
if url in bot.data[BK_WEEKLY]:
|
||||
bot.data[BK_WEEKLY][url] = { "removed": True, "removed_by": removed_by }
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
@@ -65,6 +65,7 @@ async def json_to_func(v: dict, bot: botPy.Bot) -> dict:
|
||||
match v["value"]:
|
||||
case "update_data_file": result = result_json(data.write_data(bot))
|
||||
case "add_post_url": result = result_json(await posts.add_post_url(bot, *v["args"]))
|
||||
case "remove_post_url": result = result_json(data.remove_post(bot, *v["args"]))
|
||||
case "set_approve_post": result = result_json(data.set_approve_post(bot, *v["args"]))
|
||||
case "stop_praw": result = result_json(await bot.stop())
|
||||
case _: value_supported = False
|
||||
|
||||
Reference in New Issue
Block a user