feat: implement FacebookBot class for automated group commenting using uiautomator2

This commit is contained in:
Victor Phan
2026-07-23 14:23:57 +07:00
parent da1a079f3a
commit 26c72fedb8
+6 -5
View File
@@ -53,11 +53,12 @@ class FacebookBot:
comment_btn = None
for _ in range(7): # Thử vuốt tối đa 7 lần
# Thử quét bằng Regex (Không phân biệt hoa thường) ở c description và text
c_desc_vn = self.d(descriptionMatches="(?i).*bình luận.*")
c_text_vn = self.d(textMatches="(?i).*bình luận.*")
c_desc_en = self.d(descriptionMatches="(?i).*comment.*")
c_text_en = self.d(textMatches="(?i).*comment.*")
# Sửa lỗi: Nút Thích có description là "bày tỏ cảm xúc về bình luận" nên Regex .*bình luận.* sẽ bắt nhầm nút Thích!
# Do đó ta chỉ tìm đúng chữ Bình luận đứng đầu, hoặc chữ Comment.
c_desc_vn = self.d(descriptionMatches="(?i)^bình luận$")
c_text_vn = self.d(textMatches="(?i)^bình luận$")
c_desc_en = self.d(descriptionMatches="(?i)^comment$")
c_text_en = self.d(textMatches="(?i)^comment$")
if c_desc_vn.exists: comment_btn = c_desc_vn; break
if c_text_vn.exists: comment_btn = c_text_vn; break