{% load crispy_forms_tags %}
Discord Integration

Let members join your club directly from Discord. When a user clicks a button in your server, they fill out a short form and are automatically added to your member list and granted a role.

Setup steps
  1. Create or invite your Discord bot to your server and give it the Manage Roles permission. The bot role must be placed above the roles it should assign.
  2. Register the interactions endpoint with your Discord application:
    Go to discord.com/developers/applications → your app → Interactions Endpoint URL and enter:
    {{ interactions_url }}
  3. Set your Discord public key in your .env file (DISCORD_PUBLIC_KEY) and restart the server.
  4. Create a welcome channel that only your bot and admins can see, then post a message there. Use the Discord developer portal or a slash command to add a button with custom_id = "join_button" to that message.
  5. Enter your Server ID below (Settings → Save) and click Fetch roles from Discord.
  6. Set the default role — this role will be assigned to members when they verify via Discord.
{% if club.discord_server_id %}
{% csrf_token %}
{% if roles %} {% for role in roles %} {% endfor %}
Role name Role ID Default?
{{ role.role_name }} {{ role.role_id }} {% if role.is_default %} Default {% endif %} {% if not role.is_default %}
{% csrf_token %}
{% endif %}
{% else %}

No roles fetched yet. Click Fetch roles from Discord above.

{% endif %} {% else %}
Enter and save your Discord Server ID (in the form above) to enable role management.
{% endif %}