Skip to content

Every 15 minutes

Save Discord attachments to Google Drive

Every file shared in your Discord channel is copied to a Google Drive folder within 15 minutes, named with the channel, author and date.

Runs
Every 15 minutes
Apps
Discord, Google Drive
AI
Not needed
Access
bot Read Message History + Message Content intent; Drive drive.file

Send this to your assistant

Create a ClickRuntime automation: every 15 minutes, copy new attachments posted in my Discord channel into a Google Drive folder.

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

A game studio's artists share concept sketches, screenshots and audio clips in a Discord channel throughout the day. Months later, someone needs the version of a character sketch from spring, and it means scrolling back through thousands of messages. Some old links no longer even load, because Discord's file links expire.

Copying each file to Google Drive as soon as it is shared gives the team a searchable, permanent archive, organised by who posted it and when.

What you get out of it

  • Files that do not disappear

    Discord links to attachments can expire. A copy in Drive stays available for as long as you keep it.

  • Find anything in seconds

    Files are named with the channel, author and date. A Drive search finds last spring's sketch instead of an afternoon of scrolling.

  • One place for shared work

    Everything posted in the channel ends up in one folder. It can be shared with clients or colleagues who are not in your Discord.

  • Nobody has to remember to upload

    People keep sharing work the way they already do. The archive builds itself in the background.

  • Each file copied once

    Messages already handled are skipped, so the folder holds no duplicates even though the channel is checked every 15 minutes.

How it works

What happens, step by step

  1. Every 15 minutes, ClickRuntime reads the messages posted in your Discord channel since the last check.

  2. It picks out any message with a file attached, remembering the last message it saw so nothing is copied twice.

  3. It downloads each file straight away, before Discord's link expires.

  4. Each file is saved to your Google Drive folder, named with the channel, author and date.

Before it runs live

  • Connect Discord
  • Connect Google Drive

What you get

RunsEvery 15 minutes
Save Discord attachments to Google Drivetoday, 9:00Succeeded
Google Drive · Discord archiveart-priya-2026-10-19-castle-concept-v3.png saved

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

  • Act only on the items that match your own rules, and skip the rest
  • 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 Drive 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.
archive_discord_attachments_to_drive.pyexample
import io
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from googleapiclient.http import MediaIoBaseUpload
from clickruntime import on_trigger, credentials, http, state, report_fetched

CHANNEL_ID = "your-discord-channel-id"
CHANNEL_NAME = "art"
FOLDER_ID = "your-drive-folder-id"

@on_trigger
def run(event):
    after = state.get("after") or "0"
    msgs = http.get(f"https://discord.com/api/v10/channels/{CHANNEL_ID}/messages", params={"after": after, "limit": 100},
                    headers={"Authorization": f"Bot {credentials.secret('DISCORD_BOT_TOKEN')}"}).json()
    files = [(m, a) for m in msgs for a in m.get("attachments", [])]
    report_fetched(len(files))
    if not files:
        return {"summary": "Nothing new"}
    drive = build("drive", "v3", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False)
    for m, a in files:
        data = http.get(a["url"]).content
        name = f"{CHANNEL_NAME}-{m['author']['username']}-{m['timestamp'][:10]}-{a['filename']}"
        media = MediaIoBaseUpload(io.BytesIO(data), mimetype=a.get("content_type", "application/octet-stream"))
        drive.files().create(body={"name": name, "parents": [FOLDER_ID]}, media_body=media, fields="id").execute()
    state.set("after", max(msgs, key=lambda m: int(m["id"]))["id"])
    return {"summary": f"{len(files)} files saved"}

FAQ

Common questions

What does the bot need in Discord?
The bot must be in your server with Read Message History in the channel, and the Message Content intent turned on in the Discord developer portal so it can see attachments.
How are the files named in Drive?
Each file name starts with the channel, the author's username and the date, followed by the original file name, for example art-priya-2026-10-19-sketch.png.
Are large files supported?
Yes, any file Discord allows in a message can be copied. Very large video files simply take a little longer to upload.
What permissions does it need?
bot Read Message History + Message Content intent; Drive drive.file. 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 checks. Checks that find nothing new 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 “Save Discord attachments to Google Drive” from your assistant

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