Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue#613 show more info to maker when an order is taken #621

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions bot/messages.ts
Original file line number Diff line number Diff line change
@@ -393,6 +393,12 @@ const onGoingTakeBuyMessage = async (
seller.tg_id,
i18nSeller.t('payment_received')
);
//I need the currency symbol to show it in the message
let currency = getCurrency(order.fiat_code);
currency =
!!currency && !!currency.symbol_native
? currency.symbol_native
: order.fiat_code;
const holdInvoiceExpiration = holdInvoiceExpirationInSecs();
const orderExpiration =
holdInvoiceExpiration.expirationTimeInSecs -
@@ -406,6 +412,8 @@ const onGoingTakeBuyMessage = async (
await bot.telegram.sendMessage(
buyer.tg_id,
i18nBuyer.t('someone_took_your_order', {
currency,
order,
expirationTime,
rate,
days: ageInDays,
30 changes: 17 additions & 13 deletions locales/de.yaml
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ start: |

${disclaimer}
---———— DISCLAIMER ————---

Dieser Bot wird dir helfen, P2P Bitcoin-Transaktionen über das Lightning Network durchzuführen.

Sobald du den Bot gestartet hast, kannst du die folgenden Befehle verwenden:
@@ -29,13 +29,15 @@ start: |
Weitere Informationen zur Verwendung dieses Bots finden Sie hier 👇

https://lnp2pbot.com/learn

Mache eine schnelle und sichere Transaktion!
init_bot_error: Um diesen Bot zu verwenden, musst du zuerst den Boot mit dem Befehl /start initialisieren
non_handle_error: 👤 Um diesen Bot zu nutzen, musst du deinen Telegram-Benutzernamen aktivieren. Um ihn zu aktivieren, öffne das Hamburger-Menü oben links und wähle Einstellungen -> Profil bearbeiten -> Benutzernamen
invoice_payment_request: |
Jemand möchte ${order.amount} Sats für ${currency} ${order.fiat_amount} kaufen.

Bestellnummer: #${order._id}
Zahlungsmethode: ${order.payment_method}
Buyer Reputation: ${rate}, Tage mit dem Bot: ${days}

Bitte bezahle diese LN-Rechnung, um deinen Verkaufsprozess zu starten. Diese LN-Rechnung läuft in ${expirationTime} Minuten ab
@@ -110,10 +112,13 @@ payment_received: |

Warten Sie ein wenig. Wenn der Käufer nicht reagiert, wird der Betrag an Sie zurückgesendet.
someone_took_your_order: |
🤖 Jemand hat deinen Auftrag entgegengenommen und mir bereits die Sats geschickt. Bitte verwende einen FIAT-Zahlungsanbieter, der es dir ermöglicht, das Geld sofort zu überweisen und bei dem kein Risiko besteht, dass das Geld eingefroren wird.
🤖 Bestellnummer: #${order._id}

Jemand hat deinen Auftrag entgegengenommen und mir bereits die Sats geschickt. Bitte verwende einen FIAT-Zahlungsanbieter, der es dir ermöglicht, ${order.fiat_amount} ${currency} sofort zu überweisen und bei dem kein Risiko besteht, dass das Geld eingefroren wird.

Wenn dein Zahlungsabwickler die Zahlung aus irgendeinem Grund pausiert und das Geld nicht innerhalb von ${expirationTime} eintrifft, gehen die Sats an den Verkäufer zurück, wodurch der Käufer einem Risiko ausgesetzt ist und ich nicht in der Lage bin, den Verkäufer zu zwingen, die Sats erneut zu senden.

Zahlungsmethode: ${order.payment_method}
Verkäufer Ruf: ${rate}, Tage mit dem Bot: ${days}

Wenn du mit den obigen Angaben einverstanden bist, drücke den Button, um fortzufahren 👇
@@ -140,7 +145,7 @@ buyer_took_your_order: |
🤖 Order Id: #${orderId}

@${buyerUsername} hat deinen Auftrag angenommen und möchte deine Sats kaufen. Nimm Kontakt mit ihm auf und sag ihm, wie er dir ${currency} ${fiatAmount} über ${paymentMethod} senden kann.

Ich werde dich benachrichtigen, sobald der Käufer mir mitteilt, dass er das Fiat-Geld gesendet hat. Danach musst du überprüfen, ob es angekommen ist.

Wenn der Käufer nicht antwortet, kannst du eine Stornierung oder eine Streitigkeit einleiten. Denk daran, dass dich ein Administrator NIE kontaktieren wird, um deine Bestellung zu klären, es sei denn, du öffnest zuerst eine Streitigkeit.
@@ -263,9 +268,9 @@ you_have_been_banned: Du wurdest gesperrt!
I_told_seller_you_sent_fiat: 🤖 Ich habe @${sellerUsername} gesagt, dass du FIAT-Geld geschickt hast. Wenn der Verkäufer bestätigt, dass er dein Geld erhalten hat, muss er die Mittel freigeben. Falls er sich weigert, kannst du eine Streitigkeit eröffnen.
buyer_told_me_that_sent_fiat: |
🤖 @${buyerUsername} hat mitgeteilt, dass er dir das FIAT-Geld geschickt hat. Sobald du den Erhalt des Geldes bestätigst, bitte gib die Mittel frei. Beachte, dass du bis zur Freigabe der Mittel keine neue Bestellung erstellen oder übernehmen kannst.

Nachdem du freigegeben hast, geht das Geld an den Käufer und es gibt kein Zurück mehr. Daher führe diesen Prozess nur durch, wenn du dir 💯 sicher bist.

Drücke den folgenden Befehl, wenn du die Sats für den Käufer freigeben möchtest 👇
release_order_cmd: /release
you_have_orders_waiting: 🤖 Du hast eine oder mehrere Aufträge, bei denen der Käufer dir mitteilt, dass das Geld an dich geschickt wurde, du es aber noch nicht freigegeben hast. Du kannst keine neuen Aufträge erstellen, bis du das Geld freigibst.
@@ -300,13 +305,13 @@ ok_cooperativecancel: '👍 Die Gegenpartei hat zugestimmt und der Auftrag mit d
refund_cooperativecancel: 💰 Du hast eine Rückerstattung deiner Lightning-Zahlung erhalten, es gibt keine weiteren Schritte zu unternehmen
init_cooperativecancel: |
🕒 Du hast mit der Stornierung des Auftrages mit der Id ${orderId} gestartet. Dein Gegenüber muss mir ebenfalls mitteilen, dass er die Stornierung wünscht. Falls er/sie nicht antwortet, kannst du eine Streitigkeit eröffnen.

Kein Administrator wird dich kontaktieren, um deine Bestellung zu stornieren, es sei denn, du eröffnest zuerst eine Streitigkeit.
counterparty_wants_cooperativecancel: |
😳 Deine Gegenpartei möchte den Auftrag mit der Id ${orderId} stornieren.

Kein Administrator wird dich kontaktieren, um deine Bestellung zu stornieren, es sei denn, du eröffnest zuerst eine Streitigkeit.

Wenn du einverstanden bist, benutze den Befehl 👇
invoice_payment_failed: ⛔ Ich habe versucht, dir die Sats zu schicken, aber die Bezahlung deiner LN-Rechnung ist fehlgeschlagen. Ich werde es noch ${attempts} weitere Male in ${pendingPaymentWindow} Minuten-Intervallen versuchen. Bitte überprüfe, ob dein Node/Wallet online ist.
cant_take_more_orders: ⛔ Sorry! Du kannst keinen weiteren Auftrag annehmen, während andere auf dich warten
@@ -541,12 +546,11 @@ npub_not_valid: |
Beispiel:
/setnpub npub180cvv07tjdrrgpa0j7j7tmnyl2yr6yr7l8j4s3evf6u64th6gkwsyjh6w6
# END modules/nostr

# START modules/community
community_admin: |
<strong>Community Admin Mode</strong>
> ${community.name} (${community.group})

Public:
${community.public ? 'Yes' : 'No'}
Fee:
@@ -598,7 +602,7 @@ bot_info: |
Max routing fee: ${routing_fee}

Node URI: `${node_uri}`

Node status: ${status}

User info:
@@ -624,7 +628,7 @@ setinvoice_no_response: Sie haben keine zu bezahlenden Aufträge
already_cancelled: Die Bestellung wurde bereits storniert!
privacy: |
*Datenschutzrichtlinie*

Ihre Privatsphäre ist uns wichtig, und wir sind verpflichtet, Ihre persönlichen Daten zu schützen. Diese Datenschutzrichtlinie erklärt, welche Informationen wir sammeln, wie und zu welchem Zweck.

*1. Informationen, die wir sammeln:*
36 changes: 20 additions & 16 deletions locales/en.yaml
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ start: |

${disclaimer}
---———— DISCLAIMER ————---

This bot will help you complete P2P Bitcoin transactions through the Lightning Network (LN).

Once you start up the bot, you can use the following commands:
@@ -31,13 +31,15 @@ start: |
You can find more information on how to use this bot here 👇

https://lnp2pbot.com/learn

Make a quick and safe transaction!
init_bot_error: to use this bot, you need to first initialize the boot with the command /start
non_handle_error: 👤 To use this bot, you need to activate your Telegram Username. To activate it open the hamburger menu on the top left and select settings -> edit profile -> username
invoice_payment_request: |
Somebody wants to buy you ${order.amount} sats for ${currency} ${order.fiat_amount}.

Order ID: #${order._id}
Payment method: ${order.payment_method}
Buyer Reputation: ${rate}, days using the bot: ${days}

Please pay this invoice to start up your selling process, it will expire in ${expirationTime} minutes
@@ -112,10 +114,13 @@ payment_received: |

Wait a bit. The collateral will be returned to you if the buyer does not cooperate.
someone_took_your_order: |
🤖 Someone took your order and already sent me the sats, please use a fiat payment processor that allows you to send the money immediately and in which there is no risk of freezing funds.
🤖 Order Id: #${order._id}

Someone took your order and already sent me the sats, please use a fiat payment processor that allows you to send ${order.fiat_amount} ${currency} immediately and in which there is no risk of freezing funds.

If, for any reason, your payment processor puts the payment on pause and the funds do not arrive in less than ${expirationTime}, the sats will return to the seller, putting the buyer at risk. I cannot force the seller to send the sats again.

Payment method: ${order.payment_method}
Seller Reputation: ${rate}, days using the bot: ${days}

If you agree with the above, press the button to continue 👇
@@ -142,7 +147,7 @@ buyer_took_your_order: |
🤖 Order ID: #${orderId}

@${buyerUsername} has taken your order and wants to buy your sats. Get in touch and tell him how to send you ${currency} ${fiatAmount} through ${paymentMethod}.

I will notify you when the buyer indicates that they have sent the fiat. After that, you should check if it has arrived.

If the buyer does not respond, you can initiate a cancellation or a dispute. Remember, an administrator will NEVER contact you to resolve your order unless you open a dispute first.
@@ -159,7 +164,7 @@ order_detail: |
ID: `${order._id}`

Status previous to dispute: ${previousDisputeStatus}

Status: ${status}

Creator: @${creator || ''}
@@ -265,7 +270,7 @@ you_have_been_banned: You have been banned!
I_told_seller_you_sent_fiat: 🤖 I told @${sellerUsername} that you have sent the fiat money. When the seller confirms that they have received your money, they should release the funds. If they refuse, you can open a dispute.
buyer_told_me_that_sent_fiat: |
🤖 @${buyerUsername} has informed that he already sent you the fiat money. Once you confirm the reception, please release funds. You will not be able to create another order until you release funds.

After releasing, the money will go to the buyer and there will be no turning back, so only proceed with this process if you are 💯 sure.

Press the following command if you want to release the sats to the buyer 👇
@@ -303,15 +308,15 @@ ok_cooperativecancel: '👍 Counterparty agreed and the order ID: ${orderId} has
refund_cooperativecancel: 💰 You have received a refund of your lightning payment, there is no further action to make
init_cooperativecancel: |
🕒 You have started the cancellation of the order ID: ${orderId}, your counterparty must agree on the cancellation too. If they do not respond, you can open a dispute.
No administrator will contact you to cancel your order unless you open a dispute first.

No administrator will contact you to cancel your order unless you open a dispute first.

counterparty_wants_cooperativecancel: |
😳 Your counterparty wants to cancel order ID: ${orderId}.

No administrator will contact you to cancel your order unless you open a dispute first.
If you agree on such cancellation, please execute the following command 👇

If you agree on such cancellation, please execute the following command 👇
invoice_payment_failed: ⛔ I tried to send you the sats but the payment of your invoice failed, I will try ${attempts} more times in ${pendingPaymentWindow} minutes window, please check your node/wallet is online
cant_take_more_orders: ⛔ Sorry! You can't take another order while you have others waiting for you
seller_released: 💸 Seller has already released the satoshis, you must wait for your invoice to be paid.
@@ -531,7 +536,7 @@ maintenance: 🚨 Bot in maintenance, please try again later 🚨
community_admin: |
<strong>Community Admin Mode</strong>
> ${community.name} (${community.group})

Public:
${community.public ? 'Yes' : 'No'}
Fee:
@@ -567,7 +572,6 @@ npub_not_valid: |
Example:
/setnpub npub180cvv07tjdrrgpa0j7j7tmnyl2yr6yr7l8j4s3evf6u64th6gkwsyjh6w6
# END modules/nostr

# START modules/orders
order_not_found: Order not found.
# END modules/orders
@@ -600,7 +604,7 @@ bot_info: |
Max routing fee: ${routing_fee}

Node URI: `${node_uri}`

Node status: ${status}

User info:
@@ -625,7 +629,7 @@ dispute_solver: 👮‍♂️ A solver will be attending your dispute, you can w
setinvoice_no_response: You have no orders to be paid
privacy: |
*Privacy Policy*

Your privacy is important to us, and we are committed to protecting your personal information. This Privacy Policy explains what information we collect, how, and for what purpose.

*1. Information We Collect:*
20 changes: 12 additions & 8 deletions locales/es.yaml
Original file line number Diff line number Diff line change
@@ -36,6 +36,8 @@ non_handle_error: 👤 Para usar este bot debes activar tu username de telegram,
invoice_payment_request: |
Un usuario quiere comprarte ${order.amount} sats por ${currency} ${order.fiat_amount}.

Orden ID: #${order._id}
Método de pago: ${order.payment_method}
Reputación del comprador: ${rate}, días utilizando el bot: ${days}

Si deseas continuar por favor paga esta factura, esta factura expira en ${expirationTime} minutos
@@ -96,7 +98,7 @@ invoice_require_hash: La factura necesita un hash
order_id_invalid: Id de orden incorrecto
order_invalid_type: Esta orden es una ${type}
order_already_taken: Esta orden ya ha sido tomada por otro usuario
order_already_settled: Esta orden ya ha sido liquidada.
order_already_settled: Esta orden ya ha sido liquidada.
invalid_data: Has enviado datos incorrectos, inténtalo nuevamente.
begin_take_buy: |
🤖 Presiona Continuar para tomar la oferta, si presionas Cancelar te desvincularé de la orden y será publicada nuevamente, tienes ${expirationTime} minutos o la orden expirará 👇
@@ -110,10 +112,13 @@ payment_received: |

Espera un momento. Si el comprador no coopera, se te devolverá el colateral.
someone_took_your_order: |
🤖 Alguien ha tomado tu compra y ya me envió tus sats, por favor utiliza un procesador de pagos fiat que te permita enviar el dinero de manera inmediata y en el cual no haya riesgo de congelamiento de fondos.
🤖Orden ID: #${order._id}

Alguien ha tomado tu compra y ya me envió tus sats, por favor utiliza un procesador de pagos fiat que te permita enviar ${order.fiat_amount} ${currency} de manera inmediata y en el cual no haya riesgo de congelamiento de fondos.

Si por alguna razón tu procesador de pagos pusiera el pago en pausa y los fondos no llegasen en un lapso menor a ${expirationTime}, los sats regresarán al vendedor, poniendo al comprador en riesgo y yo no podré obligar al vendedor a enviar nuevamente los sats.

Método de pago: ${order.payment_method}
Reputación del vendedor: ${rate}, días utilizando el bot: ${days}

Si estás de acuerdo con lo arriba expresado presiona el botón para continuar 👇
@@ -155,9 +160,9 @@ sell_sats: Vender satoshis
buy_sats: Comprar satoshis
order_detail: |
Id: `${order._id}`

Status previo a disputa: ${previousDisputeStatus}

Status: ${status}

Creador: @${creator || ''}
@@ -528,7 +533,7 @@ maintenance: 🚨 Bot en mantenimiento, inténtalo de nuevo más tarde 🚨
community_admin: |
<strong>Community Admin Mode</strong>
> ${community.name} (${community.group})

Pública:
${community.public ? 'Si' : 'No'}
Fee:
@@ -565,7 +570,6 @@ npub_not_valid: |
Ejemplo:
/setnpub npub180cvv07tjdrrgpa0j7j7tmnyl2yr6yr7l8j4s3evf6u64th6gkwsyjh6w6
# END modules/nostr

# START modules/orders
order_not_found: No se encontró la orden.
# END modules/orders
@@ -598,7 +602,7 @@ bot_info: |
Max routing fee: ${routing_fee}

Node URI: `${node_uri}`

Node status: ${status}

User info:
@@ -624,7 +628,7 @@ setinvoice_no_response: No tienes ordenes a ser pagadas
already_cancelled: ¡La orden ya ha sido cancelada!
privacy: |
*Política de Privacidad*

Tu privacidad es importante para nosotros, y estamos comprometidos a proteger tu información personal. Esta Política de Privacidad explica qué información recopilamos, cómo, y con qué propósito.

*1. Información que Recopilamos:*
Loading