feat: implement Facebook bot automation with UI interaction and image attachment capabilities
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user