feat: implement Facebook bot automation with UI interaction and image attachment capabilities

This commit is contained in:
Victor Phan
2026-07-23 15:02:09 +07:00
parent fea2789bd4
commit 0b722006d2
2 changed files with 24 additions and 9 deletions
+2 -1
View File
@@ -39,6 +39,7 @@ class FacebookCommentRequest(BaseModel):
content: str
image_url: Optional[str] = None
image_base64: Optional[str] = None
post_index: int = Field(default=1, description="Số thứ tự bài viết (1 là bài đầu tiên)")
@app.post("/get_commission")
def get_commission_endpoint(req: CommissionRequest):
@@ -114,7 +115,7 @@ def post_facebook_comment(req: FacebookCommentRequest):
urllib.request.urlretrieve(url, local_image_path)
logging.info(f"Đã tải ảnh tạm thời từ internet: {local_image_path}")
result = bot.post_comment(str(req.group_id), str(req.content), local_image_path)
result = bot.post_comment(str(req.group_id), str(req.content), local_image_path, req.post_index)
# Dọn dẹp ảnh tạm sau khi xong
if local_image_path and os.path.exists(local_image_path):