From 0d7574597d33bad78f4ebad3c38b956debb0e699 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sat, 2 Sep 2023 17:12:10 +0000 Subject: fix swedish currency --- lib/payments.js | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'lib/payments.js') diff --git a/lib/payments.js b/lib/payments.js index c8e74201..2764df18 100644 --- a/lib/payments.js +++ b/lib/payments.js @@ -181,13 +181,28 @@ export let credit = async (hash, amount, memo, ref, type = types.internal) => { callWebhook(invoice, p); if (user.hasprinter) { - let words = dollarsToWords( - parseFloat(((amount * p.rate) / 100000000).toFixed(2)) - ); + let fiat = parseFloat(((amount * p.rate) / 100000000).toFixed(2)); + let words = dollarsToWords(fiat); let client = mqtt.connect("mqtt://ln.coinos.io", config.mqtt); client.subscribe(username); + if (fiat === 0.02) { + words = "there is no second best"; + client.publish(username, "easter"); + } + + if (fiat === 0.21) { + words = "tick tock, next block"; + client.publish(username, "easter"); + } + + if (fiat === 0.69) { + words = "have fun staying poor"; + client.publish(username, "easter"); + } + + let raw = `/app/data/uploads/${p.id}-raw.mp3`; let out = `/app/data/uploads/${p.id}.mp3`; -- cgit v1.2.3