Daily
Export Discord members with a role to Google Sheets
A sheet listing every member of your Discord server who has a chosen role, refreshed each day.
- Runs
- Daily
- Apps
- Discord, Google Sheets
- AI
- Not needed
- Access
- Discord bot with Server Members intent; Sheets edit
Send this to your assistant
Create a ClickRuntime automation: every day, list all members of my Discord server with the Subscriber role and write them to my Members sheet.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A creator runs a paid community on Discord where supporters get a Subscriber role. To send perks, check who is still subscribed, or compare against the payment platform, she needs a list of who has the role. Discord shows it only by scrolling through the member list, and copying a few hundred names by hand takes an evening and is out of date the next day.
A daily refreshed sheet turns the role into a list you can sort, filter, share and match against other records, without anyone touching the Discord member list.
What you get out of it
A list you can actually work with
A sheet can be filtered, sorted and searched in ways the Discord member list cannot. It is ready for mail merges, perk deliveries and quick counts.
Always up to date
The sheet is rewritten every day, so people who gained or lost the role are reflected by the next morning. You never work from a stale export.
Easy to check against payments
Comparing the sheet with your billing list shows who has the role but is no longer paying, and who paid but never got the role. Both are easy to fix once you can see them.
Share without giving server access
A moderator or assistant can be given the sheet without admin rights in Discord. They get the information they need and nothing more.
No hand copying
Nobody scrolls through hundreds of members writing down names. The time goes to the community instead.
How it works
What happens, step by step
Every day, ClickRuntime looks up the role you chose in your Discord server.
It reads through every member of the server and keeps the ones who have that role.
It clears the sheet and writes the current list, one member per row.
If anything goes wrong, such as the bot losing access, you get an email.
Before it runs live
- Connect Discord
- Connect your Google Sheets account and pick the spreadsheets it may use
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 and Google Sheets steps into one automation
Under the hood
The code that runs this automation
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_trigger, credentials, http, notify
GUILD_ID = "your-server-id"
ROLE_NAME = "Subscriber"
SHEET_ID = "your-spreadsheet-id"
@on_trigger
def run(event):
api = "https://discord.com/api/v10"
h = {"Authorization": f"Bot {credentials.secret('DISCORD_BOT_TOKEN')}"}
try:
role = next(r["id"] for r in http.get(f"{api}/guilds/{GUILD_ID}/roles", headers=h).json() if r["name"] == ROLE_NAME)
rows, after = [], "0"
while True:
page = http.get(f"{api}/guilds/{GUILD_ID}/members", headers=h, params={"limit": 1000, "after": after}).json()
rows += [[m["user"]["id"], m["user"]["username"], m.get("nick") or m["user"].get("global_name") or "", m["joined_at"][:10]] for m in page if role in m["roles"]]
if len(page) < 1000:
break
after = page[-1]["user"]["id"]
except Exception as e:
notify.email_me("Discord member export failed", str(e))
raise
sheets = build("sheets", "v4", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False)
sheets.spreadsheets().values().clear(spreadsheetId=SHEET_ID, range="Members!A2:D").execute()
sheets.spreadsheets().values().update(spreadsheetId=SHEET_ID, range="Members!A2", valueInputOption="RAW", body={"values": rows}).execute()
return {"members": len(rows)}FAQ
Common questions
Does the bot need special permissions?
What columns does the sheet get?
Does it handle large servers?
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
Watch a list in Google Sheets and alert Discord when something changes
Sites, domains or prices you list in a sheet are checked every 30 minutes, the sheet shows the latest status, and Discord hears when one flips.
See how it worksWork through a content queue in Sheets and post results to Discord
Every hour, the next ready idea in your sheet becomes a draft script or caption, is saved back to the row and is posted to your Discord channel.
See how it worksPost new and changed sheet rows to Discord
Whenever a row in your sheet is added or changed, a formatted message appears in your Discord channel.
See how it worksKeep exploring
Set up “Export Discord members with a role to Google Sheets” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.