made bot add new posts to channel

This commit is contained in:
2025-02-15 17:32:39 +01:00
parent 9639ce9654
commit 9b5f1bc9d5
5 changed files with 147 additions and 50 deletions
+2 -1
View File
@@ -6,7 +6,7 @@ import bot as botPy
from macros import *
async def add_new_posts(bot: botPy.Bot):
async def add_new_posts(bot: botPy.Bot) -> bool:
check_emoji = emoji.emojize(":check_mark_button:")
cross_emoji = emoji.emojize(":cross_mark:")
@@ -49,6 +49,7 @@ async def add_new_posts(bot: botPy.Bot):
f"and {not_added} weren't added because they are removed or already existed")
data.write_data(bot)
return True
async def fetch_posts_with_flair(bot: botPy.Bot, flair_name: str) -> list[models.Submission]:
+1
View File
@@ -64,6 +64,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_new_posts": result = result_json(await posts.add_new_posts(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"]))