Fixed currency in sent messages
This commit is contained in:
@@ -130,7 +130,11 @@ async def send_article(article, product):
|
||||
description = f"*📝 Descripción*: {telegram_escape_characters(article['description'])}"
|
||||
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))}"
|
||||
price = f"*💰 Precio*: {telegram_escape_characters(str(article['price']))} {telegram_escape_characters(article['currency'])}"
|
||||
if article['currency'] == 'EUR':
|
||||
currency = '€'
|
||||
else:
|
||||
currency = '?'
|
||||
price = f"*💰 Precio*: {telegram_escape_characters(str(article['price']))} {telegram_escape_characters(currency)}"
|
||||
text = f"{title}\n\n{description}\n\n{found_by}\n\n{created_at}\n\n{price}"
|
||||
#url = f"https://api.telegram.org/bot{constants.TELEGRAM_TOKEN}/sendPhoto?chat_id={product['telegram_user_id']}&caption={text}&parse_mode=MarkdownV2"
|
||||
#files = {'photo':open(f"/app/data/images/products/{article['id']}_composed.png", 'rb')}
|
||||
|
||||
Reference in New Issue
Block a user