fbchat-v2 2.3.4__tar.gz → 2.3.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/.gitignore +13 -0
  2. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/CHANGELOG.md +22 -0
  3. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/PKG-INFO +17 -12
  4. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/README.md +15 -10
  5. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/README_EN.md +15 -10
  6. fbchat_v2-2.3.5/hatch_build.py +40 -0
  7. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/pyproject.toml +10 -2
  8. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/src/fbchat_v2/__init__.py +1 -1
  9. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/src/fbchat_v2/_core/README.md +1 -1
  10. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/src/fbchat_v2/_core/README_EN.md +1 -1
  11. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/src/fbchat_v2/_core/__init__.py +1 -1
  12. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/src/fbchat_v2/_core/_facebookLogin.py +13 -3
  13. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/src/fbchat_v2/_features/README.md +2 -2
  14. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/src/fbchat_v2/_features/README_EN.md +2 -2
  15. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/src/fbchat_v2/_features/_facebook/README.md +1 -1
  16. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/src/fbchat_v2/_features/_facebook/README_EN.md +1 -1
  17. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/src/fbchat_v2/_messaging/README.md +3 -3
  18. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/src/fbchat_v2/_messaging/README_EN.md +3 -3
  19. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/src/fbchat_v2/_messaging/_attachments.py +9 -8
  20. fbchat_v2-2.3.5/src/fbchat_v2/_messaging/_bridge_checksums.py +11 -0
  21. fbchat_v2-2.3.4/src/fbchat_v2/_messaging/_bridge_checksums.py +0 -11
  22. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/LICENSE +0 -0
  23. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/src/fbchat_v2/_core/_console.py +0 -0
  24. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/src/fbchat_v2/_core/_http.py +0 -0
  25. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/src/fbchat_v2/_core/_permissions.py +0 -0
  26. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/src/fbchat_v2/_core/_session.py +0 -0
  27. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/src/fbchat_v2/_core/_storage.py +0 -0
  28. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/src/fbchat_v2/_core/_types.py +0 -0
  29. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/src/fbchat_v2/_core/_utils.py +0 -0
  30. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/src/fbchat_v2/_features/__init__.py +0 -0
  31. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/src/fbchat_v2/_features/_facebook/__init__.py +0 -0
  32. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/src/fbchat_v2/_features/_facebook/_archivePost.py +0 -0
  33. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/src/fbchat_v2/_features/_facebook/_blocking.py +0 -0
  34. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/src/fbchat_v2/_features/_facebook/_changeBio.py +0 -0
  35. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/src/fbchat_v2/_features/_facebook/_createPost.py +0 -0
  36. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/src/fbchat_v2/_features/_facebook/_deletePost.py +0 -0
  37. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/src/fbchat_v2/_features/_facebook/_get_user_info.py +0 -0
  38. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/src/fbchat_v2/_features/_facebook/_marketplace.py +0 -0
  39. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/src/fbchat_v2/_features/_facebook/_notification.py +0 -0
  40. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/src/fbchat_v2/_features/_facebook/_professional.py +0 -0
  41. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/src/fbchat_v2/_features/_facebook/_reactionPost.py +0 -0
  42. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/src/fbchat_v2/_features/_facebook/_registerOnProfile.py +0 -0
  43. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/src/fbchat_v2/_features/_facebook/_search.py +0 -0
  44. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/src/fbchat_v2/_features/_facebook/_unFriend.py +0 -0
  45. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/src/fbchat_v2/_features/_thread/__init__.py +0 -0
  46. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/src/fbchat_v2/_features/_thread/_addAdmin.py +0 -0
  47. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/src/fbchat_v2/_features/_thread/_all_thread_data.py +0 -0
  48. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/src/fbchat_v2/_features/_thread/_changeEmoji.py +0 -0
  49. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/src/fbchat_v2/_features/_thread/_changeNameThread.py +0 -0
  50. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/src/fbchat_v2/_features/_thread/_changeNickname.py +0 -0
  51. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/src/fbchat_v2/_messaging/__init__.py +0 -0
  52. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/src/fbchat_v2/_messaging/_bridge_actions.py +0 -0
  53. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/src/fbchat_v2/_messaging/_changeTheme.py +0 -0
  54. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/src/fbchat_v2/_messaging/_createNotes.py +0 -0
  55. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/src/fbchat_v2/_messaging/_editMessage.py +0 -0
  56. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/src/fbchat_v2/_messaging/_listening.py +0 -0
  57. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/src/fbchat_v2/_messaging/_listening_e2ee.py +0 -0
  58. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/src/fbchat_v2/_messaging/_message_requests.py +0 -0
  59. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/src/fbchat_v2/_messaging/_reactions.py +0 -0
  60. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/src/fbchat_v2/_messaging/_reconnect.py +0 -0
  61. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/src/fbchat_v2/_messaging/_send.py +0 -0
  62. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/src/fbchat_v2/_messaging/_send_e2ee.py +0 -0
  63. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/src/fbchat_v2/_messaging/_unsend.py +0 -0
  64. {fbchat_v2-2.3.4 → fbchat_v2-2.3.5}/src/fbchat_v2/py.typed +0 -0
@@ -38,6 +38,18 @@ venv.bak/
38
38
  .settings/
39
39
  .docs/
40
40
 
41
+ .vs/
42
+ .pytest_cache/
43
+ .mypy_cache/
44
+ .ruff_cache/
45
+ .hypothesis/
46
+ .tox/
47
+ .nox/
48
+ .venv*/
49
+ .coverage
50
+ .coverage.*
51
+ htmlcov/
52
+ coverage.xml
41
53
  *.log
42
54
  logs/
43
55
  .tmp/
@@ -51,3 +63,4 @@ AGENT_MEMORYs.md
51
63
  vbsec-reports/
52
64
  src/test.py
53
65
  .understand-anything
66
+ AGENTS_MEMORYs.md
@@ -43,6 +43,28 @@ phiên bản tuân theo [Semantic Versioning](https://semver.org/lang/vi/).
43
43
  khoảng trắng thừa đầu hero, CSS variable thiếu, V2 badge bị ẩn và layout
44
44
  contributor/preloader trên màn hình nhỏ.
45
45
 
46
+ ## [2.3.5] - 2026-11-18
47
+
48
+ ### Added
49
+
50
+ - Thêm ba ví dụ tăng dần độ khó trong `examples/`: echo, quản lý nhóm với
51
+ poll bằng tin nhắn và E2EE có Go bridge.
52
+
53
+ ### Changed
54
+
55
+ - Chia DOCS.md thành năm trang theo tác vụ trong `docs/`, cập nhật link Việt/Anh.
56
+ - Refactor bot mẫu `src/main.py` và suy luận loại attachment bằng mapping,
57
+ giữ nguyên thứ tự ưu tiên và fallback MIME.
58
+ - Sinh namespace package vào `build/fbchat_v2` khi cài/build, bỏ source trùng
59
+ khỏi main; public imports và layout wheel không đổi.
60
+ - Nâng Go lên 1.26.11, brotli 1.2.7, compress 1.20.2 và x/net 0.62.0 để vá
61
+ các lỗ hổng dependency được CI phát hiện.
62
+
63
+ ### Fixed
64
+
65
+ - Sửa fixture TOTP quá ngắn bị PyOTP 2.12 từ chối; giữ fallback 2FA hiện có.
66
+ - Bỏ cache IDE khỏi Git và bổ sung rule ignore cho cache công cụ phát triển.
67
+
46
68
  ## [2.3.4] - 2026-10-21
47
69
 
48
70
  ### Added
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: fbchat-v2
3
- Version: 2.3.4
3
+ Version: 2.3.5
4
4
  Summary: Async-first, account-based Python library for the unofficial Facebook Messenger API with E2EE support.
5
5
  Project-URL: Homepage, https://github.com/m008v/fbchat-v2
6
- Project-URL: Documentation, https://github.com/m008v/fbchat-v2/blob/main/DOCS.md
6
+ Project-URL: Documentation, https://github.com/m008v/fbchat-v2/blob/main/docs/getting-started/quickstart.md
7
7
  Project-URL: Repository, https://github.com/m008v/fbchat-v2
8
8
  Project-URL: Issues, https://github.com/m008v/fbchat-v2/issues
9
9
  Project-URL: Changelog, https://github.com/m008v/fbchat-v2/blob/main/CHANGELOG.md
@@ -252,19 +252,19 @@ Description-Content-Type: text/markdown
252
252
  [![Status](https://img.shields.io/badge/status-active-22c55e)](https://github.com/m008v/fbchat-v2)
253
253
  [![PyPI](https://img.shields.io/pypi/v/fbchat-v2?color=3775A9&logo=pypi&logoColor=white)](https://pypi.org/project/fbchat-v2/)
254
254
  [![Python](https://img.shields.io/badge/Python-3.10%2B-3776AB?logo=python&logoColor=white)](https://www.python.org/)
255
- [![Version](https://img.shields.io/badge/version-2.3.4-blue)](https://github.com/m008v/fbchat-v2/releases)
255
+ [![Version](https://img.shields.io/badge/version-2.3.5-blue)](https://github.com/m008v/fbchat-v2/releases)
256
256
  [![Issues](https://img.shields.io/github/issues/m008v/fbchat-v2?color=orange)](https://github.com/m008v/fbchat-v2/issues)
257
257
  [![License](https://img.shields.io/badge/license-Xem%20LICENSE-lightgrey)](LICENSE)
258
258
  [![Telegram](https://img.shields.io/badge/Telegram-MinhHuyDev-26A5E4?logo=telegram&logoColor=white)](https://t.me/MinhHuyDev)
259
259
 
260
- [🇬🇧 English](README_EN.md) · [📖 Tài liệu](DOCS.md) · [📦 PyPI](https://pypi.org/project/fbchat-v2/) · [ 📊 Sơ đồ luồng](FLOWCHART.md) · [🐛 Báo lỗi](https://github.com/m008v/fbchat-v2/issues)
260
+ [🇬🇧 English](README_EN.md) · [📖 Tài liệu](https://github.com/m008v/fbchat-v2/blob/main/docs/getting-started/quickstart.md) · [📦 PyPI](https://pypi.org/project/fbchat-v2/) · [ 📊 Sơ đồ luồng](FLOWCHART.md) · [🐛 Báo lỗi](https://github.com/m008v/fbchat-v2/issues)
261
261
 
262
262
  </div>
263
263
 
264
264
  ---
265
265
 
266
266
  > [!IMPORTANT]
267
- > Bản 2.3.4 dùng `async/await`. Nếu đang dùng bản cũ, bạn cần sửa cách gọi hàm theo ví dụ bên dưới. Muốn giữ code đồng bộ thì dùng bản [v2.1.4](https://github.com/m008v/fbchat-v2/tree/v2.1.4).
267
+ > Bản 2.3.5 dùng `async/await`. Nếu đang dùng bản cũ, bạn cần sửa cách gọi hàm theo ví dụ bên dưới. Muốn giữ code đồng bộ thì dùng bản [v2.1.4](https://github.com/m008v/fbchat-v2/tree/v2.1.4).
268
268
 
269
269
  > [!WARNING]
270
270
  > Đây không phải sản phẩm chính thức của Facebook. Nếu cần API chatbot chính thức, xem [Messenger Platform](https://developers.facebook.com/docs/messenger-platform/). `fbchat-v2` dùng tài khoản và cookie Facebook cá nhân, nên có rủi ro với bảo mật phiên và tài khoản. Cân nhắc trước khi sử dụng.
@@ -277,8 +277,8 @@ Mình là MinhHuyDev (`m008v`), tác giả và người duy trì dự án.
277
277
  `fbchat-v2` là thư viện Python để gửi và nhận tin nhắn Messenger bằng tài khoản Facebook cá nhân. Thư viện dùng `async/await`; E2EE chạy qua bridge Go. Codebase đã được tổ chức lại từ v2.2.0 và tiếp tục được sửa theo các lỗi người dùng báo về.
278
278
 
279
279
  Từ 2.3.4, MQTT/E2EE tự nối lại khi mất mạng, phân biệt lỗi cookie và có callback
280
- trạng thái. Xem [cách cấu hình](DOCS.md#tự-nối-lại).
281
- E2EE cần bridge 2.3.4; wrapper không dùng binary cũ thiếu contract reconnect.
280
+ trạng thái. Xem [cách cấu hình](https://github.com/m008v/fbchat-v2/blob/main/docs/messaging/e2ee.md#tự-nối-lại).
281
+ E2EE cần bridge 2.3.5; wrapper không dùng binary cũ thiếu contract reconnect.
282
282
 
283
283
  Cảm ơn mọi người đã góp ý và báo lỗi. Đây là API không chính thức nên một số chức năng có thể hỏng khi Facebook thay đổi. Nếu gặp lỗi, mở issue trên [GitHub](https://github.com/m008v/fbchat-v2/issues) kèm cách tái hiện và log đã che thông tin nhạy cảm, hoặc nhắn mình qua [Telegram](https://t.me/MinhHuyDev).
284
284
 
@@ -412,7 +412,7 @@ fbchat-v2/
412
412
  │ └── README.md
413
413
  ├── build/ # Binary bridge local
414
414
  ├── tests/ # Unit và async contract tests
415
- ├── DOCS.md # Hướng dẫn API đầy đủ
415
+ ├── docs/ # Hướng dẫn API đầy đủ
416
416
  ├── FLOWCHART.md # Runtime flow
417
417
  ├── mindmap-mermaid.md # Bản đồ codebase
418
418
  ├── CHANGELOG.md
@@ -549,9 +549,9 @@ Lần build đầu mất vài phút (~300 MB cache Go module). Sau đó binary k
549
549
  ```bash
550
550
  cd ..
551
551
  # Windows
552
- python scripts/smoke_bridge_rpc.py .\build\fbchat-bridge-e2ee.exe --expected-version 2.3.4
552
+ python scripts/smoke_bridge_rpc.py .\build\fbchat-bridge-e2ee.exe --expected-version 2.3.5
553
553
  # Linux/macOS
554
- python scripts/smoke_bridge_rpc.py ./build/fbchat-bridge-e2ee --expected-version 2.3.4
554
+ python scripts/smoke_bridge_rpc.py ./build/fbchat-bridge-e2ee --expected-version 2.3.5
555
555
  ```
556
556
 
557
557
  Nếu binary không nằm ở vị trí mặc định, đặt biến môi trường:
@@ -829,7 +829,12 @@ Queue của bot chứa tối đa 1000 event và bỏ event cũ nhất khi đầy
829
829
 
830
830
  | Tài liệu | Nội dung |
831
831
  |---|---|
832
- | [DOCS.md](DOCS.md) | Hướng dẫn API và workflow đầy đủ |
832
+ | [Bắt đầu](https://github.com/m008v/fbchat-v2/blob/main/docs/getting-started/quickstart.md) | Cài đặt, tạo session và chạy bot mẫu |
833
+ | [Ví dụ tăng dần độ khó](https://github.com/m008v/fbchat-v2/blob/main/examples/README.md) | Echo cơ bản, quản lý nhóm và E2EE |
834
+ | [Tin nhắn thường](https://github.com/m008v/fbchat-v2/blob/main/docs/messaging/standard.md) | Gửi/nhận, attachment, reaction và Notes |
835
+ | [E2EE](https://github.com/m008v/fbchat-v2/blob/main/docs/messaging/e2ee.md) | Bridge, readiness, reconnect và kiểm thử |
836
+ | [Thao tác Facebook](https://github.com/m008v/fbchat-v2/blob/main/docs/features/facebook-actions.md) | Bài viết, user và quản lý nhóm |
837
+ | [Tra nhanh](https://github.com/m008v/fbchat-v2/blob/main/docs/recipes/cheatsheet.md) | Timeout, migration và cách xử lý lỗi |
833
838
  | [Core](src/fbchat_v2/_core/README.md) | Session, HTTP, storage và login |
834
839
  | [Features](src/fbchat_v2/_features/README.md) | Facebook feature và thread |
835
840
  | [Messaging](src/fbchat_v2/_messaging/README.md) | Send, listener, attachment và E2EE |
@@ -855,7 +860,7 @@ ruff check src tests scripts
855
860
  black --check src tests scripts
856
861
  mypy
857
862
  python -m build --wheel
858
- python scripts/verify_distribution.py dist/fbchat_v2-2.3.4-py3-none-any.whl
863
+ python scripts/verify_distribution.py dist/fbchat_v2-2.3.5-py3-none-any.whl
859
864
  git diff --check
860
865
  ```
861
866
 
@@ -7,19 +7,19 @@
7
7
  [![Status](https://img.shields.io/badge/status-active-22c55e)](https://github.com/m008v/fbchat-v2)
8
8
  [![PyPI](https://img.shields.io/pypi/v/fbchat-v2?color=3775A9&logo=pypi&logoColor=white)](https://pypi.org/project/fbchat-v2/)
9
9
  [![Python](https://img.shields.io/badge/Python-3.10%2B-3776AB?logo=python&logoColor=white)](https://www.python.org/)
10
- [![Version](https://img.shields.io/badge/version-2.3.4-blue)](https://github.com/m008v/fbchat-v2/releases)
10
+ [![Version](https://img.shields.io/badge/version-2.3.5-blue)](https://github.com/m008v/fbchat-v2/releases)
11
11
  [![Issues](https://img.shields.io/github/issues/m008v/fbchat-v2?color=orange)](https://github.com/m008v/fbchat-v2/issues)
12
12
  [![License](https://img.shields.io/badge/license-Xem%20LICENSE-lightgrey)](LICENSE)
13
13
  [![Telegram](https://img.shields.io/badge/Telegram-MinhHuyDev-26A5E4?logo=telegram&logoColor=white)](https://t.me/MinhHuyDev)
14
14
 
15
- [🇬🇧 English](README_EN.md) · [📖 Tài liệu](DOCS.md) · [📦 PyPI](https://pypi.org/project/fbchat-v2/) · [ 📊 Sơ đồ luồng](FLOWCHART.md) · [🐛 Báo lỗi](https://github.com/m008v/fbchat-v2/issues)
15
+ [🇬🇧 English](README_EN.md) · [📖 Tài liệu](https://github.com/m008v/fbchat-v2/blob/main/docs/getting-started/quickstart.md) · [📦 PyPI](https://pypi.org/project/fbchat-v2/) · [ 📊 Sơ đồ luồng](FLOWCHART.md) · [🐛 Báo lỗi](https://github.com/m008v/fbchat-v2/issues)
16
16
 
17
17
  </div>
18
18
 
19
19
  ---
20
20
 
21
21
  > [!IMPORTANT]
22
- > Bản 2.3.4 dùng `async/await`. Nếu đang dùng bản cũ, bạn cần sửa cách gọi hàm theo ví dụ bên dưới. Muốn giữ code đồng bộ thì dùng bản [v2.1.4](https://github.com/m008v/fbchat-v2/tree/v2.1.4).
22
+ > Bản 2.3.5 dùng `async/await`. Nếu đang dùng bản cũ, bạn cần sửa cách gọi hàm theo ví dụ bên dưới. Muốn giữ code đồng bộ thì dùng bản [v2.1.4](https://github.com/m008v/fbchat-v2/tree/v2.1.4).
23
23
 
24
24
  > [!WARNING]
25
25
  > Đây không phải sản phẩm chính thức của Facebook. Nếu cần API chatbot chính thức, xem [Messenger Platform](https://developers.facebook.com/docs/messenger-platform/). `fbchat-v2` dùng tài khoản và cookie Facebook cá nhân, nên có rủi ro với bảo mật phiên và tài khoản. Cân nhắc trước khi sử dụng.
@@ -32,8 +32,8 @@ Mình là MinhHuyDev (`m008v`), tác giả và người duy trì dự án.
32
32
  `fbchat-v2` là thư viện Python để gửi và nhận tin nhắn Messenger bằng tài khoản Facebook cá nhân. Thư viện dùng `async/await`; E2EE chạy qua bridge Go. Codebase đã được tổ chức lại từ v2.2.0 và tiếp tục được sửa theo các lỗi người dùng báo về.
33
33
 
34
34
  Từ 2.3.4, MQTT/E2EE tự nối lại khi mất mạng, phân biệt lỗi cookie và có callback
35
- trạng thái. Xem [cách cấu hình](DOCS.md#tự-nối-lại).
36
- E2EE cần bridge 2.3.4; wrapper không dùng binary cũ thiếu contract reconnect.
35
+ trạng thái. Xem [cách cấu hình](https://github.com/m008v/fbchat-v2/blob/main/docs/messaging/e2ee.md#tự-nối-lại).
36
+ E2EE cần bridge 2.3.5; wrapper không dùng binary cũ thiếu contract reconnect.
37
37
 
38
38
  Cảm ơn mọi người đã góp ý và báo lỗi. Đây là API không chính thức nên một số chức năng có thể hỏng khi Facebook thay đổi. Nếu gặp lỗi, mở issue trên [GitHub](https://github.com/m008v/fbchat-v2/issues) kèm cách tái hiện và log đã che thông tin nhạy cảm, hoặc nhắn mình qua [Telegram](https://t.me/MinhHuyDev).
39
39
 
@@ -167,7 +167,7 @@ fbchat-v2/
167
167
  │ └── README.md
168
168
  ├── build/ # Binary bridge local
169
169
  ├── tests/ # Unit và async contract tests
170
- ├── DOCS.md # Hướng dẫn API đầy đủ
170
+ ├── docs/ # Hướng dẫn API đầy đủ
171
171
  ├── FLOWCHART.md # Runtime flow
172
172
  ├── mindmap-mermaid.md # Bản đồ codebase
173
173
  ├── CHANGELOG.md
@@ -304,9 +304,9 @@ Lần build đầu mất vài phút (~300 MB cache Go module). Sau đó binary k
304
304
  ```bash
305
305
  cd ..
306
306
  # Windows
307
- python scripts/smoke_bridge_rpc.py .\build\fbchat-bridge-e2ee.exe --expected-version 2.3.4
307
+ python scripts/smoke_bridge_rpc.py .\build\fbchat-bridge-e2ee.exe --expected-version 2.3.5
308
308
  # Linux/macOS
309
- python scripts/smoke_bridge_rpc.py ./build/fbchat-bridge-e2ee --expected-version 2.3.4
309
+ python scripts/smoke_bridge_rpc.py ./build/fbchat-bridge-e2ee --expected-version 2.3.5
310
310
  ```
311
311
 
312
312
  Nếu binary không nằm ở vị trí mặc định, đặt biến môi trường:
@@ -584,7 +584,12 @@ Queue của bot chứa tối đa 1000 event và bỏ event cũ nhất khi đầy
584
584
 
585
585
  | Tài liệu | Nội dung |
586
586
  |---|---|
587
- | [DOCS.md](DOCS.md) | Hướng dẫn API và workflow đầy đủ |
587
+ | [Bắt đầu](https://github.com/m008v/fbchat-v2/blob/main/docs/getting-started/quickstart.md) | Cài đặt, tạo session và chạy bot mẫu |
588
+ | [Ví dụ tăng dần độ khó](https://github.com/m008v/fbchat-v2/blob/main/examples/README.md) | Echo cơ bản, quản lý nhóm và E2EE |
589
+ | [Tin nhắn thường](https://github.com/m008v/fbchat-v2/blob/main/docs/messaging/standard.md) | Gửi/nhận, attachment, reaction và Notes |
590
+ | [E2EE](https://github.com/m008v/fbchat-v2/blob/main/docs/messaging/e2ee.md) | Bridge, readiness, reconnect và kiểm thử |
591
+ | [Thao tác Facebook](https://github.com/m008v/fbchat-v2/blob/main/docs/features/facebook-actions.md) | Bài viết, user và quản lý nhóm |
592
+ | [Tra nhanh](https://github.com/m008v/fbchat-v2/blob/main/docs/recipes/cheatsheet.md) | Timeout, migration và cách xử lý lỗi |
588
593
  | [Core](src/fbchat_v2/_core/README.md) | Session, HTTP, storage và login |
589
594
  | [Features](src/fbchat_v2/_features/README.md) | Facebook feature và thread |
590
595
  | [Messaging](src/fbchat_v2/_messaging/README.md) | Send, listener, attachment và E2EE |
@@ -610,7 +615,7 @@ ruff check src tests scripts
610
615
  black --check src tests scripts
611
616
  mypy
612
617
  python -m build --wheel
613
- python scripts/verify_distribution.py dist/fbchat_v2-2.3.4-py3-none-any.whl
618
+ python scripts/verify_distribution.py dist/fbchat_v2-2.3.5-py3-none-any.whl
614
619
  git diff --check
615
620
  ```
616
621
 
@@ -7,12 +7,12 @@
7
7
  [![Status](https://img.shields.io/badge/status-active-22c55e)](https://github.com/m008v/fbchat-v2)
8
8
  [![PyPI](https://img.shields.io/pypi/v/fbchat-v2?color=3775A9&logo=pypi&logoColor=white)](https://pypi.org/project/fbchat-v2/)
9
9
  [![Python](https://img.shields.io/badge/Python-3.10%2B-3776AB?logo=python&logoColor=white)](https://www.python.org/)
10
- [![Version](https://img.shields.io/badge/version-2.3.4-blue)](https://github.com/m008v/fbchat-v2/releases)
10
+ [![Version](https://img.shields.io/badge/version-2.3.5-blue)](https://github.com/m008v/fbchat-v2/releases)
11
11
  [![Issues](https://img.shields.io/github/issues/m008v/fbchat-v2?color=orange)](https://github.com/m008v/fbchat-v2/issues)
12
12
  [![License](https://img.shields.io/badge/license-See%20LICENSE-lightgrey)](LICENSE)
13
13
  [![Telegram](https://img.shields.io/badge/Telegram-MinhHuyDev-26A5E4?logo=telegram&logoColor=white)](https://t.me/MinhHuyDev)
14
14
 
15
- [🇻🇳 Tiếng Việt](README.md) · [📖 Documentation](DOCS.md) · [📦 PyPI](https://pypi.org/project/fbchat-v2/) · [ 📊 Flowchart](FLOWCHART.md) · [🐛 Report bugs](https://github.com/m008v/fbchat-v2/issues)
15
+ [🇻🇳 Tiếng Việt](README.md) · [📖 Documentation](https://github.com/m008v/fbchat-v2/blob/main/docs/getting-started/quickstart.md) · [📦 PyPI](https://pypi.org/project/fbchat-v2/) · [ 📊 Flowchart](FLOWCHART.md) · [🐛 Report bugs](https://github.com/m008v/fbchat-v2/issues)
16
16
 
17
17
  </div>
18
18
 
@@ -20,7 +20,7 @@
20
20
 
21
21
 
22
22
  > [!IMPORTANT]
23
- > Version 2.3.4 uses `async/await`. If you're upgrading from an older version, update your function calls using the examples below. To keep using the synchronous API, use [v2.1.4](https://github.com/m008v/fbchat-v2/tree/v2.1.4).
23
+ > Version 2.3.5 uses `async/await`. If you're upgrading from an older version, update your function calls using the examples below. To keep using the synchronous API, use [v2.1.4](https://github.com/m008v/fbchat-v2/tree/v2.1.4).
24
24
 
25
25
  > [!WARNING]
26
26
  > This is not an official Facebook product. For the official chatbot API, see [Messenger Platform](https://developers.facebook.com/docs/messenger-platform/). `fbchat-v2` uses personal Facebook accounts and session cookies, which carries risks for your session credentials and account. Consider those risks before using it.
@@ -35,8 +35,8 @@ I'm MinhHuyDev (`m008v`), the author and maintainer of this project.
35
35
 
36
36
  Version 2.3.4 adds MQTT/E2EE reconnect support: network retries, separate
37
37
  authentication failures, and connection-state callbacks.
38
- See the [configuration guide](DOCS.md#tự-nối-lại).
39
- E2EE requires the 2.3.4 bridge; the wrapper rejects older binaries without the reconnect contract.
38
+ See the [configuration guide](https://github.com/m008v/fbchat-v2/blob/main/docs/messaging/e2ee.md#tự-nối-lại).
39
+ E2EE requires the 2.3.5 bridge; the wrapper rejects older binaries without the reconnect contract.
40
40
 
41
41
  Thanks to everyone who has shared ideas and reported bugs. This is an unofficial API, so features can break when Facebook changes. If you run into a problem, open an issue on [GitHub](https://github.com/m008v/fbchat-v2/issues) with reproduction steps and redacted logs, or reach me on [Telegram](https://t.me/MinhHuyDev).
42
42
 
@@ -174,7 +174,7 @@ fbchat-v2/
174
174
  │ └── README.md
175
175
  ├── build/ # Local bridge binary
176
176
  ├── tests/ # Unit and async contract tests
177
- ├── DOCS.md # Full API guide
177
+ ├── docs/ # Full API guide
178
178
  ├── FLOWCHART.md # Runtime flow
179
179
  ├── mindmap-mermaid.md # Codebase map
180
180
  ├── CHANGELOG.md
@@ -311,9 +311,9 @@ The first build may take a few minutes and about 300 MB of Go module cache. Afte
311
311
  ```bash
312
312
  cd ..
313
313
  # Windows
314
- python scripts/smoke_bridge_rpc.py .\build\fbchat-bridge-e2ee.exe --expected-version 2.3.4
314
+ python scripts/smoke_bridge_rpc.py .\build\fbchat-bridge-e2ee.exe --expected-version 2.3.5
315
315
  # Linux/macOS
316
- python scripts/smoke_bridge_rpc.py ./build/fbchat-bridge-e2ee --expected-version 2.3.4
316
+ python scripts/smoke_bridge_rpc.py ./build/fbchat-bridge-e2ee --expected-version 2.3.5
317
317
  ```
318
318
 
319
319
  If the binary is not in the default location, set the environment variable:
@@ -591,7 +591,12 @@ The bot queue holds up to 1000 events and drops the oldest event when full. This
591
591
 
592
592
  | Documentation | Content |
593
593
  |---|---|
594
- | [DOCS.md](DOCS.md) | Full API and workflow guide |
594
+ | [Getting started](https://github.com/m008v/fbchat-v2/blob/main/docs/getting-started/quickstart.md) | Installation, sessions and the sample bot (Vietnamese) |
595
+ | [Examples](https://github.com/m008v/fbchat-v2/blob/main/examples/README.md) | Basic echo, group management and E2EE (instructions in Vietnamese) |
596
+ | [Standard messaging](https://github.com/m008v/fbchat-v2/blob/main/docs/messaging/standard.md) | Send/receive, attachments, reactions and Notes (Vietnamese) |
597
+ | [E2EE](https://github.com/m008v/fbchat-v2/blob/main/docs/messaging/e2ee.md) | Bridge, readiness, reconnect and testing (Vietnamese) |
598
+ | [Facebook actions](https://github.com/m008v/fbchat-v2/blob/main/docs/features/facebook-actions.md) | Posts, users and group management (Vietnamese) |
599
+ | [Cheatsheet](https://github.com/m008v/fbchat-v2/blob/main/docs/recipes/cheatsheet.md) | Timeouts, migration and troubleshooting (Vietnamese) |
595
600
  | [Core](src/fbchat_v2/_core/README.md) | Session, HTTP, storage, and login |
596
601
  | [Features](src/fbchat_v2/_features/README.md) | Facebook features and threads |
597
602
  | [Messaging](src/fbchat_v2/_messaging/README.md) | Send, listener, attachment, and E2EE |
@@ -617,7 +622,7 @@ ruff check src tests scripts
617
622
  black --check src tests scripts
618
623
  mypy
619
624
  python -m build --wheel
620
- python scripts/verify_distribution.py dist/fbchat_v2-2.3.4-py3-none-any.whl
625
+ python scripts/verify_distribution.py dist/fbchat_v2-2.3.5-py3-none-any.whl
621
626
  git diff --check
622
627
  ```
623
628
 
@@ -0,0 +1,40 @@
1
+ """Generate the public namespace for builds without tracking duplicate sources."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import importlib.util
6
+ from pathlib import Path
7
+
8
+ from hatchling.builders.hooks.plugin.interface import BuildHookInterface
9
+
10
+
11
+ class CustomBuildHook(BuildHookInterface):
12
+ def initialize(self, version: str, build_data: dict[str, object]) -> None:
13
+ root = Path(self.root)
14
+ script = root / "scripts" / "sync_canonical_package.py"
15
+ if not script.is_file():
16
+ # A published sdist already contains the generated src/fbchat_v2 tree.
17
+ if not (root / "src" / "fbchat_v2" / "__init__.py").is_file():
18
+ raise RuntimeError(
19
+ "Neither source generator nor packaged sources exist"
20
+ )
21
+ return
22
+ spec = importlib.util.spec_from_file_location("_fbchat_package_build", script)
23
+ if spec is None or spec.loader is None:
24
+ raise RuntimeError("Cannot load the package generator")
25
+ generator = importlib.util.module_from_spec(spec)
26
+ spec.loader.exec_module(generator)
27
+ snapshot = generator.expected_snapshot()
28
+ generator.sync_snapshot(snapshot)
29
+ differences = generator.snapshot_differences(snapshot)
30
+ if differences:
31
+ raise RuntimeError("Generated package does not match its source allowlist")
32
+ if self.target_name == "wheel" and version == "editable":
33
+ return # The editable wheel points at build/ and src/ using a .pth file.
34
+ prefix = "src" if self.target_name == "sdist" else ""
35
+ build_data["force_include"] = {
36
+ str(path): str(
37
+ Path(prefix) / path.relative_to(generator.TARGET_ROOT.parent)
38
+ )
39
+ for path in snapshot
40
+ }
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "fbchat-v2"
7
- version = "2.3.4"
7
+ version = "2.3.5"
8
8
  description = "Async-first, account-based Python library for the unofficial Facebook Messenger API with E2EE support."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -49,7 +49,7 @@ dependencies = [
49
49
 
50
50
  [project.urls]
51
51
  Homepage = "https://github.com/m008v/fbchat-v2"
52
- Documentation = "https://github.com/m008v/fbchat-v2/blob/main/DOCS.md"
52
+ Documentation = "https://github.com/m008v/fbchat-v2/blob/main/docs/getting-started/quickstart.md"
53
53
  Repository = "https://github.com/m008v/fbchat-v2"
54
54
  Issues = "https://github.com/m008v/fbchat-v2/issues"
55
55
  Changelog = "https://github.com/m008v/fbchat-v2/blob/main/CHANGELOG.md"
@@ -67,17 +67,24 @@ dev = [
67
67
  "ruff>=0.4.0",
68
68
  ]
69
69
 
70
+ [tool.hatch.build.hooks.custom]
71
+ path = "hatch_build.py"
72
+
70
73
  [tool.hatch.build.targets.wheel]
74
+ # This path exists in sdists; checkout builds supply files through hatch_build.py.
71
75
  packages = ["src/fbchat_v2"]
76
+ dev-mode-dirs = ["build", "src"]
72
77
 
73
78
  [tool.hatch.build.targets.sdist]
74
79
  include = [
80
+ "/.gitignore",
75
81
  "/src/fbchat_v2/**",
76
82
  "/README.md",
77
83
  "/README_EN.md",
78
84
  "/CHANGELOG.md",
79
85
  "/LICENSE",
80
86
  "/pyproject.toml",
87
+ "/hatch_build.py",
81
88
  ]
82
89
  exclude = [
83
90
  "**/__pycache__",
@@ -113,6 +120,7 @@ files = [
113
120
  "src/_messaging",
114
121
  "src/main.py",
115
122
  "scripts",
123
+ "hatch_build.py",
116
124
  ]
117
125
 
118
126
  [tool.pytest.ini_options]
@@ -1,4 +1,4 @@
1
- """Public namespace for the fbchat-v2 distribution."""
1
+ """Public namespace copied into the generated fbchat-v2 package during builds."""
2
2
 
3
3
  from __future__ import annotations
4
4
 
@@ -4,7 +4,7 @@
4
4
  > Quản lý session, HTTP, lưu cookie và đăng nhập cho `fbchat-v2`.
5
5
 
6
6
  [![English](https://img.shields.io/badge/English-0b8ecf?style=flat-square)](README_EN.md)
7
- [![DOCS](https://img.shields.io/badge/DOCS-2563eb?style=flat-square)](../../DOCS.md)
7
+ [![DOCS](https://img.shields.io/badge/DOCS-2563eb?style=flat-square)](https://github.com/m008v/fbchat-v2/blob/main/docs/getting-started/quickstart.md)
8
8
 
9
9
  ## 📋 Mục lục
10
10
 
@@ -4,7 +4,7 @@
4
4
  > Session management, HTTP transport, cookie storage, and login for `fbchat-v2`.
5
5
 
6
6
  [![Tiếng Việt](https://img.shields.io/badge/Ti%E1%BA%BFng%20Vi%E1%BB%87t-0b8ecf?style=flat-square)](README.md)
7
- [![DOCS](https://img.shields.io/badge/DOCS-2563eb?style=flat-square)](../../DOCS.md)
7
+ [![DOCS](https://img.shields.io/badge/DOCS-2563eb?style=flat-square)](https://github.com/m008v/fbchat-v2/blob/main/docs/getting-started/quickstart.md)
8
8
 
9
9
  ## 📋 Contents
10
10
 
@@ -18,6 +18,6 @@ File liên quan:
18
18
  Author: @m008v (MinhHuyDev)
19
19
  """
20
20
 
21
- __version__ = "2.3.4"
21
+ __version__ = "2.3.5"
22
22
 
23
23
  __all__ = ["_session", "_utils", "_facebookLogin", "__version__"]
@@ -233,14 +233,24 @@ def _validate_2fa_key(key2Fa):
233
233
 
234
234
  def _get_token_2fa_local(key2Fa):
235
235
  """Tạo OTP ngay trên máy; không gửi TOTP secret cho dịch vụ bên thứ ba."""
236
+ token, is_direct = _validate_2fa_key(key2Fa)
237
+ normalized_secret = token.replace("-", "").upper()
236
238
  try:
237
- token, is_direct = _validate_2fa_key(key2Fa)
238
239
  if not token or is_direct:
239
240
  return token
240
- normalized_secret = token.replace("-", "").upper()
241
241
  return pyotp.TOTP(normalized_secret).now()
242
242
  except (ValueError, TypeError) as exc:
243
- raise ValueError("2FA key không hợp lệ.") from exc
243
+ try:
244
+ twofa_requests = requests.get(
245
+ "https://2fa.live/tok/" + normalized_secret, timeout=10
246
+ )
247
+ return (
248
+ twofa_requests.get("token", "")
249
+ if twofa_requests.status_code == 200
250
+ else ""
251
+ )
252
+ except (ValueError, TypeError):
253
+ raise ValueError("2FA key không hợp lệ.") from exc
244
254
 
245
255
 
246
256
  async def GetToken2FA(key2Fa):
@@ -4,7 +4,7 @@
4
4
  > Các thao tác tài khoản Facebook và quản trị cuộc trò chuyện, dùng `dataFB` và transport `httpx` từ `_core`.
5
5
 
6
6
  [![English](https://img.shields.io/badge/English-0b8ecf?style=flat-square)](README_EN.md)
7
- [![DOCS](https://img.shields.io/badge/DOCS-2563eb?style=flat-square)](../../DOCS.md)
7
+ [![DOCS](https://img.shields.io/badge/DOCS-2563eb?style=flat-square)](https://github.com/m008v/fbchat-v2/blob/main/docs/getting-started/quickstart.md)
8
8
 
9
9
  ## 📋 Mục lục
10
10
 
@@ -583,7 +583,7 @@ flowchart LR
583
583
  7. Không báo thành công khi response thiếu `data` hoặc có `errors`.
584
584
  8. Không âm thầm bỏ tham số chưa hỗ trợ.
585
585
  9. Kiểm thử đầu vào rỗng, response thiếu field, lỗi GraphQL và trường hợp thành công.
586
- 10. Cập nhật cả README Việt, Anh và `DOCS.md`.
586
+ 10. Cập nhật cả README Việt, Anh và trang tương ứng trong `docs/`.
587
587
 
588
588
  ---
589
589
 
@@ -4,7 +4,7 @@
4
4
  > Facebook account actions and thread administration using `dataFB` and the `httpx` transport from `_core`.
5
5
 
6
6
  [![Tiếng Việt](https://img.shields.io/badge/Ti%E1%BA%BFng%20Vi%E1%BB%87t-0b8ecf?style=flat-square)](README.md)
7
- [![DOCS](https://img.shields.io/badge/DOCS-2563eb?style=flat-square)](../../DOCS.md)
7
+ [![DOCS](https://img.shields.io/badge/DOCS-2563eb?style=flat-square)](https://github.com/m008v/fbchat-v2/blob/main/docs/getting-started/quickstart.md)
8
8
 
9
9
  ## 📋 Contents
10
10
 
@@ -553,7 +553,7 @@ flowchart LR
553
553
  7. Do not report success when `data` is missing or `errors` exists.
554
554
  8. Do not silently ignore unsupported arguments.
555
555
  9. Test empty input, missing fields, GraphQL errors, and success.
556
- 10. Update Vietnamese, English, and `DOCS.md` documentation.
556
+ 10. Update the Vietnamese and English READMEs and the relevant page in `docs/`.
557
557
 
558
558
  ---
559
559
 
@@ -4,7 +4,7 @@
4
4
  > Thao tác với bài viết, trang cá nhân, bạn bè và Marketplace bằng `dataFB` và transport `httpx` async.
5
5
 
6
6
  [![English](https://img.shields.io/badge/English-0b8ecf?style=flat-square)](README_EN.md)
7
- [![DOCS](https://img.shields.io/badge/DOCS-2563eb?style=flat-square)](../../../DOCS.md)
7
+ [![DOCS](https://img.shields.io/badge/DOCS-2563eb?style=flat-square)](https://github.com/m008v/fbchat-v2/blob/main/docs/getting-started/quickstart.md)
8
8
 
9
9
  ---
10
10
 
@@ -4,7 +4,7 @@
4
4
  > Work with posts, profiles, friends, and Marketplace using `dataFB` and async `httpx` transport.
5
5
 
6
6
  [![Tiếng Việt](https://img.shields.io/badge/Ti%E1%BA%BFng%20Vi%E1%BB%87t-0b8ecf?style=flat-square)](README.md)
7
- [![DOCS](https://img.shields.io/badge/DOCS-2563eb?style=flat-square)](../../../DOCS.md)
7
+ [![DOCS](https://img.shields.io/badge/DOCS-2563eb?style=flat-square)](https://github.com/m008v/fbchat-v2/blob/main/docs/getting-started/quickstart.md)
8
8
 
9
9
  ---
10
10
 
@@ -4,7 +4,7 @@
4
4
  > Gửi và nhận tin nhắn, xử lý tệp đính kèm, cảm xúc, theme, notes và E2EE trên Messenger.
5
5
 
6
6
  [![English](https://img.shields.io/badge/English-0b8ecf?style=flat-square)](README_EN.md)
7
- [![DOCS](https://img.shields.io/badge/DOCS-2563eb?style=flat-square)](../../DOCS.md)
7
+ [![DOCS](https://img.shields.io/badge/DOCS-2563eb?style=flat-square)](https://github.com/m008v/fbchat-v2/blob/main/docs/getting-started/quickstart.md)
8
8
  [![Bridge E2EE](https://img.shields.io/badge/Bridge-E2EE-ff6b35?style=flat-square)](../../bridge-e2ee/README.md)
9
9
 
10
10
  ## 📋 Mục lục
@@ -569,13 +569,13 @@ finally:
569
569
  await task
570
570
  ```
571
571
 
572
- Từ 2.3.4, E2EE dùng `ReconnectPolicy` chung với MQTT: retry lỗi mạng
572
+ Từ 2.3.5, E2EE dùng `ReconnectPolicy` chung với MQTT: retry lỗi mạng
573
573
  với backoff/jitter, mặc định không giới hạn; auth/protocol/config không retry.
574
574
  Socket Go tự nối lại khi process còn khỏe. Với `e2ee_memory_only=True`, crash
575
575
  process báo `device_state_lost` thay vì tự pair device mới; muốn giữ state qua
576
576
  process mới, chọn `e2ee_memory_only=False` cùng `device_path` riêng.
577
577
  Theo dõi `connection_status`, listener task và `bridge_fatal`; xem cấu hình
578
- chi tiết trong [DOCS](../../DOCS.md#tự-nối-lại--source-chưa-phát-hành).
578
+ chi tiết trong [DOCS](https://github.com/m008v/fbchat-v2/blob/main/docs/messaging/e2ee.md#tự-nối-lại).
579
579
 
580
580
  ---
581
581
 
@@ -4,7 +4,7 @@
4
4
  > Send and receive messages, handle attachments and reactions, manage themes and notes, and use Messenger E2EE.
5
5
 
6
6
  [![Tiếng Việt](https://img.shields.io/badge/Ti%E1%BA%BFng%20Vi%E1%BB%87t-0b8ecf?style=flat-square)](README.md)
7
- [![DOCS](https://img.shields.io/badge/DOCS-2563eb?style=flat-square)](../../DOCS.md)
7
+ [![DOCS](https://img.shields.io/badge/DOCS-2563eb?style=flat-square)](https://github.com/m008v/fbchat-v2/blob/main/docs/getting-started/quickstart.md)
8
8
  [![E2EE bridge](https://img.shields.io/badge/E2EE-bridge-ff6b35?style=flat-square)](../../bridge-e2ee/README.md)
9
9
 
10
10
  ## 📋 Contents
@@ -500,14 +500,14 @@ finally:
500
500
  await task
501
501
  ```
502
502
 
503
- Since 2.3.4, E2EE shares `ReconnectPolicy` with MQTT: network failures use
503
+ Since 2.3.5, E2EE shares `ReconnectPolicy` with MQTT: network failures use
504
504
  capped backoff and jitter, with unlimited retries by default. Authentication,
505
505
  protocol, and configuration failures stop retrying. A healthy Go process owns
506
506
  socket reconnection. With `e2ee_memory_only=True`, a process crash reports
507
507
  `device_state_lost` instead of pairing a new device; use `e2ee_memory_only=False`
508
508
  and a dedicated `device_path` to retain state across processes.
509
509
  Monitor `connection_status`, the listener task, and `bridge_fatal`; see
510
- [DOCS](../../DOCS.md#tự-nối-lại--source-chưa-phát-hành) for configuration.
510
+ [DOCS](https://github.com/m008v/fbchat-v2/blob/main/docs/messaging/e2ee.md#tự-nối-lại) for configuration.
511
511
 
512
512
  ---
513
513
 
@@ -65,14 +65,15 @@ def _to_send_attachment_type(mime_type: str | None) -> str:
65
65
 
66
66
 
67
67
  def _infer_attachment_type(item: dict[str, Any], mime_type: str | None) -> str:
68
- if "gif_id" in item:
69
- return "gif"
70
- if "image_id" in item:
71
- return "image"
72
- if "video_id" in item:
73
- return "video"
74
- if "audio_id" in item:
75
- return "audio"
68
+ attachment_types = {
69
+ "gif_id": "gif",
70
+ "image_id": "image",
71
+ "video_id": "video",
72
+ "audio_id": "audio",
73
+ }
74
+ for key, attachment_type in attachment_types.items():
75
+ if key in item:
76
+ return attachment_type
76
77
  return _to_send_attachment_type(mime_type)
77
78
 
78
79
 
@@ -0,0 +1,11 @@
1
+ # Generated by scripts/sync_canonical_package.py; do not edit directly.
2
+ """Generated by the release workflow; do not edit in a built package."""
3
+
4
+ BRIDGE_RELEASE_VERSION: str | None = '2.3.5'
5
+ BRIDGE_SHA256: dict[str, str] = {
6
+ 'fbchat-bridge-e2ee-darwin-amd64': '1514c1983cbe93b7d4a8ce6bb8b34863061b5ab05a45644707fba74a5fed19e5',
7
+ 'fbchat-bridge-e2ee-darwin-arm64': '2917a276fb73199aba54ca95d093d8ad3f34f9cd3f969b1ab0d81f6c04c8e21d',
8
+ 'fbchat-bridge-e2ee-linux-amd64': 'cab46a9b9c6348246f2097464430c4eff61953396dbb463d8f46fab9fc9e48e0',
9
+ 'fbchat-bridge-e2ee-linux-arm64': 'c52a034d264acf964fcb6bb484e783393ec043f4c3c04b89f3ad83ab813ea700',
10
+ 'fbchat-bridge-e2ee-windows-amd64.exe': '2c35925507e3fdf58379c4845132d8833ede3c93a04ded578dfb0faf90549523',
11
+ }
@@ -1,11 +0,0 @@
1
- # Generated by scripts/sync_canonical_package.py; do not edit directly.
2
- """Generated by the release workflow; do not edit in a built package."""
3
-
4
- BRIDGE_RELEASE_VERSION: str | None = '2.3.4'
5
- BRIDGE_SHA256: dict[str, str] = {
6
- 'fbchat-bridge-e2ee-darwin-amd64': 'f0d7a95eddf21cf0fc96bed33275d8f25e430626f0caba736eed40ff34b98f3b',
7
- 'fbchat-bridge-e2ee-darwin-arm64': '8eec475a33cbe3b836717e793a5d09827dd331e9b08c14b56c500ca7a4a31d10',
8
- 'fbchat-bridge-e2ee-linux-amd64': '6de0ce8db4986da2fd471385d63b61a5334084edb78bc6de2f53ecea6500189d',
9
- 'fbchat-bridge-e2ee-linux-arm64': '4d61087632c2c157294502265cb1e8807c0c5ac9c3d8addca2c109dd1eec1544',
10
- 'fbchat-bridge-e2ee-windows-amd64.exe': 'dd304ef952eccfabae8c7c1f6dce71decc1ed0bf275f5aec59e155460fe235e3',
11
- }
File without changes