telepost-bot 2.84.2__tar.gz → 2.84.3__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 (311) hide show
  1. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/CHANGELOG.md +9 -0
  2. telepost_bot-2.84.3/PKG-INFO +166 -0
  3. telepost_bot-2.84.3/README.en.md +130 -0
  4. telepost_bot-2.84.3/README.md +118 -0
  5. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/services/review_service.py +1 -1
  6. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/build_info.py +1 -1
  7. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/telegram/delivery/discussion.py +19 -15
  8. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/telegram/delivery/gateway.py +7 -1
  9. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/telegram/delivery/registry.py +10 -8
  10. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/telegram/delivery/sender.py +8 -2
  11. telepost_bot-2.84.3/telepost_bot.egg-info/PKG-INFO +166 -0
  12. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost_bot.egg-info/SOURCES.txt +1 -0
  13. telepost_bot-2.84.3/tests/test_discussion_uncertainty.py +119 -0
  14. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/ui/locales/en/LC_MESSAGES/telepost.mo +0 -0
  15. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/ui/locales/en/LC_MESSAGES/telepost.po +3 -4
  16. telepost_bot-2.84.2/PKG-INFO +0 -314
  17. telepost_bot-2.84.2/README.en.md +0 -292
  18. telepost_bot-2.84.2/README.md +0 -266
  19. telepost_bot-2.84.2/telepost_bot.egg-info/PKG-INFO +0 -314
  20. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/LICENSE +0 -0
  21. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/MANIFEST.in +0 -0
  22. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/config/__init__.py +0 -0
  23. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/config/fly-telepost-policy.example.json +0 -0
  24. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/config/review_policy.md +0 -0
  25. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/config/settings.py +0 -0
  26. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/config.ini.example +0 -0
  27. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/database/__init__.py +0 -0
  28. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/database/db_manager.py +0 -0
  29. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/handlers/__init__.py +0 -0
  30. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/handlers/api_commands.py +0 -0
  31. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/handlers/automation.py +0 -0
  32. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/handlers/botconfig.py +0 -0
  33. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/handlers/callback_handlers.py +0 -0
  34. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/handlers/channel_listener.py +0 -0
  35. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/handlers/command_handlers.py +0 -0
  36. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/handlers/conversation.py +0 -0
  37. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/handlers/error_handler.py +0 -0
  38. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/handlers/index_handlers.py +0 -0
  39. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/handlers/mode_selection.py +0 -0
  40. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/handlers/moderation.py +0 -0
  41. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/handlers/preview_handlers.py +0 -0
  42. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/handlers/publish.py +0 -0
  43. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/handlers/reaction_stats.py +0 -0
  44. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/handlers/recovery.py +0 -0
  45. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/handlers/review.py +0 -0
  46. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/handlers/schedule_status.py +0 -0
  47. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/handlers/search_handlers.py +0 -0
  48. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/handlers/stats_handlers.py +0 -0
  49. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/handlers/upload.py +0 -0
  50. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/main.py +0 -0
  51. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/mcp_server/__init__.py +0 -0
  52. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/mcp_server/review_client.py +0 -0
  53. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/mcp_server/server.py +0 -0
  54. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/models/__init__.py +0 -0
  55. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/models/state.py +0 -0
  56. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/protocol/__init__.py +0 -0
  57. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/protocol/v1/SOURCES.sha256 +0 -0
  58. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/protocol/v1/__init__.py +0 -0
  59. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/protocol/v1/error-mapping.json +0 -0
  60. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/protocol/v1/fixtures/ackresult.candidate_search.json +0 -0
  61. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/protocol/v1/fixtures/capabilities.pixivflow.json +0 -0
  62. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/protocol/v1/fixtures/event.job.expired.json +0 -0
  63. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/protocol/v1/fixtures/event.job.succeeded.json +0 -0
  64. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/protocol/v1/fixtures/eventpage.candidate_search.json +0 -0
  65. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/protocol/v1/fixtures/job.cancelled.candidate_search.json +0 -0
  66. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/protocol/v1/fixtures/job.failed.no_candidate.json +0 -0
  67. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/protocol/v1/fixtures/job.queued.json +0 -0
  68. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/protocol/v1/fixtures/job.running.json +0 -0
  69. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/protocol/v1/fixtures/job.succeeded.candidate_search.json +0 -0
  70. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/protocol/v1/fixtures/jobpage.candidate_search.json +0 -0
  71. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/protocol/v1/fixtures/task.candidate_search.json +0 -0
  72. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/protocol/v1/fixtures/task.candidate_search.target_only.json +0 -0
  73. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/protocol/v1/protocol.schema.json +0 -0
  74. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/pyproject.toml +0 -0
  75. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/run.py +0 -0
  76. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/services/__init__.py +0 -0
  77. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/setup.cfg +0 -0
  78. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/__init__.py +0 -0
  79. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/api/__init__.py +0 -0
  80. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/application/__init__.py +0 -0
  81. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/application/admin_ops.py +0 -0
  82. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/application/automation.py +0 -0
  83. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/application/delivery_planner.py +0 -0
  84. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/application/editorial.py +0 -0
  85. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/application/hot.py +0 -0
  86. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/application/novel_fallback_card.py +0 -0
  87. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/application/novel_preview.py +0 -0
  88. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/application/pixivflow_jobs.py +0 -0
  89. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/application/post_media.py +0 -0
  90. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/application/posts.py +0 -0
  91. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/application/publication.py +0 -0
  92. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/application/reaction_backfill.py +0 -0
  93. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/application/recovery.py +0 -0
  94. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/application/refetch.py +0 -0
  95. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/application/rerender.py +0 -0
  96. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/application/resubmit.py +0 -0
  97. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/application/review_queue.py +0 -0
  98. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/application/submitter_notify.py +0 -0
  99. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/application/telepress_provider.py +0 -0
  100. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/domain/__init__.py +0 -0
  101. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/domain/automation.py +0 -0
  102. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/domain/delivery.py +0 -0
  103. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/domain/editorial.py +0 -0
  104. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/domain/errors.py +0 -0
  105. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/domain/hot.py +0 -0
  106. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/domain/media.py +0 -0
  107. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/domain/navigation.py +0 -0
  108. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/domain/novel_preview.py +0 -0
  109. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/domain/packing.py +0 -0
  110. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/domain/presentation.py +0 -0
  111. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/domain/presentation_policy.py +0 -0
  112. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/domain/refetch_state.py +0 -0
  113. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/domain/review.py +0 -0
  114. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/domain/review_chat.py +0 -0
  115. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/domain/submission.py +0 -0
  116. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/miniapp/__init__.py +0 -0
  117. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/miniapp/auth.py +0 -0
  118. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/miniapp/rbac.py +0 -0
  119. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/miniapp/role_bindings.py +0 -0
  120. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/miniapp/session.py +0 -0
  121. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/observability/__init__.py +0 -0
  122. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/observability/audit.py +0 -0
  123. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/observability/cli.py +0 -0
  124. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/observability/doctor.py +0 -0
  125. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/observability/errors.py +0 -0
  126. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/observability/redact.py +0 -0
  127. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/storage/__init__.py +0 -0
  128. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/storage/sqlite/__init__.py +0 -0
  129. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/storage/sqlite/automation.py +0 -0
  130. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/storage/sqlite/columns.py +0 -0
  131. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/storage/sqlite/editorial.py +0 -0
  132. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/storage/sqlite/inbox.py +0 -0
  133. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/storage/sqlite/ledger.py +0 -0
  134. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/storage/sqlite/media_assets.py +0 -0
  135. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/storage/sqlite/moderation.py +0 -0
  136. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/storage/sqlite/novel_preview.py +0 -0
  137. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/storage/sqlite/posts.py +0 -0
  138. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/storage/sqlite/protocol_events.py +0 -0
  139. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/storage/sqlite/recovery.py +0 -0
  140. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/storage/sqlite/refetch.py +0 -0
  141. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/storage/sqlite/reviews.py +0 -0
  142. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/storage/sqlite/submitter_notifications.py +0 -0
  143. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/telegram/__init__.py +0 -0
  144. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/telegram/callback_feedback.py +0 -0
  145. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/telegram/capture.py +0 -0
  146. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/telegram/delivery/__init__.py +0 -0
  147. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/telegram/delivery/executor.py +0 -0
  148. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/telegram/delivery/legacy_runner.py +0 -0
  149. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/telegram/delivery/planner.py +0 -0
  150. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/telegram/delivery/preparation.py +0 -0
  151. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/telegram/inbox_worker.py +0 -0
  152. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/telegram/review_expiry.py +0 -0
  153. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/telegram/review_keyboard.py +0 -0
  154. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/telegram/review_media.py +0 -0
  155. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost/telegram/review_stager.py +0 -0
  156. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost_bot.egg-info/dependency_links.txt +0 -0
  157. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost_bot.egg-info/entry_points.txt +0 -0
  158. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost_bot.egg-info/requires.txt +0 -0
  159. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/telepost_bot.egg-info/top_level.txt +0 -0
  160. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_admin_api.py +0 -0
  161. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_anonymous.py +0 -0
  162. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_api_commands.py +0 -0
  163. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_api_server.py +0 -0
  164. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_api_version.py +0 -0
  165. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_architecture_application.py +0 -0
  166. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_architecture_core.py +0 -0
  167. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_automation.py +0 -0
  168. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_backfill_attribution.py +0 -0
  169. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_blacklist.py +0 -0
  170. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_bot_language.py +0 -0
  171. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_bot_token_logging.py +0 -0
  172. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_botconfig.py +0 -0
  173. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_boundary.py +0 -0
  174. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_callback_contract.py +0 -0
  175. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_caption_mentions.py +0 -0
  176. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_compatibility.py +0 -0
  177. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_config_encoding.py +0 -0
  178. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_console_encoding.py +0 -0
  179. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_conversation_flow.py +0 -0
  180. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_data_class_cleanup.py +0 -0
  181. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_database.py +0 -0
  182. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_database_first_start.py +0 -0
  183. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_database_operations.py +0 -0
  184. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_delivery_planner.py +0 -0
  185. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_disposition.py +0 -0
  186. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_doctor.py +0 -0
  187. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_editorial.py +0 -0
  188. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_file_validator.py +0 -0
  189. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_fly_deploy_contract.py +0 -0
  190. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_frozen_support.py +0 -0
  191. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_handlers.py +0 -0
  192. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_heat_calculator.py +0 -0
  193. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_helper_functions.py +0 -0
  194. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_hot_domain.py +0 -0
  195. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_identity_provenance.py +0 -0
  196. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_install_scripts.py +0 -0
  197. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_integration.py +0 -0
  198. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_legacy_delivery_port_navigation.py +0 -0
  199. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_logic_flow.py +0 -0
  200. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_logical_submissions.py +0 -0
  201. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_maintenance_jobs.py +0 -0
  202. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_manager_notifications.py +0 -0
  203. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_media_decision_audit.py +0 -0
  204. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_media_delivery_pipeline.py +0 -0
  205. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_media_domain.py +0 -0
  206. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_media_preparation.py +0 -0
  207. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_media_proxy_delivery.py +0 -0
  208. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_menu_shortcut_single_reply.py +0 -0
  209. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_messages.py +0 -0
  210. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_miniapp_api.py +0 -0
  211. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_miniapp_auth.py +0 -0
  212. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_miniapp_content.py +0 -0
  213. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_miniapp_entries.py +0 -0
  214. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_miniapp_history.py +0 -0
  215. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_miniapp_rbac.py +0 -0
  216. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_mixed_media_integrity.py +0 -0
  217. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_moderation_and_admin_ux.py +0 -0
  218. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_navigation.py +0 -0
  219. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_no_owner_probe.py +0 -0
  220. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_novel_cover_preview.py +0 -0
  221. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_novel_delivery_semantics.py +0 -0
  222. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_novel_preview.py +0 -0
  223. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_observability.py +0 -0
  224. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_observability_lifecycle.py +0 -0
  225. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_online_reading_root_button.py +0 -0
  226. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_packing_ssot.py +0 -0
  227. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_polling_server.py +0 -0
  228. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_preview_pagination.py +0 -0
  229. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_production_handler_graph.py +0 -0
  230. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_protocol_contract.py +0 -0
  231. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_publication_presentation.py +0 -0
  232. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_publish_idempotency.py +0 -0
  233. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_publish_regressions.py +0 -0
  234. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_publish_reply.py +0 -0
  235. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_reaction_backfill.py +0 -0
  236. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_reaction_stats.py +0 -0
  237. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_recovery.py +0 -0
  238. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_refetch.py +0 -0
  239. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_refetch_card_state.py +0 -0
  240. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_refetch_events.py +0 -0
  241. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_refetch_job_lifecycle.py +0 -0
  242. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_refetch_reason_normalization.py +0 -0
  243. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_refetch_replacement.py +0 -0
  244. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_remote_fetch_fallback.py +0 -0
  245. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_rerender.py +0 -0
  246. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_resubmit.py +0 -0
  247. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_review.py +0 -0
  248. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_review_album_payload.py +0 -0
  249. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_review_card_recovery.py +0 -0
  250. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_review_chat_contract.py +0 -0
  251. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_review_consistency.py +0 -0
  252. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_review_expiry_recovery.py +0 -0
  253. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_review_http_mcp.py +0 -0
  254. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_review_media_lifecycle.py +0 -0
  255. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_review_service.py +0 -0
  256. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_robustness.py +0 -0
  257. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_run_dispatcher.py +0 -0
  258. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_run_mode.py +0 -0
  259. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_run_supervisor.py +0 -0
  260. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_schedule_outcomes.py +0 -0
  261. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_search_disabled_hint.py +0 -0
  262. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_search_recovery.py +0 -0
  263. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_security.py +0 -0
  264. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_security_headers.py +0 -0
  265. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_session_database_handles.py +0 -0
  266. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_shutdown.py +0 -0
  267. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_streaming_uploads.py +0 -0
  268. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_submission_timeout_idempotency.py +0 -0
  269. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_telegram_golden_messages.py +0 -0
  270. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_telegram_media_cache.py +0 -0
  271. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_update_inbox.py +0 -0
  272. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_upload.py +0 -0
  273. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_user_friendly_messages.py +0 -0
  274. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_webhook_payload_admission.py +0 -0
  275. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_webhook_ready.py +0 -0
  276. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_webhook_router.py +0 -0
  277. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_webhook_secret.py +0 -0
  278. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_webhook_secret_logging.py +0 -0
  279. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_webhook_static.py +0 -0
  280. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/tests/test_work_id_wire.py +0 -0
  281. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/ui/__init__.py +0 -0
  282. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/ui/i18n.py +0 -0
  283. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/ui/keyboards.py +0 -0
  284. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/ui/messages.py +0 -0
  285. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/utils/__init__.py +0 -0
  286. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/utils/api_server.py +0 -0
  287. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/utils/api_tokens.py +0 -0
  288. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/utils/blacklist.py +0 -0
  289. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/utils/cache.py +0 -0
  290. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/utils/config_wizard.py +0 -0
  291. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/utils/console.py +0 -0
  292. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/utils/database.py +0 -0
  293. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/utils/file_validator.py +0 -0
  294. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/utils/heat_calculator.py +0 -0
  295. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/utils/helper_functions.py +0 -0
  296. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/utils/index_manager.py +0 -0
  297. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/utils/logging_config.py +0 -0
  298. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/utils/maintenance_jobs.py +0 -0
  299. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/utils/polling_server.py +0 -0
  300. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/utils/run_mode.py +0 -0
  301. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/utils/runtime_policy.py +0 -0
  302. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/utils/schedule_watchdog.py +0 -0
  303. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/utils/search_engine.py +0 -0
  304. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/utils/security_headers.py +0 -0
  305. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/utils/submission.py +0 -0
  306. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/utils/webhook_server.py +0 -0
  307. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/webapp/__init__.py +0 -0
  308. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/webapp/dist/assets/2d82b92e720462f8dd3b-Bh4Fahcw.svg +0 -0
  309. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/webapp/dist/assets/index-CLfkW8eZ.css +0 -0
  310. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/webapp/dist/assets/index-CfjBQN_e.js +0 -0
  311. {telepost_bot-2.84.2 → telepost_bot-2.84.3}/webapp/dist/index.html +0 -0
