Code Monkey home page Code Monkey logo

laiseebot's Introduction

laiseebot

Telegram Bot for LN Laisees

Due to the lack of interest, this project is currently not maintained.

Sample Laisee for CNY generated by the telegram bot. See more information at: https://laisee.org

2022 Year of the Tiger

2022 Laisee

2023 Year of the Rabbit

2023 Laisee

You must have rsvg-convert installed

sudo apt install librsvg2-bin

Requires at least python3.8

commands list

  • /help - get help commands, and a welcome message on how to use the bot
  • /start - automatically creates a wallet on LNBITS with LNURLp extension.
  • Automatically creates a lnaddress with format of [email protected], based on the telegram username.

LaiseeBot Functions

  • /rates - what daily exchange rate is between sats to hkd and usd

transactions

  • /laisee - /laisee username, Sends a laisee to another, has sub menu pick image/msg. cannot send to user if they don't have a telegram account, notify user their recipient needs to start a conversation in order to receive their gift.
  • /send - /send telegram username
  • /invoice - /invoice , generate lightning invoice

wallet functionality on lnbits

  • /balance - get current wallet balance on lnbits
  • Top Up Wallet

create LN address [ on start ]

[WARNING: if end user modifies metadata on lnbits or changes TG name, the LN address needs to be updated on github, these two are connected. ]

lnurlP extension on lnbits

  • see fill command above, metadata for LN address that must be synced between lnbits and github are below:
    • amount: 100- 100000 sat
    • on success: display message
    • dispatches webhook to : <<>>

lndhub extension

  • /lndhub or /bluewallet - get LNDHUB invoice url or admin url [admin, invoice sub command] that can be used w/external wallet
  • /withdraw - get LNURL Withdraw QR code to drain wallet

========

Infrastructure List

  1. [Infrastructure] pylnbits module - clean up unit tests.

  2. [Infrastructure] Supabase -

    • Data:
      • TG Username
      • LN Address ([email protected])
      • LNBits url
      • invoice_key (lnbits, needed for send/receive/lookup functions)
      • admin_key (lnbits, needed to enable extensions and create lnurlp, used with LN Addresses)
      • Email Address (tied to auth on supabase, accessible via web interface)
      • optional avatar (web interface, for future implementation)
      • optional website. (web interface)
  3. [FrontEnd] Telegram: Stitch above together with Telegram bot menu and methods

  4. [Infrastructure] LN Addresses:

    • LN Address entries by updating git repo: github.com/bitkarrot/laisee-frontpage
    • deployed site has .well-known enabled
  5. [FrontEnd] Web framework: https://laisee.org/

    • can be easily extended in future to embed lnbits functions
    • supabase backend

laiseebot's People

Contributors

bitkarrot avatar dependabot[bot] avatar kankichi77 avatar liongrass avatar sendlaisee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

laiseebot's Issues

Return allocated funds together with /balance

Return not just the raw balance, but also the allocated amounts when running the command /balance

also, maybe round all values to the nearest milli-satoshi?

e.g.:

Total Amount Allocated to Laisee: 2516
Available Balance for New Laisee: 223.36200000000008```

webhook update on LNURLw on lnbits

Ideal to get an automated balance update from LNBits when a user redeems a laisee.
however there is currently no webhook on LNURLw on Lnbits so this would need to be added somehow before it can be added here.

Replay laisee image

Need a method to recreate an old laisee if it gets lost or deleted in telegram and wasn't claimed.

example:

/replay <laisee id number> 

Right now there is no way to do it for the end user, but they can use lnbits url link for claiming laisee sats.

Disable comments from LNURL-pay

The LNURL-pay that is generated for each user asks for a comment to be submitted.

Ideally we don't ask for a comment because we don't display it anywhere.

Allow for OnChain Top Ups

Use newly release SatsPayServer Extension to permit OnChain top ups for users who have BTC but no exposure to LN

How does a user know when/if they need to top up their balance?

For each Laisee I create, I should have to add a certain amount of funds to my account.
In the current configuration, I can create 100 Laisee with 0 balance.
I later have no way of finding out how many Laisee I have created, e.g. how many Laisee I have outstanding.

Possible solutions:

  • I have to pay an invoice before I get the Laisee
  • I can see how many outstanding Laisee I have, and I can only create new Laisee as long as my balance is larger than the outstanding Laisee

Total amount allocated to Laisee should not include redeemed Laisee

The "total amount allocated to Laisee" includes Laisee that have already been redeemed, possibly resulting in a negative balance and requiring the user to over allocate funds to their Laisee bot account.

Is there a way to sum up only the unredeemed Laisee?

Total Amount Allocated to Laisee: 2516
Available Balance for New Laisee: -113.8690000000001```

