How to create a paid Discord membership

Authors: Lucas Pham, Matthew Lal

Introduction

Are you looking to monetize your community, increase engagement, and offer exclusive content to your most dedicated members? You're in the right place! This tutorial will walk you through the process of setting up a paid membership system for your Discord server using Buildship. 200M people use Discord daily!
Buildship has a growing library of workflows that you can use to create AI-powered perks, AI automation, integrations, and more, for your membership.
But first you need to get started, let’s get into it!

What You'll Learn

In this guide, we'll cover:
How to integrate Discord with Buildship
How to power a Discord bot with Railway to manage your Discord memberships
Setting up Stripe for payment processing
Customizing your membership tiers

Who This Tutorial Is For

This guide is perfect for:
Community managers looking to monetize their Discord server
Content creators wanting to offer exclusive perks to subscribers
Entrepreneurs aiming to build a paid community around their expertise

What You’ll Need

Buildship account (free)
Discord account (free)
Stripe account (free)
(free, with included credits sufficient to run your Discord bot 24/7 for 7 months)

Create Discord Bot

Step 1—Buildship Template

Buildship is great for quickly launching projects like this because of one-click template loading. For this project we’ll load , which includes the necessary flows to connect to Discord, Stripe, and Railway.

Step 2—Discord App

Then take note of the Bot token from here:
Screenshot 2024-10-04 at 11.13.22 AM.png
Take note of Application ID / Client ID for the Railway Deploy:
Screenshot 2024-10-04 at 11.14.51 AM.png
From the Buildship Remix take note of these 3 endpoints:
Update Role Endpoint:

Step 3—Deploy Railway Template

, and use the inputs above for the environment variables. Note you must already be .
Screenshot 2024-10-05 at 10.52.52 AM.png

Setup Discord Server

Step 1—Setup membership channels

To set up your Discord server with tiered channels and roles, start by using this . This template creates 3 private channels that we’ll assign to the 3 tiers of the membership in Stripe later. You can also use your existing Discord server with 3 private channels you want to include in this integration.
Once the server is created, turn on Developer Mode in Discord to access important information such as your GUILD_ID and the ROLE_ID and CHANNEL_ID for three specific roles and channels. These details will be essential when inputting values into Buildship nodes.
Right-click on the channel and server to obtain their IDs, and for role IDs, go to the server settings, navigate to the roles section, and click the three dots next to a role to obtain its ID.
Turning on Developer mode:
Screenshot 2024-10-04 at 12.53.29 AM.png
Screenshot 2024-10-04 at 12.56.17 AM.png
Screenshot 2024-10-04 at 12.58.47 AM.png
Get role ID:
Screenshot 2024-10-04 at 12.58.47 AM.png

Step 2—Install your Discord bot on your server

Install your Discord bot to the server and assign the roles with the necessary permissions: manage roles, view channels, create instant invites, and create events. This setup will streamline the management of your tiered server structure.
Go back to the dashboard for the Discord app you created earlier, and visit the Installation settings tab to copy the install link:
Screenshot 2024-10-05 at 11.00.09 AM.png
Visit the install link (paste it in your browser) to add your bot to your Discord server.

Use Buildship Workflow to create Stripe Product and Prices

Step 1—Create a Stripe subscription

We’re going to use Stripe so you can sell memberships to your Discord.
Use the Create Product and Prices Buildship workflow to set up a Stripe product with three subscription plans. You can do this by pressing the Test button in the top right of Buildship:
Screenshot 2024-10-04 at 11.21.25 AM.png
Be sure to input the Discord IDs for the guild, channels, and roles into the workflow's variables, defining the tier prices in cents for each plan. Once configured, generate a payment link for users to subscribe. The Discord IDs will be stored in the metadata of each Stripe Price for future integration with Discord roles and channels.
Screenshot 2024-10-04 at 11.24.15 AM.png
This workflow creates a Stripe Product with three pricing tiers, each corresponding to a different price.
Screenshot 2024-10-03 at 1.42.18 AM.png
Screenshot 2024-10-03 at 1.42.56 AM.png

Step 2—Setup the payment link to collect payment

Create a Stripe Payment Link for the Paid Discord Membership:
Screenshot 2024-10-03 at 1.21.34 AM.png
Screenshot 2024-10-03 at 10.14.11 AM.png
Screenshot 2024-10-03 at 1.22.22 AM.png

Remix the Buildship Template

Step 1—Modify Stripe Listener for Stripe events

