mirror of
https://github.com/TheFunny/TelegramTwitterMediaBot.git
synced 2026-09-23 23:32:05 +00:00
fix multiple line substitution
This commit is contained in:
@@ -17,7 +17,7 @@ if WEBHOOK:
|
|||||||
x_url_regex = re.compile(r"^(?:https?://)(?:www\.|mobile\.|)(?:x|twitter)\.com/(.+)/status/(\d+)")
|
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_media_regex = re.compile(r"^(?:https?://)(pbs|video)\.twimg\.com/(.*)")
|
||||||
x_tco_regex = re.compile(r"(?:https?://)t\.co/.+$", re.M)
|
x_tco_regex = re.compile(r"(?:https?://)t\.co/.+$", re.M)
|
||||||
message_url_regex = re.compile(r"\{\w+\}", re.M)
|
message_url_regex = re.compile(r"\{.+\}", re.S)
|
||||||
|
|
||||||
logging.basicConfig(
|
logging.basicConfig(
|
||||||
level=os.getenv("LOG_LEVEL", "WARNING"),
|
level=os.getenv("LOG_LEVEL", "WARNING"),
|
||||||
|
|||||||
@@ -56,7 +56,8 @@ async def url_media(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:
|
|||||||
if context.user_data.get('edit_before_forward', False):
|
if context.user_data.get('edit_before_forward', False):
|
||||||
message_reply = await update.effective_message.reply_text(
|
message_reply = await update.effective_message.reply_text(
|
||||||
"Reply to edit message.",
|
"Reply to edit message.",
|
||||||
reply_markup=ForceReply(selective=True, input_field_placeholder="{}"),
|
reply_markup=ForceReply(selective=True, input_field_placeholder="{URL}"),
|
||||||
|
reply_to_message_id=update.message.message_id,
|
||||||
)
|
)
|
||||||
context.user_data['message_reply'] = message_reply
|
context.user_data['message_reply'] = message_reply
|
||||||
context.user_data['message_to_send'] = message_to_send
|
context.user_data['message_to_send'] = message_to_send
|
||||||
@@ -103,6 +104,8 @@ async def query_forward_message(update: Update, context: ContextTypes.DEFAULT_TY
|
|||||||
await forward_message(update, context, message_to_send)
|
await forward_message(update, context, message_to_send)
|
||||||
await update.callback_query.answer('✅ Forwarded')
|
await update.callback_query.answer('✅ Forwarded')
|
||||||
await update.callback_query.edit_message_reply_markup()
|
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_reply']
|
||||||
del context.user_data['message_to_send']
|
del context.user_data['message_to_send']
|
||||||
del context.user_data['message_url']
|
del context.user_data['message_url']
|
||||||
|
|||||||
Reference in New Issue
Block a user