Skip to content

chrislennon/lnbits-discord-bot

Repository files navigation

Discord bot for lnbits

If you wish to discuss any development of this feel free to open an issue or chat on our telegram group. Be sure to also check out lnbits for any updates too!


The idea for this bot is a proof of concept to enable a lightning based ecosystem for a Discord Server. It will leverage lnbits for low friction of Bitcoin via lightning for all users.

Some current features:

  • Create a wallet for self and other users
  • Create only one user account per Discord user
  • Create only one wallet per Discord user
  • Retrieve wallet balance of Discord user
  • Create an invoice
  • Pay an invoice
  • Display payment link/reference
  • Embed QR of invoice request
  • Enable tipping between users
  • Enable role/server invite paywall
  • Implement Paynow interaton handler
  • Enable betting on events
  • Lots more...

Commands

/create Will create a wallet for the Discord user

  • (currently limiting 1 Discord user == 1 LNbits user == 1 user wallet)

create

/balance Will show the balance of the users wallet.

balance

/tip @user [amount] Will send money from one user to another

  • If the recieving user does not have a wallet, one will be created for them
  • The receiving user will receive a direct message from the bot with a link to their wallet

tip

/payme [amount] [description] Will open an invoice that can be paid by any user

payme

Installation

Requirements

  • Environment for the bot to run
  • A functional instance of LNBits
    • You can host your own, or use lnbits.com
      • This provides .env entry LNBITS_HOST
      • If you do not have an LNBits instance you can use https://lnbits.com
    • You will need to have a user on your LNBits instance
      • This provides .env entry LNBITS_ADMIN_USER_ID
      • For example with http://lnbits.com/wallet?usr=0123456789abcdef0987654321&wal=ababababababababababababab your admin user id will be 0123456789abcdef0987654321
    • You will need to have an API key for this user
      • This provides .env entry LNBITS_ADMIN_API_KEY
      • You can find this in the right hand panel, in the example below this will be abc123abc123abc123abc123abc123abc
      • adminkey
    • You will need to have the "User Manager" extension enabled
  • A Discord server that you administer or a willing admin from another server
  • A Discord bot user (for more detailed steps see here)
    • This provides .env entry AUTH_TOKEN

Starting your bot

  • Copy the file .env.example to .env and fill out the above variables
  • If you have never run the project run npm install
  • Start the bot with the npm start command
    • The bot should report that is connected in the terminal
    • Your bot should be online in Discord 🎉

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published