This project aims to gate a Discord server/channels with Superfluid streams. Exclusive channel content and perks can be accessed by users who are streaming super tokens to the server admin account through the Superfluid protocol. This project also includes periodic checks to ensure that all users with the streamer
role are actively streaming to our server admin. If a user's stream is terminated or their flow rate is reduced, The bot will automatically remove the streamer
role from their account to prevent them from accessing our exclusive channels and perks until they start streaming again.
- A Discord account
- Understanding of the Superfluid protocol and how to stream tokens
- An Ethereum wallet with some tokens to stream. You can get some test tokens from the Superfluid faucet.
- Stream a minimum of
0.5DAIx/month
to the server admin account0x7348943c8d263ea253c0541656c36b88becd77b9
ongoerli
testnet. You can use the Superfluid app to do this.
-
Join the TechNow Discord Server: https://discord.gg/JEMFf5ux5M
-
Make sure you are streaming a minimum of
0.5 DAIx/month
to0x7348943c8d263ea253c0541656c36b88becd77b9
ongoerli
if you wanted to access exclusive stream gated channels. -
Open the
#start-here
channel on discord server. -
Type the command
/verify
in the channel. -
Our bot will send you a link to connect your wallet and sign a message.
-
After you sign the message, the bot will verify if a minimum of
0.5 DAIx/month
stream is present between your wallet address and the server admin address. -
If the stream is present, you will be assigned the
streamer
role and gain access to the exclusive channels and perks on the server. If the stream is not present, you will still be assigned themember
role, which will allow you access to the general channels on the server.
sf-discord-demo-final.mp4
- A Discord account
- A Discord server where you have permissions to manage roles and channels and add bots.
- An Ethereum wallet with some tokens to stream. You can get some test tokens from the Superfluid faucet.
- Create a new Discord server and create the necessary channels(
#start-here
,#superfluid-exclusive
,#general
) and roles(streamer
,member
).#start-here
channel should be the first channel in the server.#superfluid-exclusive
is the channel that we wanted to gate with stream. so make sure in the channelsettings
>permisions
, the@everyone
role does not have access to the channel. only thestreamer
role should have access to the channel. Also, Upon verifying with the wallet, regardless of whether a stream is present or not, amember
role will be added to the user. This member role will allow them access to the general channels in the server. So make sure in#general
channelsettings
>permisions
, the@everyone
role doesn't have access to the channel. only thestreamer
andmember
roles should have access to the channel.
- Create a new Discord bot at Discord Developer Portal with necessary permissions and invite it to the server.
-
Replace
.env.example
with.env
and fill in the environment variables. -
Install dependencies by running
npm install
in the root directory -
Sync the local schema to database by running
npx prisma db push
in the root directory -
Deploy slash commands by running
npm run commands:deploy
in the root directory -
Start the bot by running
npm start
in the root directory -
Test the bot by typing
/verify
in the#start-here
channel. -
If the bot is working correctly, you should see the
streamer
role being assigned to users(ofcourse only if they stream required amount) upon verifying wallet and the#superfluid-exclusive
channel being unlocked.
If you encounter any issues with the bot, please do the following:
- Check that the bot has the necessary permissions in the server (Manage Roles, Manage Channels, Manage Messages)
- Check that the environment variables have been set up correctly in the .env file
- Check the logs for any error messages
- Superfluid - A revolutionary asset streaming protocol that brings subscriptions, salaries, vesting, and rewards to DAOs and crypto-native businesses worldwide.
- Discord - A free communications app that lets you share voice, video, and text chat with friends, game communities, and developers.
- Discord.js - A powerful Node.js module that allows you to interact with the Discord API very easily.
This is experimental software and subject to change over time.
This is a proof of concept and is not ready for production use. It is not audited and has not been tested for security. Use at your own risk. I do not give any warranties and will not be liable for any loss incurred through any use of this codebase.
This project is licensed under the MIT License - see the LICENSE file for details