If the checkout.session.completed event is not included in the Stripe Webhook events, make sure to manually add it. Once a checkout session is successfully completed, a Discord invite link will be generated to allow the user to join the guild. The invite code will then be stored within the created subscription, enabling you to later retrieve the subscription based on the invite code used to join the guild.
The workflow is also designed to listen for customer.subscription.updated and customer.subscription.deleted events from Stripe, enabling dynamic management of user roles. When these events occur, the user's role can be automatically adjusted based on the changes made to their subscription. This functionality ensures that users maintain access to the appropriate resources and permissions corresponding to their current subscription status.
Screenshot 2024-10-03 at 11.00.33 AM.png
Screenshot 2024-10-04 at 1.28.35 AM.png
checkout.session.completed Branch:
The channel ID is extracted from the price plan of the subscription, allowing for the creation of an invite code that customers can use to join the Discord server.
Screenshot 2024-10-03 at 1.26.07 AM.png
Store the Discord invite code in the subscription's metadata for future reference and access.
Screenshot 2024-10-03 at 1.26.39 AM.png
customer.subscription.updated Branch:
This node checks if a subscription is being updated due to a change in its plan, and return the corresponding Discord data accordingly.
Screenshot 2024-10-03 at 10.44.28 AM.png
If the subscription plan has been updated, this node utilizes the Discord data to remove the old role from the member's Discord role array and add the new role. This change ensures that the member gains access to the private channel associated with their new tier while preventing access to the private channel of the previous tier.
Screenshot 2024-10-03 at 10.49.07 AM.png
If the plan status has been updated—whether it transitions to inactive, becomes active, or experiences a pause or unpause in payment collection—this node will appropriately add or remove roles from the member. This ensures that the member's access aligns with their current subscription status, granting or revoking access to the relevant channels as necessary.
Screenshot 2024-10-03 at 11.00.57 AM.png
Screenshot 2024-10-03 at 11.01.24 AM.png
customer.subscription.deleted Branch:
When the customer.subscription.deleted event is triggered, the role associated with the canceled tiered subscription will be removed from the user's Discord role array. This action effectively prevents the user from accessing the private channel designated for that subscription tier, ensuring that their permissions within the Discord server are accurately aligned with their subscription status.
Screenshot 2024-10-03 at 10.36.43 AM.png

Step 2—Modify Event Listener for Discord Bot

Create a bot listener event to monitor when a new member joins the guild. Upon detecting a new member, the bot will send the member object to a Buildship endpoint designed to handle the logic for assigning the appropriate role to the new member. This ensures a seamless onboarding process and proper role management within the server.
Screenshot 2024-10-03 at 12.46.57 AM.png
The data sent to the Buildship workflow will look like this:
Screenshot 2024-10-04 at 1.18.34 AM.png

Step 3—Modify Buildship Workflow to add role to new member

This Buildship endpoint is designed to process data sent by the Discord bot when a new member joins the guild. Upon receiving this information, the endpoint will identify the invite code used by the new member and utilize it to locate the corresponding subscription that contains this invite code within its metadata. From this subscription, the associated Discord role ID will be retrieved from the price metadata. The user's Discord member ID will also be stored in the subscription for future reference. Subsequently, the user's roles will be updated by adding the new role to their existing roles array, thereby granting them access to the private channel linked to the tier they have subscribed to.
Screenshot 2024-10-03 at 1.51.52 AM.png
This nodes fetches invite code the user used to join the guild.
Screenshot 2024-10-03 at 1.30.58 AM.png
This node is designed to locate the subscription by searching for the subscription that includes the invite code used in its metadata. In addition to identifying the subscription, it will also store the Discord user's ID within the subscription's metadata for future reference. This ensures that the necessary user information is readily available for any subsequent operations or logic that may require it.
Screenshot 2024-10-03 at 1.52.20 AM.png
This node updates the new user's role to include the tier to which they have subscribed, granting them access to the private channel associated with that tier. By modifying the user's roles, it ensures that they can participate in exclusive content and interactions specific to their subscription level.
Screenshot 2024-10-04 at 11.14.09 AM.png

Congratulations! 🎉

You've successfully integrated Discord with Buildship with 24/7 hosting that’s free for 7 months, opening up a world of possibilities for your online community that no other platform or integration can match! Let's recap what you've accomplished and explore the exciting road ahead:
Set up a paid Discord membership
Integrated Discord with Buildship for enhanced functionality
Connected Stripe for seamless payment collection
With this foundation, you're now ready to:
Leverage AI to enhance member experiences
Create interactive learning opportunities
Develop unique features using Buildship's AI nodes
Remember, building a thriving community takes time and effort. Keep experimenting with new ideas, listen to your members' feedback, and don't hesitate to .
Ready to take your Discord community to the next level? Start implementing these tools today and watch your community engagement grow and paid membership grow!








Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.