diff options
Diffstat (limited to 'lib/payments.js')
| -rw-r--r-- | lib/payments.js | 21 |
1 files changed, 18 insertions, 3 deletions
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`; |
