diff --git a/common.py b/common.py index 95f7d5b..2c3a515 100644 --- a/common.py +++ b/common.py @@ -17,7 +17,7 @@ if WEBHOOK: x_url_regex = re.compile(r"^(?:https?://)(?:www\.|mobile\.|)(?:x|twitter)\.com/(.+)/status/(\d+)") x_media_regex = re.compile(r"^(?:https?://)(pbs|video)\.twimg\.com/(.*)") x_tco_regex = re.compile(r"(?:https?://)t\.co/.+$", re.M) -message_url_regex = re.compile(r"\{.+\}", re.S) +message_url_regex = re.compile(r"\[.+]", re.S) logging.basicConfig( level=os.getenv("LOG_LEVEL", "WARNING"), diff --git a/main.py b/main.py index 5cb9174..db37063 100644 --- a/main.py +++ b/main.py @@ -57,7 +57,7 @@ async def url_media(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None: if context.user_data.get('edit_before_forward', False): message_reply = await update.effective_message.reply_text( "Reply to edit message.", - reply_markup=ForceReply(selective=True, input_field_placeholder="{URL}"), + reply_markup=ForceReply(selective=True, input_field_placeholder="[URL]"), reply_to_message_id=update.message.message_id, ) context.user_data['message_reply'] = message_reply @@ -96,7 +96,7 @@ async def edit_message(update: Update, context: ContextTypes.DEFAULT_TYPE) -> No ) + update_text[match[1]:] message_to_send = context.user_data['message_to_send'] await message_to_send[0].edit_caption(update_text) - await context.user_data['message_reply'].edit_message_reply_markup( + await context.user_data['message_reply'].edit_reply_markup( InlineKeyboardMarkup.from_button( InlineKeyboardButton("↩️ Confirm", callback_data="forward") )