Do you want to create a Discord Sales Bot for your NFT collection? With Helius Webhooks, you can do it for FREE in less than 20 minutes! In this blog post, we'll show you how to set up a Discord Sales Bot using Helius Webhooks, and if you’re interested, how to build it from scratch!
Hosting your own Sales Bot
Fork the discord-sales-bot repo
Visit this repository, and create a fork (located top right).
You can now change the name to anything you want, e.g your collection’s name:
Setting up the Discord Webhook
On the server you want to set the sales bot up on, head to server settings (you’ll need admin permissions).
Select Integrations from the menu:
Click New Webhook and adjust the settings as you see fit:
Now select Copy Webhook URL we can move on.
Deploying on Vercel
After creating the fork on your personal Github account, you can now visit Vercel and deploy the website. First, select this button on your dashboard:
Then import your fork:
You can now add your environmental variables:
- DISCORD_WEBHOOK is the URL you just copied from the discord server.
- HELIUS_KEY is what you’ll have gotten from the Helius Dashboard, video demo below:
Once deployed, you can view your domain, it’ll be the name of your repository (unless already taken), we take the domain e.g [discord-sales-bot.vercel.app](<http://discord-sales-bot.vercel.app>) and add to it “/api/webhook” - this is so that Helius knows where to send the data of the webhook - the final URL here would be:
Your personal URL might be [madlads-sales-bot.vercel.app/api/webhook](<http://madlads-sales-bot.vercel.app/api/webhook>) or etc.
Setting up the webhook
Now, head to the Helius Dashboard! Select the webhook section on the left, and you can add a new webhook. The network and webhook type should remain the same as shown in the image, being Mainnet and Enhanced. You can choose what types of transaction types you want included, here we’ll only allow NFT sales to be sent. The webhook URL will be the URL we just created, your deployed website + /api/webhook, e.g [madlads-sales-bot.vercel.app/api/webhook](<http://madlads-sales-bot.vercel.app/api/webhook>). Keep this tab open, we’ll find out how to select the right address to put into the Account Address field that the webhook will monitor.
Adding Account Address
We’ll start from an NFT, keep in mind some NFT collections may have been created from a different standard, which would change these steps, feel free to ask for help on the Helius Discord.
Starting from a solscan link pointing to an NFT (example below):
Select the Metadata section, and scroll until you see the creators property, then from the array, select the address with a share value of 100. You may see 1, 2, or however many creators, however normally only 1 creator will have a share value of 100. Copy this address, then head back to the Helius Dashboard. In this case, the address was HAryckvjyViFQEmhmMoCtqqBMJnpXEYViamyDhZUJfnG so we’ll copy it an paste into the dashboard like so:
Hit confirm, and you’re finished! Once a NFT from the collection is sold, you should receive a webhook message like so:
In this blog post, we showed you how to set up a Discord Sales Bot using Helius Webhooks. We hope you found this tutorial helpful!
Below is the table of contents and some key takeaways:
- You can fork the discord-sales-bot repo and deploy it on Vercel for free.
- You can use Helius Webhooks to set up a webhook that will send a message to your Discord channel whenever an NFT is sold.
- You can customize the message that is sent to your Discord channel.
We hope you enjoyed this blog post! If you have any questions or feedback, please feel free to visit the Discord.
Thank you for reading!