Upgrade to use latest LNBits lnurlp (post feb '23 version)

update laiseebot to use lnurlp for lightning addresses, kill off modify well-known update to forward to LNBits lnurlp.

currently well-knowns are created for each new user on https://github.com/bitkarrot/laisee-frontpage

if we migrate to the new lnurlp (post feb 2023, see leo's test instance), we don't need to do use the laisee-frontpage for .well-known.

However, it does mean that the LN addresses are now [email protected] instead of [email protected] because the LNbits instance is at ln.laisee.org

Laisee coloring

To be fixed:

  • The Laisee has a white frame
  • The QR code is the wrong color (should be 5b1110ff)
  • The QR code background is the wrong color (should be dcb866ff)
  • Amount isn't centered
  • Expiration date and id isn't legible)
    tiger

Sending to lightning address returns error "invalid invoice"

lnbits.hapax.io returned an invalid invoice. Expected description_hash == 6bcd23eb74f39e0d48122fe28cf38bfb8730549ba6e755110a3ea25a8b26c691, got 17c4b49068c3a6998bfe6f1a55c3e0fa9ffcd8356999d2117b528e8b605ed23b.

As tested in lnbits

in SBW:

requirement failed: Metadata hash mismatch, original =6bcd....., later provided=Some(17c4b...)```

Creating a Laisee with command /laisee {amount} results in error

REPRO:

  • Start Laiseebot
  • Fund Laiseebot
  • Run command laisee 100

ACTUAL:

  • Error creating laisee: local variable 'session' referenced before assignment

EXPECTED:

  • Get a Laisee

Creating a Laisee through the menu works, so maybe it's just a function that needs to be updated, or is wrongly called?

Feature: Handling fees

We could create a lnbits user account for @laiseebot

Everytime the bot creates a Laisee, it first sends the appropriate fee to the @laiseebot, as if the laiseebot was another user. This can happen silently in the background.

Balance does not update after depositing funds

  1. I deposit some sats, either through the lnurl, lightning address or invoice
  2. No matter how many times i run /balance, the balance does not update

The balance only updates after I click on the lnbits wallet link.

Surely there would be another way of triggering that update?

title of the Laisee should read "Laisee"

At present, a Laisee is labelled Laisee amount: {amount}

Instead, only labeling the Laisee Laisee or Lightning Laisee would be more fitting, as the amount is displayed in any wallet.

If we want to be creative we could choose from a list of new year's greetings that are randomly chosen to accompany the label Laisee:

金玉滿堂
大展鴻圖
迎春接福
萬事如意
吉慶有餘
竹報平安
一本萬利
福壽雙全
招財進寶

Defund action displays wrong link

When selecting 'defund the wallet' the user is sent a QR code and a link. The link however only links to the img.

As an alternative, a hyperlink like the one below could be displayed:

lightning:LNURL1DP68GURN8GHJ7MRWVF5HGUEWDPSHQCTC9E5K7TMHD96XSERJV9MN7ATNWG7NWCFS8Q6NVE3SXQEKGCE5X5UR2WRP

The way the Laisee bot currently works, do we want to give the option to defund the wallet? As it would allow the user to defund the Laisee they already handed out.

Update requirements

Update requirements so that pylnbits and supabase are not used with git+https://

I believe both of these libraries are now under stable release and we don't need to pull from branch. However please test and make sure that is the case before pr. thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.