@@ -8,6 +8,15 @@
8
8
  > 发布说明面向普通用户:写「对用户有什么改变」,不写内部实现细节(模块名、函数名、配置键);
9
9
  > 技术细节放进代码注释或 `docs/`。每个 Release 的正文由本文件对应版本段自动生成。
10
10
 
11
+ ## [2.84.3](https://github.com/redtidev1918/TelePost/compare/v2.84.2...v2.84.3) (2026-10-24)
12
+
13
+
14
+ ### Bug Fixes
15
+
16
+ * preserve publication uncertainty and prevent unrelated-forward rollback ([cf22cdf](https://github.com/redtidev1918/TelePost/commit/cf22cdf4614cbc3c7df892726f112273548d2b8c))
17
+ * preserve uncertain publication outcomes and reject uncorrelated forwards ([5f7851a](https://github.com/redtidev1918/TelePost/commit/5f7851a15928048e61e4fd4874631b33f7935208))
18
+ * translate uncertainty recovery guidance ([bd47a7f](https://github.com/redtidev1918/TelePost/commit/bd47a7f8009f0819e2b679709d99d3e7c874ffe0))
19
+
11
20
  ## [2.84.2](https://github.com/redtidev1918/TelePost/compare/v2.84.1...v2.84.2) (2026-10-22)
12
21
 
13
22
 
@@ -0,0 +1,166 @@
1
+ Metadata-Version: 2.4
2
+ Name: telepost-bot
3
+ Version: 2.84.3
4
+ Summary: Telegram submission, review, and publication bot with a Mini App, HTTP API, and multi-bot supervisor.
5
+ Author: redtidev1918
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/redtidev1918/TelePost
8
+ Project-URL: Repository, https://github.com/redtidev1918/TelePost
9
+ Project-URL: Documentation, https://github.com/redtidev1918/TelePost/tree/main/docs
10
+ Project-URL: Issues, https://github.com/redtidev1918/TelePost/issues
11
+ Project-URL: Changelog, https://github.com/redtidev1918/TelePost/blob/main/CHANGELOG.md
12
+ Keywords: telegram,bot,submission,review,publication,miniapp,telepost,moderation
13
+ Classifier: Development Status :: 5 - Production/Stable
14
+ Classifier: Environment :: Console
15
+ Classifier: Framework :: AsyncIO
16
+ Classifier: Intended Audience :: Developers
17
+ Classifier: Intended Audience :: System Administrators
18
+ Classifier: Operating System :: OS Independent
19
+ Classifier: Programming Language :: Python :: 3 :: Only
20
+ Classifier: Programming Language :: Python :: 3.10
21
+ Classifier: Programming Language :: Python :: 3.11
22
+ Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Topic :: Communications :: Chat
24
+ Classifier: Topic :: Internet :: WWW/HTTP
25
+ Requires-Python: >=3.10
26
+ Description-Content-Type: text/markdown
27
+ License-File: LICENSE
28
+ Requires-Dist: python-telegram-bot[job-queue]>=22.8
29
+ Requires-Dist: aiohttp>=3.14.3
30
+ Requires-Dist: python-dotenv>=1.2.3
31
+ Requires-Dist: aiosqlite>=0.22.1
32
+ Requires-Dist: psutil>=5.9.8
33
+ Requires-Dist: Pillow>=10.0.0
34
+ Requires-Dist: pyvips>=2.2.0
35
+ Requires-Dist: whoosh>=2.7.4
36
+ Requires-Dist: init-data-py>=1.0.0
37
+ Requires-Dist: telepress>=0.17.2
38
+ Provides-Extra: mcp
39
+ Requires-Dist: mcp<3,>=2.2; extra == "mcp"
40
+ Provides-Extra: dev
41
+ Requires-Dist: Babel>=2.16.0; extra == "dev"
42
+ Requires-Dist: pytest>=7.4.0; extra == "dev"
43
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
44
+ Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
45
+ Requires-Dist: pytest-mock>=3.11.0; extra == "dev"
46
+ Requires-Dist: coverage>=7.3.0; extra == "dev"
47
+ Dynamic: license-file
48
+
49
+ # TelePost
50
+
51
+ **语言 / Language:** 中文 · [English](https://github.com/redtidev1918/TelePost/blob/main/README.en.md)
52
+
53
+ TelePost 是开源、自托管的 Telegram 频道投稿与审核 Bot,支持私聊、Mini App 和 HTTP API 投稿。
54
+ 用户可上传、预览和编辑内容,管理员可在审核群中处理待审稿件并发布到频道。
55
+
56
+ [![Release](https://img.shields.io/github/v/release/redtidev1918/TelePost)](https://github.com/redtidev1918/TelePost/releases/latest) [![PyPI](https://img.shields.io/pypi/v/telepost-bot.svg)](https://pypi.org/project/telepost-bot/) [![Python](https://img.shields.io/badge/python-3.10%2B-blue.svg)](https://www.python.org/) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/redtidev1918/TelePost/blob/main/LICENSE) [![Documentation](https://img.shields.io/badge/docs-redtidev1918.github.io-6366f1)](https://redtidev1918.github.io/TelePost/)
57
+
58
+ [下载](https://github.com/redtidev1918/TelePost/blob/main/docs/download.md) · [安装与部署](https://github.com/redtidev1918/TelePost/blob/main/docs/INSTALL.md) · [完整文档](https://redtidev1918.github.io/TelePost/)
59
+
60
+ ## 主要功能
61
+
62
+ | 功能 | 说明 |
63
+ | --- | --- |
64
+ | 投稿 | 支持图片、视频、GIF、音频、文档和纯文字,提交前可预览、编辑,支持匿名与剧透。 |
65
+ | 审核与发布 | 在独立审核群中预览、修改、批准或拒绝投稿,支持内容遮罩;可选接入 AI Agent 辅助审核。 |
66
+ | Mini App | 可选网页界面:用户可浏览、投稿和查询状态,管理员可处理审核队列。 |
67
+ | 搜索与热榜 | 关键词与标签搜索、热门内容、个人投稿查询和统计。 |
68
+ | 定时发布 | `/schedule add weekly-hot` 等命令按计划发布热榜内容。 |
69
+ | 自动化投稿 | 提供 HTTP API,供脚本和其他程序提交稿件,支持重复请求保护。 |
70
+ | 重启与恢复 | 投稿和审核状态持久保存,服务重启后可继续处理未完成的审核。 |
71
+ | 多 Bot | 通过统一入口在同一台机器运行多个 Bot,各自使用独立的频道、审核群、语言和数据目录。 |
72
+
73
+ ## 如何工作
74
+
75
+ <details>
76
+ <summary>查看 Bot 界面</summary>
77
+
78
+ ![Bot 私聊主菜单](https://raw.githubusercontent.com/redtidev1918/TelePost/main/docs/assets/screenshots/bot-menu.jpg)
79
+
80
+ </details>
81
+
82
+ 用户在 Bot 私聊或 Mini App 上传内容,在预览中确认标签、标题、简介、链接及匿名、剧透设置后提交。
83
+ 是否进入审核由投稿入口决定:
84
+
85
+ | 投稿入口 | 默认行为 |
86
+ | --- | --- |
87
+ | Bot 私聊 | 确认后直接发布;`CHAT_REVIEW_REQUIRED=true` 时先审核 |
88
+ | Mini App | 默认先审核;由 `MINIAPP_REVIEW_REQUIRED` 单独控制 |
89
+ | HTTP API | 固定先提交审核,必须人工批准 |
90
+
91
+ 默认配置需要独立审核群(`REVIEW_CHAT_ID`),且不能与发布频道相同。
92
+ 如需私聊投稿也先审核,设置 `CHAT_REVIEW_REQUIRED=true`;Mini App 的审核行为由
93
+ `MINIAPP_REVIEW_REQUIRED` 单独控制。更多设置见[配置参考](https://github.com/redtidev1918/TelePost/blob/main/docs/CONFIGURATION.md#审核)。
94
+
95
+ ## 下载与安装
96
+
97
+ 需要一台可持续运行且能访问 Telegram 的电脑或服务器。仅使用 Bot 时可选 Polling 模式,无需域名;Mini App 需要 Webhook 模式和公网 HTTPS。
98
+
99
+ 选择一种安装方式:
100
+
101
+ | 方式 | 适用情况 | 入口 |
102
+ | --- | --- | --- |
103
+ | 独立程序 | Windows x64、Linux x64、macOS Apple Silicon;无需安装 Python | [下载最新版程序](https://github.com/redtidev1918/TelePost/releases/latest) |
104
+ | pip | 已有 Python 3.10+ 环境 | `python -m pip install telepost-bot` |
105
+ | Docker / Compose | 服务器或长期部署 | [Docker / Compose 安装](https://github.com/redtidev1918/TelePost/blob/main/docs/INSTALL.md#3-docker--compose) |
106
+
107
+ 独立程序下载后加 `--setup` 运行配置向导;pip 安装后执行 `telepost --setup`。
108
+ 完整安装、升级与备份步骤见[安装指南](https://github.com/redtidev1918/TelePost/blob/main/docs/INSTALL.md)。
109
+
110
+ ## 首次使用
111
+
112
+ 1. **创建 Bot**:在 [@BotFather](https://t.me/BotFather) 创建 Bot 并取得 Token。
113
+ 2. **准备频道和审核群**:将 Bot 设为发布频道的管理员并授予发帖权限,再加入一个
114
+ **独立**的私有审核群,确认 Bot 有发送消息的权限。频道 ID 支持 `@频道用户名` 或
115
+ `-100` 开头的数字 ID;Owner ID 应填写 Bot 所有者的数字 Telegram User ID,不得填写群或频道 ID。
116
+ 3. **补齐配置并启动**:配置向导只收集 Token、频道和 Owner ID,审核群需手动补齐。打开生成的
117
+ `config.ini`,保留已有内容,在 `[BOT]` 节添加审核群 ID(保存为 UTF-8):
118
+
119
+ ```ini
120
+ [BOT]
121
+ REVIEW_CHAT_ID = -1001234567890
122
+ ```
123
+
124
+ 将示例 ID 替换为审核群的实际数字 ID。如需私聊投稿也先审核,在同一 `[BOT]` 节追加
125
+ `CHAT_REVIEW_REQUIRED = true`。Windows 独立程序可双击启动;Linux / macOS 运行对应的
126
+ `./telepost-linux-x64` 或 `./telepost-macos-arm64`;pip 用 `telepost`。
127
+ Docker 用户按安装指南配置环境变量,无需运行向导或编辑 `config.ini`。
128
+ 4. **发起第一次投稿**:私聊 Bot 发送 `/start`,点击「📝 开始投稿」或发送 `/submit`;
129
+ 上传图片、视频、GIF、音频或文件,完成后发送 `/done_media` 进入预览;纯文字投稿用
130
+ `/skip_media` 跳过上传。在预览中填写标签和文字内容,确认后点击「✅ 确认发布」
131
+ (开启聊天审核后为「✅ 提交审核」)。发送 `/cancel` 可取消当前投稿。
132
+
133
+ 全部命令见[命令参考](https://github.com/redtidev1918/TelePost/blob/main/docs/COMMANDS.md)。
134
+
135
+ ## 可选功能
136
+
137
+ - [Mini App](https://github.com/redtidev1918/TelePost/blob/main/docs/MINIAPP.md):在 Telegram 内完成网页投稿、进度查询和审核;需配置 HTTPS 地址及登录密钥。
138
+ - [HTTP API](https://github.com/redtidev1918/TelePost/blob/main/docs/API.md):供脚本和其他程序投稿,支持幂等提交,避免重试产生重复稿件。
139
+ - [AI 辅助审核(MCP)](https://github.com/redtidev1918/TelePost/blob/main/docs/MCP_REVIEW.md):通过 MCP 连接外部 AI Agent 查看稿件、提供建议。建议使用只读模式;开启写入权限后,程序不强制要求额外的人工确认。
140
+ - [在线阅读](https://github.com/redtidev1918/TelePost/blob/main/docs/CONFIGURATION.md):可选启用 TelePress,为 TXT 小说生成 Telegraph 阅读页。
141
+
142
+ ## 文档
143
+
144
+ 完整文档站:<https://redtidev1918.github.io/TelePost/>
145
+
146
+ - 安装、升级与卸载:[安装与部署](https://github.com/redtidev1918/TelePost/blob/main/docs/INSTALL.md)
147
+ - 配置项、审核默认值与多 Bot:[配置参考](https://github.com/redtidev1918/TelePost/blob/main/docs/CONFIGURATION.md)
148
+ - 投稿、审核及管理命令:[命令参考](https://github.com/redtidev1918/TelePost/blob/main/docs/COMMANDS.md)
149
+ - 网页投稿与审核界面:[Telegram Mini App](https://github.com/redtidev1918/TelePost/blob/main/docs/MINIAPP.md)
150
+ - 脚本与自动化投稿:[HTTP API](https://github.com/redtidev1918/TelePost/blob/main/docs/API.md)
151
+ - 常见运行问题:[故障排查](https://github.com/redtidev1918/TelePost/blob/main/docs/TROUBLESHOOTING.md)
152
+ - 本地开发、测试与贡献:[贡献指南](https://github.com/redtidev1918/TelePost/blob/main/CONTRIBUTING.md)
153
+
154
+ Webhook 部署、Fly.io、运维手册与性能容量等文档见[文档站](https://redtidev1918.github.io/TelePost/)。
155
+
156
+ ## 相关项目
157
+
158
+ - [PixivFlow](https://github.com/redtidev1918/PixivFlow):按条件检索和收集 Pixiv 作品,提交至 TelePost 审核发布。
159
+ - [TelePress](https://github.com/redtidev1918/TelePress):为 TXT 小说生成在线阅读页面;库随 TelePost 一并安装,启用在线阅读需另行配置。
160
+ - [pixivflow-telepost-deploy](https://github.com/redtidev1918/pixivflow-telepost-deploy):在独立服务中部署 PixivFlow 与 TelePost 的指南和工具。
161
+
162
+ TelePost 可以独立使用,无需部署 PixivFlow 或整套生态。
163
+
164
+ ## 许可证
165
+
166
+ [MIT License](https://github.com/redtidev1918/TelePost/blob/main/LICENSE)
@@ -0,0 +1,130 @@
1
+ # TelePost
2
+
3
+ **Language / 语言:** [中文](https://github.com/redtidev1918/TelePost/blob/main/README.md) · English
4
+
5
+ TelePost is an open-source, self-hosted submission and moderation bot for Telegram channels.
6
+ It accepts submissions through private chat, a Mini App and an HTTP API. Users can upload, preview
7
+ and edit content; administrators can review pending submissions and publish them to a channel.
8
+
9
+ [![Release](https://img.shields.io/github/v/release/redtidev1918/TelePost)](https://github.com/redtidev1918/TelePost/releases/latest) [![PyPI](https://img.shields.io/pypi/v/telepost-bot.svg)](https://pypi.org/project/telepost-bot/) [![Python](https://img.shields.io/badge/python-3.10%2B-blue.svg)](https://www.python.org/) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/redtidev1918/TelePost/blob/main/LICENSE) [![Documentation](https://img.shields.io/badge/docs-redtidev1918.github.io-6366f1)](https://redtidev1918.github.io/TelePost/#/en/)
10
+
11
+ [Download](https://github.com/redtidev1918/TelePost/blob/main/docs/en/download.md) · [Install and deploy](https://github.com/redtidev1918/TelePost/blob/main/docs/en/INSTALL.md) · [Documentation](https://redtidev1918.github.io/TelePost/#/en/)
12
+
13
+ ## What it does
14
+
15
+ | Feature | Description |
16
+ | --- | --- |
17
+ | Submissions | Photos, videos, GIFs, audio, documents and plain text; preview and edit before submitting, with anonymous and spoiler modes. |
18
+ | Review and publishing | Preview, revise, approve or reject submissions in a separate review group, with content masking; optionally connect an AI agent for review suggestions. |
19
+ | Mini App | Optional web interface: users browse, submit and track their work; admins handle the review queue. |
20
+ | Search and rankings | Keyword and tag search, popular content, personal submission history and statistics. |
21
+ | Scheduled posts | Commands such as `/schedule add weekly-hot` publish rankings on a schedule. |
22
+ | Automated submissions | An HTTP API for scripts and other programs, with protection against duplicate submissions on retries. |
23
+ | Restart and recovery | Submission and review state is persisted; pending reviews continue after a restart. |
24
+ | Multiple bots | Run several bots on one machine through a single entry point, each with its own channel, review group, language and data directory. |
25
+
26
+ ## How it works
27
+
28
+ <details>
29
+ <summary>View the bot interface</summary>
30
+
31
+ ![Bot private-chat main menu](https://raw.githubusercontent.com/redtidev1918/TelePost/main/docs/assets/screenshots/bot-menu.jpg)
32
+
33
+ </details>
34
+
35
+ A reader uploads content in the bot's private chat or the Mini App, then confirms tags, title, note,
36
+ link and the anonymous and spoiler settings in the preview before submitting. Whether it goes
37
+ through review depends on the entry point:
38
+
39
+ | Entry point | Default |
40
+ | --- | --- |
41
+ | Bot private chat | Published after the reader confirms; `CHAT_REVIEW_REQUIRED=true` requires review |
42
+ | Mini App | Review by default; controlled separately by `MINIAPP_REVIEW_REQUIRED` |
43
+ | HTTP API | Always submitted for review; a human must approve |
44
+
45
+ The default setup requires a review group (`REVIEW_CHAT_ID`) separate from the publishing channel.
46
+ To review private-chat submissions too, set `CHAT_REVIEW_REQUIRED=true`; the Mini App is controlled
47
+ separately by `MINIAPP_REVIEW_REQUIRED`. More settings are in
48
+ [Configuration](https://github.com/redtidev1918/TelePost/blob/main/docs/en/CONFIGURATION.md#review).
49
+
50
+ ## Download and install
51
+
52
+ Use a computer or server that can remain running and access Telegram. Bot-only use supports Polling without a domain. The Mini App requires Webhook mode and public HTTPS.
53
+
54
+ Choose one installation method:
55
+
56
+ | Method | Suitable for | Getting started |
57
+ | --- | --- | --- |
58
+ | Standalone program | Windows x64, Linux x64, macOS Apple Silicon; no Python needed | [Download the latest build](https://github.com/redtidev1918/TelePost/releases/latest) |
59
+ | pip | Python 3.10+ already installed | `python -m pip install telepost-bot` |
60
+ | Docker / Compose | Servers and long-running deployments | [Docker / Compose installation](https://github.com/redtidev1918/TelePost/blob/main/docs/en/INSTALL.md#3-docker--compose) |
61
+
62
+ Run the standalone program with `--setup` to open the configuration wizard. For pip, run `telepost --setup`.
63
+ See the [Installation guide](https://github.com/redtidev1918/TelePost/blob/main/docs/en/INSTALL.md) for full setup, upgrade and backup instructions.
64
+
65
+ ## First run
66
+
67
+ 1. **Create the bot**: Create it with [@BotFather](https://t.me/BotFather) and keep the token.
68
+ 2. **Prepare the channel and review group**: Add the bot to the publishing channel as an
69
+ administrator with permission to post, then add it to a **separate** private review group and
70
+ check that it can send messages there. The channel ID is either `@username` or a numeric ID
71
+ starting with `-100`; the owner ID is your own numeric Telegram user ID, not a group or channel
72
+ ID.
73
+ 3. **Complete the configuration and start**: The setup wizard collects only the token, the channel
74
+ and the owner ID; the review group is added by hand. Open the generated `config.ini`, keep what
75
+ is there, and add the review group under `[BOT]` (save the file as UTF-8):
76
+
77
+ ```ini
78
+ [BOT]
79
+ LANGUAGE = en
80
+ REVIEW_CHAT_ID = -1001234567890
81
+ ```
82
+
83
+ Replace the example ID with your review group's numeric ID. To review private-chat submissions
84
+ too, add `CHAT_REVIEW_REQUIRED = true` under the same `[BOT]` section. Start commands:
85
+ double-click the Windows standalone program, or run `./telepost-linux-x64` /
86
+ `./telepost-macos-arm64` on Linux / macOS; `telepost` for pip. Docker users configure
87
+ environment variables as described in the installation guide; no wizard or `config.ini` is required.
88
+ 4. **Make a first submission**: Send `/start` to the bot, tap **📝 New submission** or send
89
+ `/submit`, then upload photos, videos, GIFs, audio or files and send `/done_media` when done to
90
+ reach the preview; for a text-only submission, `/skip_media` skips the upload. Fill in tags and
91
+ text, adjust what you need, and tap **✅ Publish** (the button reads **✅ Submit for review**
92
+ when chat review is on). Send `/cancel` at any point to cancel.
93
+
94
+ All commands: [Command reference](https://github.com/redtidev1918/TelePost/blob/main/docs/en/COMMANDS.md).
95
+
96
+ ## Optional features
97
+
98
+ - [Mini App](https://github.com/redtidev1918/TelePost/blob/main/docs/MINIAPP.md) (Chinese): submit, track and review content inside Telegram. Requires an HTTPS address and a session secret.
99
+ - [HTTP API](https://github.com/redtidev1918/TelePost/blob/main/docs/en/API.md): accept submissions from scripts and services, with idempotent submissions to prevent duplicates on retries.
100
+ - [AI-assisted review (MCP)](https://github.com/redtidev1918/TelePost/blob/main/docs/MCP_REVIEW.md) (Chinese): connect an external AI agent through MCP to inspect submissions and suggest decisions. Read-only mode is recommended; with write access enabled, the program does not enforce additional human confirmation.
101
+ - [Online reading](https://github.com/redtidev1918/TelePost/blob/main/docs/en/CONFIGURATION.md): optionally enable TelePress to generate Telegraph reading pages for TXT novels.
102
+
103
+ ## Documentation
104
+
105
+ Documentation site: <https://redtidev1918.github.io/TelePost/#/en/>
106
+
107
+ - Install, upgrade, remove: [Install and deploy](https://github.com/redtidev1918/TelePost/blob/main/docs/en/INSTALL.md)
108
+ - Settings, review defaults, multiple bots: [Configuration](https://github.com/redtidev1918/TelePost/blob/main/docs/en/CONFIGURATION.md)
109
+ - Commands and required permissions: [Command reference](https://github.com/redtidev1918/TelePost/blob/main/docs/en/COMMANDS.md)
110
+ - Web submission and review UI: [Telegram Mini App](https://github.com/redtidev1918/TelePost/blob/main/docs/MINIAPP.md) (Chinese)
111
+ - Scripts and automated submissions: [HTTP API](https://github.com/redtidev1918/TelePost/blob/main/docs/en/API.md)
112
+ - Common runtime problems: [Troubleshooting](https://github.com/redtidev1918/TelePost/blob/main/docs/TROUBLESHOOTING.md) (Chinese)
113
+ - Local development, testing and contributing: [Contributing](https://github.com/redtidev1918/TelePost/blob/main/CONTRIBUTING.md) (Chinese)
114
+
115
+ Webhook deployment, Fly.io, operations and performance guides are on the
116
+ [documentation site](https://redtidev1918.github.io/TelePost/#/en/).
117
+
118
+ ## Related projects
119
+
120
+ - [PixivFlow](https://github.com/redtidev1918/PixivFlow): find and collect Pixiv works matching your
121
+ filters, then send them to TelePost for review and publishing.
122
+ - [TelePress](https://github.com/redtidev1918/TelePress): generate online reading pages for TXT novels; the library ships with TelePost, and online reading must be enabled separately.
123
+ - [pixivflow-telepost-deploy](https://github.com/redtidev1918/pixivflow-telepost-deploy): guides and
124
+ tools for deploying PixivFlow and TelePost as separate services.
125
+
126
+ TelePost works independently; deploying PixivFlow or the full ecosystem is optional.
127
+
128
+ ## License
129
+
130
+ [MIT License](https://github.com/redtidev1918/TelePost/blob/main/LICENSE)
@@ -0,0 +1,118 @@
1
+ # TelePost
2
+
3
+ **语言 / Language:** 中文 · [English](https://github.com/redtidev1918/TelePost/blob/main/README.en.md)
4
+
5
+ TelePost 是开源、自托管的 Telegram 频道投稿与审核 Bot,支持私聊、Mini App 和 HTTP API 投稿。
6
+ 用户可上传、预览和编辑内容,管理员可在审核群中处理待审稿件并发布到频道。
7
+
8
+ [![Release](https://img.shields.io/github/v/release/redtidev1918/TelePost)](https://github.com/redtidev1918/TelePost/releases/latest) [![PyPI](https://img.shields.io/pypi/v/telepost-bot.svg)](https://pypi.org/project/telepost-bot/) [![Python](https://img.shields.io/badge/python-3.10%2B-blue.svg)](https://www.python.org/) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/redtidev1918/TelePost/blob/main/LICENSE) [![Documentation](https://img.shields.io/badge/docs-redtidev1918.github.io-6366f1)](https://redtidev1918.github.io/TelePost/)
9
+
10
+ [下载](https://github.com/redtidev1918/TelePost/blob/main/docs/download.md) · [安装与部署](https://github.com/redtidev1918/TelePost/blob/main/docs/INSTALL.md) · [完整文档](https://redtidev1918.github.io/TelePost/)
11
+
12
+ ## 主要功能
13
+
14
+ | 功能 | 说明 |
15
+ | --- | --- |
16
+ | 投稿 | 支持图片、视频、GIF、音频、文档和纯文字,提交前可预览、编辑,支持匿名与剧透。 |
17
+ | 审核与发布 | 在独立审核群中预览、修改、批准或拒绝投稿,支持内容遮罩;可选接入 AI Agent 辅助审核。 |
18
+ | Mini App | 可选网页界面:用户可浏览、投稿和查询状态,管理员可处理审核队列。 |
19
+ | 搜索与热榜 | 关键词与标签搜索、热门内容、个人投稿查询和统计。 |
20
+ | 定时发布 | `/schedule add weekly-hot` 等命令按计划发布热榜内容。 |
21
+ | 自动化投稿 | 提供 HTTP API,供脚本和其他程序提交稿件,支持重复请求保护。 |
22
+ | 重启与恢复 | 投稿和审核状态持久保存,服务重启后可继续处理未完成的审核。 |
23
+ | 多 Bot | 通过统一入口在同一台机器运行多个 Bot,各自使用独立的频道、审核群、语言和数据目录。 |
24
+
25
+ ## 如何工作
26
+
27
+ <details>
28
+ <summary>查看 Bot 界面</summary>
29
+
30
+ ![Bot 私聊主菜单](https://raw.githubusercontent.com/redtidev1918/TelePost/main/docs/assets/screenshots/bot-menu.jpg)
31
+
32
+ </details>
33
+
34
+ 用户在 Bot 私聊或 Mini App 上传内容,在预览中确认标签、标题、简介、链接及匿名、剧透设置后提交。
35
+ 是否进入审核由投稿入口决定:
36
+
37
+ | 投稿入口 | 默认行为 |
38
+ | --- | --- |
39
+ | Bot 私聊 | 确认后直接发布;`CHAT_REVIEW_REQUIRED=true` 时先审核 |
40
+ | Mini App | 默认先审核;由 `MINIAPP_REVIEW_REQUIRED` 单独控制 |
41
+ | HTTP API | 固定先提交审核,必须人工批准 |
42
+
43
+ 默认配置需要独立审核群(`REVIEW_CHAT_ID`),且不能与发布频道相同。
44
+ 如需私聊投稿也先审核,设置 `CHAT_REVIEW_REQUIRED=true`;Mini App 的审核行为由
45
+ `MINIAPP_REVIEW_REQUIRED` 单独控制。更多设置见[配置参考](https://github.com/redtidev1918/TelePost/blob/main/docs/CONFIGURATION.md#审核)。
46
+
47
+ ## 下载与安装
48
+
49
+ 需要一台可持续运行且能访问 Telegram 的电脑或服务器。仅使用 Bot 时可选 Polling 模式,无需域名;Mini App 需要 Webhook 模式和公网 HTTPS。
50
+
51
+ 选择一种安装方式:
52
+
53
+ | 方式 | 适用情况 | 入口 |
54
+ | --- | --- | --- |
55
+ | 独立程序 | Windows x64、Linux x64、macOS Apple Silicon;无需安装 Python | [下载最新版程序](https://github.com/redtidev1918/TelePost/releases/latest) |
56
+ | pip | 已有 Python 3.10+ 环境 | `python -m pip install telepost-bot` |
57
+ | Docker / Compose | 服务器或长期部署 | [Docker / Compose 安装](https://github.com/redtidev1918/TelePost/blob/main/docs/INSTALL.md#3-docker--compose) |
58
+
59
+ 独立程序下载后加 `--setup` 运行配置向导;pip 安装后执行 `telepost --setup`。
60
+ 完整安装、升级与备份步骤见[安装指南](https://github.com/redtidev1918/TelePost/blob/main/docs/INSTALL.md)。
61
+
62
+ ## 首次使用
63
+
64
+ 1. **创建 Bot**:在 [@BotFather](https://t.me/BotFather) 创建 Bot 并取得 Token。
65
+ 2. **准备频道和审核群**:将 Bot 设为发布频道的管理员并授予发帖权限,再加入一个
66
+ **独立**的私有审核群,确认 Bot 有发送消息的权限。频道 ID 支持 `@频道用户名` 或
67
+ `-100` 开头的数字 ID;Owner ID 应填写 Bot 所有者的数字 Telegram User ID,不得填写群或频道 ID。
68
+ 3. **补齐配置并启动**:配置向导只收集 Token、频道和 Owner ID,审核群需手动补齐。打开生成的
69
+ `config.ini`,保留已有内容,在 `[BOT]` 节添加审核群 ID(保存为 UTF-8):
70
+
71
+ ```ini
72
+ [BOT]
73
+ REVIEW_CHAT_ID = -1001234567890
74
+ ```
75
+
76
+ 将示例 ID 替换为审核群的实际数字 ID。如需私聊投稿也先审核,在同一 `[BOT]` 节追加
77
+ `CHAT_REVIEW_REQUIRED = true`。Windows 独立程序可双击启动;Linux / macOS 运行对应的
78
+ `./telepost-linux-x64` 或 `./telepost-macos-arm64`;pip 用 `telepost`。
79
+ Docker 用户按安装指南配置环境变量,无需运行向导或编辑 `config.ini`。
80
+ 4. **发起第一次投稿**:私聊 Bot 发送 `/start`,点击「📝 开始投稿」或发送 `/submit`;
81
+ 上传图片、视频、GIF、音频或文件,完成后发送 `/done_media` 进入预览;纯文字投稿用
82
+ `/skip_media` 跳过上传。在预览中填写标签和文字内容,确认后点击「✅ 确认发布」
83
+ (开启聊天审核后为「✅ 提交审核」)。发送 `/cancel` 可取消当前投稿。
84
+
85
+ 全部命令见[命令参考](https://github.com/redtidev1918/TelePost/blob/main/docs/COMMANDS.md)。
86
+
87
+ ## 可选功能
88
+
89
+ - [Mini App](https://github.com/redtidev1918/TelePost/blob/main/docs/MINIAPP.md):在 Telegram 内完成网页投稿、进度查询和审核;需配置 HTTPS 地址及登录密钥。
90
+ - [HTTP API](https://github.com/redtidev1918/TelePost/blob/main/docs/API.md):供脚本和其他程序投稿,支持幂等提交,避免重试产生重复稿件。
91
+ - [AI 辅助审核(MCP)](https://github.com/redtidev1918/TelePost/blob/main/docs/MCP_REVIEW.md):通过 MCP 连接外部 AI Agent 查看稿件、提供建议。建议使用只读模式;开启写入权限后,程序不强制要求额外的人工确认。
92
+ - [在线阅读](https://github.com/redtidev1918/TelePost/blob/main/docs/CONFIGURATION.md):可选启用 TelePress,为 TXT 小说生成 Telegraph 阅读页。
93
+
94
+ ## 文档
95
+
96
+ 完整文档站:<https://redtidev1918.github.io/TelePost/>
97
+
98
+ - 安装、升级与卸载:[安装与部署](https://github.com/redtidev1918/TelePost/blob/main/docs/INSTALL.md)
99
+ - 配置项、审核默认值与多 Bot:[配置参考](https://github.com/redtidev1918/TelePost/blob/main/docs/CONFIGURATION.md)
100
+ - 投稿、审核及管理命令:[命令参考](https://github.com/redtidev1918/TelePost/blob/main/docs/COMMANDS.md)
101
+ - 网页投稿与审核界面:[Telegram Mini App](https://github.com/redtidev1918/TelePost/blob/main/docs/MINIAPP.md)
102
+ - 脚本与自动化投稿:[HTTP API](https://github.com/redtidev1918/TelePost/blob/main/docs/API.md)
103
+ - 常见运行问题:[故障排查](https://github.com/redtidev1918/TelePost/blob/main/docs/TROUBLESHOOTING.md)
104
+ - 本地开发、测试与贡献:[贡献指南](https://github.com/redtidev1918/TelePost/blob/main/CONTRIBUTING.md)
105
+
106
+ Webhook 部署、Fly.io、运维手册与性能容量等文档见[文档站](https://redtidev1918.github.io/TelePost/)。
107
+
108
+ ## 相关项目
109
+
110
+ - [PixivFlow](https://github.com/redtidev1918/PixivFlow):按条件检索和收集 Pixiv 作品,提交至 TelePost 审核发布。
111
+ - [TelePress](https://github.com/redtidev1918/TelePress):为 TXT 小说生成在线阅读页面;库随 TelePost 一并安装,启用在线阅读需另行配置。
112
+ - [pixivflow-telepost-deploy](https://github.com/redtidev1918/pixivflow-telepost-deploy):在独立服务中部署 PixivFlow 与 TelePost 的指南和工具。
113
+
114
+ TelePost 可以独立使用,无需部署 PixivFlow 或整套生态。
115
+
116
+ ## 许可证
117
+
118
+ [MIT License](https://github.com/redtidev1918/TelePost/blob/main/LICENSE)
@@ -869,7 +869,7 @@ class ReviewService:
869
869
  if isinstance(error, DiscussionPublishError):
870
870
  if getattr(error, "uncertain", False):
871
871
  return (
872
- tr('评论区发布结果不确定:请到频道确认首贴、到该帖评论串确认图片是否齐;确认缺图后再点重试(重试只补发,重复请手动删多余相册)')
872
+ tr('发布结果不确定,已阻止自动重发;请管理员核验频道与发布账本后恢复。')
873
873
  )
874
874
  return tr('发布失败,已自动重试一次仍未成功,可再点重试')
875
875
  if isinstance(error, NetworkError):
@@ -8,7 +8,7 @@ to the entry points; when present it overrides these committed defaults.
8
8
  # Bumped automatically by release-please (extra-files in
9
9
  # release-please-config.json). Release bundles and images override it at build
10
10
  # time with the exact version/commit; this constant is the local-dev fallback.
11
- RELEASE_VERSION = "2.84.2" # x-release-please-version
11
+ RELEASE_VERSION = "2.84.3" # x-release-please-version
12
12
  RELEASE_COMMIT = "dev"
13
13
  BUILD_DATE = "dev"
14
14
  SERVICE = "telepost"
@@ -11,9 +11,9 @@ Workflow (previously embedded in ``handlers/publish._deliver_discussion``):
11
11
  exist; never blindly retry a request whose response was lost (that could
12
12
  duplicate an album Telegram actually accepted).
13
13
 
14
- Determinate failures are rolled back and retried exactly once. An
15
- *uncertain* failure (response lost after the comment album was sent) rolls
16
- back whatever is known and stops: a human must verify the channel/discussion.
14
+ Determinate root failures with no confirmed progress are retried once.
15
+ An uncertain root stops without deletion or resend and preserves checkpoints
16
+ for the publication ledger. Confirmed roots survive discussion failures.
17
17
  """
18
18
  from __future__ import annotations
19
19
 
@@ -47,9 +47,10 @@ class DiscussionDeliveryError(RuntimeError):
47
47
  """
48
48
 
49
49
  def __init__(self, message: str, *, uncertain: bool = False,
50
- sent: Optional[dict] = None):
50
+ sent: Optional[dict] = None, known_messages=None):
51
51
  super().__init__(message)
52
52
  self.uncertain = uncertain
53
+ self.known_messages = list(known_messages or [])
53
54
  self.sent = sent if sent is not None else {"cover": [], "anchor": [], "rest": []}
54
55
 
55
56
 
@@ -161,18 +162,22 @@ class DiscussionStrategy:
161
162
  )
162
163
  )
163
164
  if cover_result.is_uncertain:
164
- found = await self._scan(int(request.chat_id))
165
- if found is not None:
166
- cover_id, dchat, dmsg = found
167
- sent["cover"] = [(int(request.chat_id), cover_id)]
168
- sent["anchor"] = [(dchat, dmsg)]
169
- raise DiscussionDeliveryError(
170
- "频道首贴发送响应丢失,已反查到帖子并回滚", sent=sent
171
- )
165
+ # A recent forward from this channel is not evidence for this
166
+ # publication. Preserve uncertainty and confirmed checkpoints;
167
+ # never delete or resend based on a channel-only cache match.
168
+ logger.warning("Channel root delivery uncertain: channel=%s reason=%s error_type=%s",
169
+ request.chat_id, cover_result.reason,
170
+ type(cover_result.error).__name__)
172
171
  raise DiscussionDeliveryError(
173
- "频道首贴发送响应丢失,未在讨论区发现转发,重发一次", sent=sent
174
- )
172
+ "频道首贴发送结果不确定,未自动重发或回滚;请先核验频道",
173
+ uncertain=True, known_messages=cover_result.known_messages,
174
+ ) from (cover_result.error if isinstance(cover_result.error, BaseException) else None)
175
175
  if not cover_result.ok:
176
+ if cover_result.known_messages:
177
+ raise DiscussionDeliveryError(
178
+ f"频道首贴部分送达,需核验后恢复:{cover_result.reason}",
179
+ uncertain=True, known_messages=cover_result.known_messages,
180
+ )
176
181
  raise DiscussionDeliveryError(
177
182
  f"频道首贴发送失败:{cover_result.reason}", sent=sent
178
183
  )
@@ -316,7 +321,6 @@ class DiscussionStrategy:
316
321
  except DiscussionDeliveryError as exc:
317
322
  last = exc
318
323
  if exc.uncertain:
319
- await self._do_rollback(exc.sent)
320
324
  raise
321
325
  if not await self._do_rollback(exc.sent):
322
326
  raise DiscussionDeliveryError(
@@ -104,4 +104,10 @@ class PTBTelegramDeliveryGateway:
104
104
  strategy = self._discussion or discussion_mod.DiscussionStrategy(
105
105
  self, self._bot
106
106
  )
107
- return await strategy.deliver(request)
107
+ try:
108
+ return await strategy.deliver(request)
109
+ except discussion_mod.DiscussionDeliveryError as exc:
110
+ factory = DeliveryResult.uncertain if exc.uncertain else DeliveryResult.failed
111
+ result = factory(str(exc), known_messages=exc.known_messages)
112
+ result.error = exc
113
+ return result
@@ -1,10 +1,8 @@
1
1
  """In-memory registry of channel→discussion automatic forwards.
2
2
 
3
3
  ``capture_discussion_forward`` is fed every Telegram update by the channel
4
- listener. When the channel cover post is sent but the HTTP response is lost,
5
- the delivery strategy scans this bounded registry to discover whether Telegram
6
- actually accepted the post (and auto-forwarded it to the linked discussion),
7
- which makes a safe rollback + retry possible.
4
+ listener. It correlates a confirmed channel message ID to its discussion
5
+ anchor. It cannot identify a publication whose send response was lost.
8
6
 
9
7
  Deliberately a bounded process-local structure: at most ~200 entries / 60 s of
10
8
  history, matching the uncertainty window. No external cache is introduced.
@@ -90,18 +88,22 @@ class ForwardRegistry:
90
88
  self._waiters.pop(key, None)
91
89
 
92
90
  async def scan_recent(self, channel_id: int, *,
91
+ message_id: Optional[int] = None,
93
92
  deadline_seconds: float = 6.0,
94
93
  interval: float = 1.0) -> Optional[Tuple[int, int, int]]:
95
- """Poll recent forwards after a cover-post response loss.
94
+ """Look up an already-confirmed channel message, never guess its ID.
96
95
 
97
- Returns ``(source_message_id, discussion_chat_id, discussion_message_id)``
98
- for the newest forward from this channel, or ``None`` on timeout.
96
+ Missing message identity cannot establish publication success. The
97
+ returned forward is only a discussion anchor, not delivery evidence.
99
98
  """
99
+ if message_id is None:
100
+ return None
100
101
  deadline = self._now() + deadline_seconds
101
102
  while self._now() < deadline:
103
+ self._prune()
102
104
  for i in range(len(self._recent) - 1, -1, -1):
103
105
  cid, mid, dchat, dmsg, _t = self._recent[i]
104
- if cid == channel_id:
106
+ if cid == channel_id and mid == message_id:
105
107
  self._recent.pop(i)
106
108
  return mid, dchat, dmsg
107
109
  await asyncio.sleep(interval)
@@ -204,7 +204,7 @@ class PTBSender:
204
204
  async def send_album(self, batch: Batch, *, reply_to: Optional[int],
205
205
  caption: Optional[str],
206
206
  reply_markup: Optional[object] = None) -> List[DeliveredMessage]:
207
- from telegram.error import NetworkError
207
+ from telegram.error import BadRequest, NetworkError
208
208
 
209
209
  media_group = [
210
210
  self._input_media(item, caption if i == 0 else None)
@@ -219,6 +219,10 @@ class PTBSender:
219
219
  try:
220
220
  try:
221
221
  messages = await self._bot.send_media_group(**kwargs)
222
+ except BadRequest:
223
+ # PTB BadRequest subclasses NetworkError, but is an explicit
224
+ # Telegram rejection, not a lost response.
225
+ raise
222
226
  except NetworkError as exc:
223
227
  raise NetworkFailure(str(exc), original=exc) from exc
224
228
  finally:
@@ -235,7 +239,7 @@ class PTBSender:
235
239
  async def send_single(self, item: MediaItem, *, reply_to: Optional[int],
236
240
  caption: Optional[str],
237
241
  reply_markup: Optional[object] = None) -> DeliveredMessage:
238
- from telegram.error import NetworkError
242
+ from telegram.error import BadRequest, NetworkError
239
243
 
240
244
  kw = self._single_kwargs(item, caption, reply_markup)
241
245
  method_name = kw.pop("method")
@@ -248,6 +252,8 @@ class PTBSender:
248
252
  **self._timeouts,
249
253
  **kw,
250
254
  )
255
+ except BadRequest:
256
+ raise
251
257
  except NetworkError as exc:
252
258
  raise NetworkFailure(str(exc), original=exc) from exc
253
259
  finally: