Skip to content

Weekly

Export everyone with a role

Every week you get a list of the members who hold a given role, ready to use.

Runs
Weekly
Apps
Discord
AI
Not needed
Access
Server Members intent

Send this to your assistant

Create a ClickRuntime automation: every Monday, email me a CSV of everyone in my Discord server with the Patron role.

Paste it into your assistant. It tells you what it will send or change before it runs live.

First time? Adding ClickRuntime to your assistant takes about two minutes.

Why use it

Why teams use this automation

An admin of a paid community or large server needs to know exactly who holds the Supporter role, who the moderators are, or which members earned a certain badge. Discord shows roles one member at a time, and its member list cannot be exported. Producing a list for a billing check, a giveaway or a handover to a new admin means scrolling and copying names by hand, and the list is out of date the moment it is finished.

Each week the automation pages through your server's members, keeps those who hold the role ID you specify and emails a CSV with the names and IDs. You always have a current copy sitting in your inbox, ready to open in a spreadsheet and sort or filter however you like.

Community admins, subscription communities and anyone running giveaways or events for members with a particular role will want it.

What you get out of it

  • Reconcile paid roles against billing

    Comparing the Supporter list with your payment records shows who pays but lacks the role, and who has the role without paying. Fixing both stops lost revenue and unhappy paying members who were never given what they bought.

  • Run fair giveaways

    A fresh export of eligible members means a draw is made from the right people. That avoids arguments about who should have been included, and the dated file is proof of exactly who was eligible when the winner was picked.

  • Clean handovers between admins

    A new moderator inherits a dated list of who holds important roles, instead of a vague description and a long scroll through the member panel. Nothing depends on the previous admin remembering who was trusted with what.

  • Weekly snapshots of who held a role

    Because each export is dated, you can look back and see when a member held a role. That is useful when investigating a past incident or confirming that a former moderator no longer has any access.

  • A spreadsheet without manual work

    The CSV opens directly in a spreadsheet for sorting and filtering. That saves the hour that copying names by hand would take, and it removes the typos that creep in when someone retypes a username.

How it works

What happens, step by step

  1. Once a week, ClickRuntime goes through every member of your Discord server.

  2. It keeps only the people who have the role you chose, such as Patron.

  3. You get an email with the member count and a CSV of their usernames, nicknames and join dates.

Before it runs live

  • Connect Discord

What you get

RunsWeekly
Export everyone with a roletoday, 9:00Succeeded
Email · Patron membersPatron role: 57 members user_id,username,nickname,joined_at

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • Your own rules

    Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.

  • Any number of apps

    One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.

  • AI where it helps

    Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.

  • On a schedule or on each event

    Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.

Changes you can ask for

  • Run it at a different time, more or less often, or only on weekdays
  • Add an AI step, for example to summarize, sort or draft a reply
  • Add another app, for example also send it to Slack
  • Combine it with other Discord steps into one automation

Under the hood

The code that runs this automation

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
role_member_list_export.pyexample
import csv, io
from clickruntime import on_trigger, http, credentials, notify

GUILD = "GUILD_ID"
PATRON_ROLE = "PATRON_ROLE_ID"

def discord(method, path, **kw):
    r = http.request(method, f"https://discord.com/api/v10{path}",
                     headers={"Authorization": f"Bot {credentials.secret('DISCORD_BOT_TOKEN')}"}, **kw)
    r.raise_for_status()
    return r.json() if r.content else None

@on_trigger
def run(event):
    members, after = [], "0"
    while True:
        page = discord("GET", f"/guilds/{GUILD}/members", params={"limit": 1000, "after": after})
        members += page
        if len(page) < 1000:
            break
        after = page[-1]["user"]["id"]
    patrons = [m for m in members if PATRON_ROLE in m["roles"]]
    out = io.StringIO()
    w = csv.writer(out)
    w.writerow(["user_id", "username", "nickname", "joined_at"])
    for m in patrons:
        w.writerow([m["user"]["id"], m["user"]["username"], m.get("nick") or "", m["joined_at"]])
    notify.email_me(f"Patron role: {len(patrons)} members", out.getvalue())
    return {"patrons": len(patrons)}

FAQ

Common questions

How do I find a role's ID?
Turn on Developer Mode in Discord's advanced settings, then right-click the role in the server settings and choose Copy Role ID. Give that number to your AI assistant, which uses it to filter the members down to the people holding that role.
Does the bot need a special setting to see members?
Yes. Listing all members requires the Server Members privileged intent to be enabled for the bot in the Discord developer portal. Without it, the list will be incomplete or the request will fail, and the run log will say so.
What columns are in the CSV?
The file includes each member's username, display name and user ID, and it can include when they joined the server. If you need extra columns, such as other roles they hold, say so and your AI assistant can add them to the export.
What permissions does it need?
Server Members intent. Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's AI allowance.
How many runs does it use?
One run each time it runs (weekly). Checks that find nothing to do and stop right away aren't counted.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

Set up “Export everyone with a role” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.