Compare commits

..
2 Commits
Author SHA1 Message Date
YoursFunny 081ee595b1 remove edit reply 2024-03-24 22:54:23 +08:00
YoursFunny 4272454f9a fix url match 2024-03-24 22:33:36 +08:00
+2 -3
View File
@@ -85,8 +85,9 @@ async def edit_message(update: Update, context: ContextTypes.DEFAULT_TYPE) -> No
if update.message.reply_to_message != context.user_data['message_reply']:
return
update_text = update.message.text
match = common.message_url_regex.search(update_text).span()
match = common.message_url_regex.search(update_text)
if match:
match = match.span()
update_text = update_text[:match[0]] + '<a href="{0}">{1}</a>'.format(
context.user_data['message_url'], update_text[match[0] + 1:match[1] - 1]
) + update_text[match[1]:]
@@ -104,8 +105,6 @@ async def query_forward_message(update: Update, context: ContextTypes.DEFAULT_TY
await forward_message(update, context, message_to_send)
await update.callback_query.answer('✅ Forwarded')
await update.callback_query.edit_message_reply_markup()
message_reply: Message = context.user_data['message_reply']
await message_reply.edit_text("Message forwarded.")
del context.user_data['message_reply']
del context.user_data['message_to_send']
del context.user_data['message_url']