chrislennon / lnbits-discord-bot

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question about lnbits discord bot

Bennettd77 opened this issue · comments

Hey Chris,

@arcbtc on twitter told me you were working on this project and I thought I'd ask you the following:

Could this bot include functionality to present an ln invoice that resolves into a one-time Discord invite for another Discord server?

We are seeing a lot of DM bot attacks and it seems to center around the fact that once a bot is in a server it can scan the user list immediately and start spamming DMs to the users in that list. Is there a way to use this, inside of Discord as a bot, to firewall entry into a Discord server so that only those people who want to pay the invoice get in? This would seem to greatly limit the kind of automated botting attacks we're seeing from the start. I've seen this done in Telegram but not sure if a bot wouldn't be able to have already scanned that user list before the invoice times out.

I would think we'd have to run the bot on a different server (that purges it's user list every 5 minutes or so), have it present an invoice that resolves into a one-time invite to the real server or something along those lines.

I appreciate your time, Chris.

Thank you.

David (@bennd77 on Twitter)

Hey there 👋

That's a really interesting use case I hadn't thought of! Thanks for that!

First off, super early days here - basically just getting base level interactions and extension built for lnbits (PR is open for testing at the moment lnbits/lnbits#258).

I can see two ways of handling this:

  1. I'm fairly sure the situation you describe could be possible, A bot with invite control of the main server could issue the invite to the user upon payment of an invoice.

  2. Another approach could be to run the bot on your main server and provide a role to a user (allowing access to channels) on payment of invoice, which setup/bot instance wise could be simpler.

I'm not sure how the interface/extension for this would look yet, I had intent to build 2 at some point - some further thoughts required on how this would be managed from the lnbits extension side I feel

Thanks for the reply. I figured you were very early on in this project but felt compelled to reach out with this idea as I think it would be a great way to combat these spam bots. These things are all over the place. Like cockroaches.

commented

Yo @Bennettd77! I randomly found this issue here and uh... I literally built exactly what you're looking for: https://twitter.com/Fittiboy/status/1400853691561918468
It's an lnurl-pay code that, once paid, generates a one-time invite and redirects the user there!

Edit: I built it as a proof of concept, but maybe I'll make it an LNbits extension. There's a lot of work involved in that though, since I have to build all the HTML and JS via trial and error, as I've never learned either language. In the meantime, I'd be happy to help you set it up the way I'm running it. Requires a publicly accessible https url though.

Edit 2: If I turn it into an LNbits extension, anyone could just use lnbits.com for it.