AI Update: [User uploaded file copykar.zip (28.27 MB) via Web Uploade

This commit is contained in:
mamad
2026-08-29 23:42:50 +03:30
parent f25e166a97
commit 930ef3a939
8 changed files with 80 additions and 22 deletions
+8
View File
@@ -3200,6 +3200,14 @@ class AdminBotService:
_, post_id_str = data.split(":")
post_id = int(post_id_str)
post = await self.repo.get_post_by_id(post_id)
if post and post.media_path and os.path.exists(post.media_path):
try:
os.remove(post.media_path)
logger.info(f"Deleted media file for post {post_id}: {post.media_path}")
except Exception as e:
logger.warning(f"Failed to delete media file {post.media_path}: {e}")
await self.repo.soft_delete_post(post_id)
try:
await event.delete()