From ddd5d03fa7a4b6889c753b4fb72ad9386b97d09c Mon Sep 17 00:00:00 2001 From: Maxi Vila Date: Mon, 19 Jan 2026 18:39:33 -0300 Subject: [PATCH 1/6] Updated lighting dependecy --- package-lock.json | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/package-lock.json b/package-lock.json index 47344b33..bc35fd7e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -739,6 +739,7 @@ "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.11.0.tgz", "integrity": "sha512-lmt73NeHdy1Q/2ul295Qy3uninSqi6wQI18XwSpm8w0ZbQXUpjCAWP1Vlv/obudoBiIjJVjlztjQ+d/Md98Yxg==", "dev": true, + "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "8.11.0", "@typescript-eslint/types": "8.11.0", @@ -956,6 +957,7 @@ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", "dev": true, + "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -2350,6 +2352,7 @@ "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==", "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.", "dev": true, + "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", @@ -2535,6 +2538,7 @@ "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.31.0.tgz", "integrity": "sha512-ixmkI62Rbc2/w8Vfxyh1jQRTdRTF52VxwRVHl/ykPAmqG+Nb7/kNn+byLP0LxPgI7zWA16Jt82SybJInmMia3A==", "dev": true, + "peer": true, "dependencies": { "@rtsao/scc": "^1.1.0", "array-includes": "^3.1.8", @@ -2589,6 +2593,7 @@ "resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-15.7.0.tgz", "integrity": "sha512-jDex9s7D/Qial8AGVIHq4W7NswpUD5DPDL2RH8Lzd9EloWUuvUkHfv4FRLMipH5q2UtyurorBkPeNi1wVWNh3Q==", "dev": true, + "peer": true, "dependencies": { "builtins": "^5.0.1", "eslint-plugin-es": "^4.1.0", @@ -2626,6 +2631,7 @@ "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-6.6.0.tgz", "integrity": "sha512-57Zzfw8G6+Gq7axm2Pdo3gW/Rx3h9Yywgn61uE/3elTCOePEHVrn2i5CdfBwA1BLK0Q0WqctICIUSqXZW/VprQ==", "dev": true, + "peer": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, @@ -6943,6 +6949,7 @@ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", "devOptional": true, + "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" From 3581e588e40c210f2ddd507c8e1c088c4eaf6ad3 Mon Sep 17 00:00:00 2001 From: Maxi Vila Date: Mon, 19 Jan 2026 18:48:33 -0300 Subject: [PATCH 2/6] Updated lightning dependency --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8c8aac4e..b9cba329 100644 --- a/package.json +++ b/package.json @@ -69,4 +69,4 @@ "typegram": "^5.2.0", "typescript": "5.1.6" } -} +} \ No newline at end of file From b7cb71e55717d88c208ba672ba0b40f35ceda84c Mon Sep 17 00:00:00 2001 From: Maxi Vila Date: Thu, 22 Jan 2026 16:51:28 -0300 Subject: [PATCH 3/6] feat: Update first line order description generation to improve translations --- bot/ordersActions.ts | 26 ++++++++++++++++++++------ locales/de.yaml | 6 ++++-- locales/en.yaml | 6 ++++-- locales/es.yaml | 6 ++++-- locales/fa.yaml | 15 ++++++++------- locales/fr.yaml | 6 ++++-- locales/it.yaml | 6 ++++-- locales/ko.yaml | 6 ++++-- locales/pt.yaml | 6 ++++-- locales/ru.yaml | 6 ++++-- locales/uk.yaml | 6 ++++-- 11 files changed, 64 insertions(+), 31 deletions(-) diff --git a/bot/ordersActions.ts b/bot/ordersActions.ts index eb0413b2..59d5ab95 100644 --- a/bot/ordersActions.ts +++ b/bot/ordersActions.ts @@ -218,7 +218,6 @@ const buildDescription = ( }: BuildDescriptionArguments, ) => { try { - const action = type === 'sell' ? i18n.t('selling') : i18n.t('buying'); const hashtag = `#${type.toUpperCase()}${fiatCode}\n`; const paymentAction = type === 'sell' ? i18n.t('receive_payment') : i18n.t('pay'); @@ -226,9 +225,6 @@ const buildDescription = ( const volume = numberFormat(fiatCode, user.volume_traded); const totalRating = user.total_rating; const totalReviews = user.total_reviews; - const username = user.show_username - ? `@${user.username} ` + i18n.t('is') + ` ` - : ``; const volumeTraded = user.show_volume_traded ? i18n.t('trading_volume', { volume }) + `\n` : ``; @@ -266,8 +262,10 @@ const buildDescription = ( const ageInDays = getUserAge(user); - let description = - `${username}${action} ${amountText}` + i18n.t('sats') + `\n`; + const firstLine = getOrderTitleMessage(user, type, i18n); + + let description: string = + `${firstLine}\n`; description += i18n.t('for') + ` ${currencyString}\n`; description += `${paymentAction} ` + i18n.t('by') + ` ${paymentMethod}\n`; description += i18n.t('has_successful_trades', { trades }) + `\n`; @@ -283,6 +281,22 @@ const buildDescription = ( } }; +const getOrderTitleMessage = (user: UserDocument, type: string, i18n: I18nContext) => { + const isSell = type === 'sell'; + + // Guard Clause: The user DOES want to show their name, we resolve and leave. + if (user.show_username) { + return isSell + ? i18n.t('showusername_selling_sats', { username: user.username }) + : i18n.t('showusername_buying_sats', { username: user.username }); + } + + // The user DOES NOT want to show their name. + return isSell + ? i18n.t('selling_sats') + : i18n.t('buying_sats'); +}; + const getOrder = async ( ctx: MainContext, user: UserDocument, diff --git a/locales/de.yaml b/locales/de.yaml index 428a31da..f0c78341 100644 --- a/locales/de.yaml +++ b/locales/de.yaml @@ -435,9 +435,11 @@ pending_payment_failed_to_admin: | Die Bezahlung der LN-Rechnung für den Auftrag ${orderId} des Benutzers @${username} ist fehlgeschlagen. Zahlungsversuche: ${attempts} -selling: Verkaufe -buying: Kaufe +selling_sats: Verkaufe Sats +buying_sats: Kaufe Sats receive_payment: Zahlung erhalten +showusername_buying_sats: '@${username} kauft Sats' +showusername_selling_sats: '@${username} verkauft Sats' pay: Bezahlen is: ist trading_volume: 'Handelsvolumen: ${Volumen} Sats' diff --git a/locales/en.yaml b/locales/en.yaml index b6c67ea1..3d87e3c3 100644 --- a/locales/en.yaml +++ b/locales/en.yaml @@ -441,8 +441,10 @@ pending_payment_failed_to_admin: | Payment of the invoice for the Buy order ${orderId} of user @${username} has failed. Payment attempts: ${attempts} -selling: Selling -buying: Buying +selling_sats: Selling sats +buying_sats: Buying sats +showusername_selling_sats: '@${username} is selling sats' +showusername_buying_sats: '@${username} is buying sats' receive_payment: Receive payment pay: Pay is: is diff --git a/locales/es.yaml b/locales/es.yaml index 2ea83023..a282eebc 100644 --- a/locales/es.yaml +++ b/locales/es.yaml @@ -436,8 +436,10 @@ pending_payment_failed_to_admin: | El pago a la invoice de la compra Id: ${orderId} del usuario @${username} ha fallado! Intento de pago: ${attempts} -selling: Vendiendo -buying: Comprando +selling_sats: Vendiendo sats +buying_sats: Comprando sats +showusername_buying_sats: '@${username} está comprando sats' +showusername_selling_sats: '@${username} está vendiendo sats' receive_payment: Recibo pago pay: Pago is: está diff --git a/locales/fa.yaml b/locales/fa.yaml index b528f424..5e09c105 100644 --- a/locales/fa.yaml +++ b/locales/fa.yaml @@ -511,16 +511,17 @@ pending_payment_failed: | گاهی اوقات کاربران شبکه لایتنینگ به دلیل ناکافی بودن ظرفیت دریافت کیف پولشان یا اتصال ناپایدار گره به شبکه، نمی‌توانند پرداخت‌ها را دریافت کنند. شاید بهتر باشد با استفاده از کیف پول دیگری یک صورتحساب ایجاد کنید. pending_payment_failed_to_admin: | پرداخت صورتحساب سفارش خرید کاربر @${username} با شناسه ${orderId} شکست خورد. - تعداد تلاش‌های پرداخت: ${attempts} -selling: فروختن -buying: خریدن -receive_payment: دریافت پرداخت +selling_sats: فروش ساتوشی +buying_sats: خرید ساتوشی +receive_payment: دریافت وجه pay: پرداخت is: هست -trading_volume: 'حجم معاملات: ${volume} ساتوشی' -satoshis: ساتوشی -by: با +trading_volume: 'حجم معاملات: ${volume} sat' +showusername_buying_sats: '@${username} در حال خرید ساتوشی است' +showusername_selling_sats: '@${username} در حال فروش ساتوشی است' +satoshis: ساتوشی‌ها +by: توسط rate: نرخ has_successful_trades: 'دارای ${trades} معامله موفق' user_age: 'از ربات به مدت ${days} روز استفاده کرده است.' diff --git a/locales/fr.yaml b/locales/fr.yaml index fbd589f7..c65f9523 100644 --- a/locales/fr.yaml +++ b/locales/fr.yaml @@ -434,9 +434,11 @@ pending_payment_failed_to_admin: | Le paiement de la facture pour l'offre d'achat ${orderId} de l'utilisateur @${username} a échoué. Tentatives de paiement : ${attempts} -selling: Vente -buying: Achat +selling_sats: Vente de sats +buying_sats: Achat de sats receive_payment: Réception du paiement +showusername_buying_sats: "@${username} achète des sats" +showusername_selling_sats: "@${username} vent des sats" pay: Payer is: est trading_volume: 'Volume de transactions : ${volume} sats' diff --git a/locales/it.yaml b/locales/it.yaml index fc5a32ae..1144c49c 100644 --- a/locales/it.yaml +++ b/locales/it.yaml @@ -432,12 +432,14 @@ pending_payment_failed_to_admin: | Il pagamento della invoice per l'ordine di acquisto ${orderId} dell'utente @${username} è fallito. Payment attempts: ${attempts} -selling: Vendita -buying: Acquisto +selling_sats: Vendita sats +buying_sats: Acquisto sats receive_payment: Ricezione del pagamento pay: Paga is: è trading_volume: 'Volume scambio: ${volume} sats' +showusername_buying_sats: '@${username} sta comprando sats' +showusername_selling_sats: '@${username} sta vendendo sats' satoshis: satoshi by: da rate: Valutazione diff --git a/locales/ko.yaml b/locales/ko.yaml index 132cb4bd..7643d7b6 100644 --- a/locales/ko.yaml +++ b/locales/ko.yaml @@ -432,12 +432,14 @@ pending_payment_failed_to_admin: | 결제 시도 횟수: ${attempts} -selling: 팝니다 -buying: 삽니다 +selling_sats: sats 판매 +buying_sats: sats 구매 receive_payment: 입금 pay: 결제 is: is trading_volume: '거래량: ${volume} sats' +showusername_buying_sats: '@${username} 님이 sats를 구매합니다' +showusername_selling_sats: '@${username} 님이 sats를 판매합니다' satoshis: 사토시 by: 방법 - rate: 환율 diff --git a/locales/pt.yaml b/locales/pt.yaml index a2f00046..0324ca01 100644 --- a/locales/pt.yaml +++ b/locales/pt.yaml @@ -434,10 +434,12 @@ pending_payment_failed_to_admin: | Pagamento da fatura para o pedido de compra ${orderId} de usuário @${username} falhou. Tentativas de pagamento: ${attempts} -selling: Vendendo -buying: Comprando +selling_sats: Vendendo sats +buying_sats: Comprando sats receive_payment: Receber pagamento pay: Pagar +showusername_buying_sats: '@${username} está comprando sats' +showusername_selling_sats: '@${username} está vendendo sats' is: é trading_volume: 'Volume de negócios: ${volume} sats' satoshis: satoshis diff --git a/locales/ru.yaml b/locales/ru.yaml index 9d417997..706dd157 100644 --- a/locales/ru.yaml +++ b/locales/ru.yaml @@ -435,9 +435,11 @@ pending_payment_failed_to_admin: | Платеж по счету-фактуре на покупку с идентификатором ${orderId} пользователя @${username} не выполнен! Попытка оплаты: ${attempts} -selling: Продаю -buying: Покупаю +selling_sats: Продажа сат +buying_sats: Покупка сат receive_payment: Расчет +showusername_buying_sats: '@${username} покупает саты' +showusername_selling_sats: '@${username} продает саты' pay: Расчет is: Я trading_volume: 'Обьем торгов: ${volume} сат' diff --git a/locales/uk.yaml b/locales/uk.yaml index bd729bde..f78c3408 100644 --- a/locales/uk.yaml +++ b/locales/uk.yaml @@ -432,12 +432,14 @@ pending_payment_failed_to_admin: | Платіж за рахунком-фактурою на покупку з ідентифікатором ${orderId} користувача @${username} не виконаний! Спроб оплати: ${attempts} -selling: Продаю -buying: Купую +selling_sats: Продаж сатоші +buying_sats: Купівля сатоші receive_payment: Розрахунок pay: Оплата is: є trading_volume: 'Обсяг торгів: ${volume} сат' +showusername_buying_sats: '@${username} купує сатоші' +showusername_selling_sats: '@${username} продає сатоші' satoshis: сатоші by: за допомогою rate: Kурс From 4a3aa7e8428e0e19df76df88bd991ab63ba680b2 Mon Sep 17 00:00:00 2001 From: Maxi Vila Date: Mon, 23 Mar 2026 22:20:13 -0300 Subject: [PATCH 4/6] fixing lint errors --- bot/ordersActions.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/bot/ordersActions.ts b/bot/ordersActions.ts index 59d5ab95..11a2463c 100644 --- a/bot/ordersActions.ts +++ b/bot/ordersActions.ts @@ -241,10 +241,8 @@ const buildDescription = ( if (currency) currencyString = `${fiatAmountString} ${currency.code} ${currency.emoji}`; - let amountText = `${numberFormat(fiatCode, amount)} `; let tasaText = ''; if (priceFromAPI) { - amountText = ''; tasaText = i18n.t('rate') + `: ${process.env.FIAT_RATE_NAME} ${priceMarginText}\n`; } else { From 83ab215e91f576ced254ddb74b14b70bd47fcf34 Mon Sep 17 00:00:00 2001 From: Maxi Vila Date: Thu, 26 Mar 2026 21:00:52 -0300 Subject: [PATCH 5/6] formatting --- bot/ordersActions.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/bot/ordersActions.ts b/bot/ordersActions.ts index 11a2463c..aa71f919 100644 --- a/bot/ordersActions.ts +++ b/bot/ordersActions.ts @@ -262,8 +262,7 @@ const buildDescription = ( const firstLine = getOrderTitleMessage(user, type, i18n); - let description: string = - `${firstLine}\n`; + let description: string = `${firstLine}\n`; description += i18n.t('for') + ` ${currencyString}\n`; description += `${paymentAction} ` + i18n.t('by') + ` ${paymentMethod}\n`; description += i18n.t('has_successful_trades', { trades }) + `\n`; @@ -279,7 +278,11 @@ const buildDescription = ( } }; -const getOrderTitleMessage = (user: UserDocument, type: string, i18n: I18nContext) => { +const getOrderTitleMessage = ( + user: UserDocument, + type: string, + i18n: I18nContext, +) => { const isSell = type === 'sell'; // Guard Clause: The user DOES want to show their name, we resolve and leave. @@ -290,9 +293,7 @@ const getOrderTitleMessage = (user: UserDocument, type: string, i18n: I18nContex } // The user DOES NOT want to show their name. - return isSell - ? i18n.t('selling_sats') - : i18n.t('buying_sats'); + return isSell ? i18n.t('selling_sats') : i18n.t('buying_sats'); }; const getOrder = async ( From 6aca5657d63b116887eb885db5893c99bd0109b1 Mon Sep 17 00:00:00 2001 From: Maxi Vila Date: Thu, 26 Mar 2026 21:16:44 -0300 Subject: [PATCH 6/6] fixing ci error by restoring package.json --- package-lock.json | 7 ------- package.json | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index bc35fd7e..47344b33 100644 --- a/package-lock.json +++ b/package-lock.json @@ -739,7 +739,6 @@ "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.11.0.tgz", "integrity": "sha512-lmt73NeHdy1Q/2ul295Qy3uninSqi6wQI18XwSpm8w0ZbQXUpjCAWP1Vlv/obudoBiIjJVjlztjQ+d/Md98Yxg==", "dev": true, - "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "8.11.0", "@typescript-eslint/types": "8.11.0", @@ -957,7 +956,6 @@ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", "dev": true, - "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -2352,7 +2350,6 @@ "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==", "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.", "dev": true, - "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", @@ -2538,7 +2535,6 @@ "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.31.0.tgz", "integrity": "sha512-ixmkI62Rbc2/w8Vfxyh1jQRTdRTF52VxwRVHl/ykPAmqG+Nb7/kNn+byLP0LxPgI7zWA16Jt82SybJInmMia3A==", "dev": true, - "peer": true, "dependencies": { "@rtsao/scc": "^1.1.0", "array-includes": "^3.1.8", @@ -2593,7 +2589,6 @@ "resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-15.7.0.tgz", "integrity": "sha512-jDex9s7D/Qial8AGVIHq4W7NswpUD5DPDL2RH8Lzd9EloWUuvUkHfv4FRLMipH5q2UtyurorBkPeNi1wVWNh3Q==", "dev": true, - "peer": true, "dependencies": { "builtins": "^5.0.1", "eslint-plugin-es": "^4.1.0", @@ -2631,7 +2626,6 @@ "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-6.6.0.tgz", "integrity": "sha512-57Zzfw8G6+Gq7axm2Pdo3gW/Rx3h9Yywgn61uE/3elTCOePEHVrn2i5CdfBwA1BLK0Q0WqctICIUSqXZW/VprQ==", "dev": true, - "peer": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, @@ -6949,7 +6943,6 @@ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", "devOptional": true, - "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" diff --git a/package.json b/package.json index b9cba329..8c8aac4e 100644 --- a/package.json +++ b/package.json @@ -69,4 +69,4 @@ "typegram": "^5.2.0", "typescript": "5.1.6" } -} \ No newline at end of file +}