Improved original message obfuscation

This commit is contained in:
Joan
2023-12-29 11:08:43 +01:00
parent fa12c7e9e5
commit 9a8a7a291b

View File

@@ -103,6 +103,7 @@ def find_amazon_link(update: Update, context: CallbackContext) -> None:
user, chat, chat_id, message_id = update.message.from_user, update.message.chat, update.message.chat_id, update.message.message_id
amazon_url_with_referer, original_message = extract_amazon_url_with_referer(msg)
original_message = f"\n\nMensaje original: {original_message}" if original_message != '<enlace>' else ''
if amazon_url_with_referer:
logging.info(f"Link sent by {user} - {msg}")
@@ -139,7 +140,7 @@ def find_amazon_link(update: Update, context: CallbackContext) -> None:
helpers.create_image(product_id, product_data.price)
keyboard = [[InlineKeyboardButton("Ir a Amazon", url=f"{amazon_url_with_referer}")]]
markup = InlineKeyboardMarkup(keyboard)
context.bot.send_photo(chat_id=chat_id, photo=open(f"/app/data/images/products/{product_id}_composed.png", 'rb'), caption=f"URL enviada por @{user['username']}: \n\n{product_data.title}\n\nMensaje original: {original_message}", reply_markup=markup)
context.bot.send_photo(chat_id=chat_id, photo=open(f"/app/data/images/products/{product_id}_composed.png", 'rb'), caption=f"URL enviada por @{user['username']}: \n\n{product_data.title}{original_message}", reply_markup=markup)
def main() -> None: