Added category and fixed format for messages

This commit is contained in:
Joan
2023-07-04 15:02:53 +02:00
parent b3735f9494
commit 3dfc7c6358

View File

@@ -135,8 +135,7 @@ async def send_article(article, product):
found_by = f"*🔍 Encontrado por la búsqueda de:* {telegram_escape_characters(product['product_name'])}"
created_at = f"*📅 Fecha de publicación:* {telegram_escape_characters(get_publish_date(article))}"
modified_at = f"*📅 Fecha de modificación:* {telegram_escape_characters(get_modified_date(article))}"
location = f"📍 *Lugar:* {telegram_escape_characters(article['location']['city'])} ({telegram_escape_characters(article['location']['postal_code'])}) - {telegram_escape_characters(article['location']['country_code'])})"
location = telegram_escape_characters(location)
location = f"📍 *Lugar:* {telegram_escape_characters(article['location']['city'])} {telegram_escape_characters('(' + article['location']['postal_code']) + ')' } {telegram_escape_characters('- (' + article['location']['country_code']) + ')'}"
if article['shipping']['user_allows_shipping']:
user_ships = f"📦 *Envío:* ✅"
else:
@@ -299,6 +298,7 @@ def send_to_nr(article, product):
"product_name": product['product_name'],
"telegram_user_id": product['telegram_user_id'],
"telegram_name": walladb.get_user(product['telegram_user_id']),
"category_id": article['category_id'],
"seller_id": article['seller_id'],
"environment": constants.NR_ENV
}