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.
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
Once a week, ClickRuntime goes through every member of your Discord server.
It keeps only the people who have the role you chose, such as Patron.
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
Build your own
Need it to work differently?
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
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?
Does the bot need a special setting to see members?
What columns are in the CSV?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Get told when an item is back in stock
Your server hears the moment a product page changes, like a sold-out item coming back.
See how it worksPost a weekly announcement in Discord
The same reminder goes out on time every week without anyone remembering to post it.
See how it worksClear out old messages every night
Busy channels like bot logs stay short, with messages older than a week removed.
See how it worksKeep exploring
Set up “Export everyone with a role” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.