fix: ouen messages in topics sent to the general topic

This commit is contained in:
Rongrong 2025-03-16 21:13:14 +08:00
parent a66d9c3f67
commit 176bcf5aaf
No known key found for this signature in database
GPG Key ID: 1C2D45D45AB7FE94

View File

@ -313,14 +313,17 @@ def reply(update: telegram.Update, ctx: telegram.ext.CallbackContext):
@log
def repeat(update: telegram.Update, ctx: telegram.ext.CallbackContext, logger: _logger):
def repeat(update: telegram.Update, _ctx: telegram.ext.CallbackContext, logger: _logger):
chat = update.effective_chat
msg = update.effective_message
if chat.id < 0:
chat = ctx.bot.get_chat(chat.id)
tid = msg.message_thread_id
logger.info(msg.text)
msg.copy(chat.id) if chat.has_protected_content else msg.forward(chat.id)
(
msg.copy
if msg.has_protected_content
else msg.forward
)(chat.id, message_thread_id=tid)
@log