Skip to content

louisedesadeleer/slack-assets-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

slack-assets-bot

slack-assets-bot

In an age of agentic video editing and AI-generated content, the thing that makes your work feel like yours is the taste you bring to your videos and content. The niche meme you remembered. The screenshot of that one tweet. The song only your audience will know. The sound effect that always lands.

This bot is a low-friction way to keep that library at hand. Drop anything into a Slack DM — files, YouTube links, image URLs — and it lands organized on your machine, named so Claude (or you) can find it later. Build the asset bank, then let the agents do the editing.


A personal Slack bot that turns your DMs into an asset library. Drop a file, paste a YouTube link, send any image URL — it sorts everything into category folders on your machine. You pick the categories during setup.

you  → 📎 screenshot.png        bot → ✓ ~/assets/screenshots/screenshot.png
you  → https://youtu.be/abc     bot → ✓ ~/assets/videos/title.mp4
                                      ✓ ~/assets/sounds/title.mp3
you  → name: kanye_laugh
       📎 reaction.png           bot → ✓ ~/assets/photos/kanye_laugh.png

What it does

  • Files route by mimetype — images go through a classifier (screenshot vs photo), videos to videos/, audio to sounds/.
  • YouTube links download both the .mp4 (videos/) and the .mp3 (sounds/).
  • Other URLs route by Content-Type — direct image/video/audio links work, web pages are ignored.
  • Rename on the fly by typing name: foo / rename: foo / save as foo in the message. Extension added automatically.
  • Project tagging — typing project: kanye-launch in the message routes the asset to ~/assets/projects/kanye-launch/<category>/ instead of the top-level category folder. Build asset bundles per video/campaign on the fly.
  • Auto-naming for images — files with generic names (CleanShot_…, Screenshot…, IMG_…) get a descriptive slug from Claude vision (e.g. team_dashboard.png, kanye_west_laughing.png) so AI assistants can find them later by name. Skipped when you provide a manual rename.
  • Private by default — the setup wizard asks who can use the bot (just you / specific teammates / whole workspace) and locks it down accordingly.

Image classification & auto-naming

Uploaded images get two passes:

Where to put it (folder):

  1. Filename pre-check — CleanShot*, Screenshot*, etc. → screenshots/; anything with logo, wordmark, favicon, app-icon in the name → logos/
  2. claude CLI vision call for everything else → picks from your enabled image folders (screenshots/, photos/, memes/, thumbnails/, logos/)
  3. Fallback: photos/

What to call it (filename), when AUTO_NAME_IMAGES=true:

  1. If you typed name: foo in the message → foo.ext
  2. If the original filename looks generic (CleanShot_2026…, IMG_1234, screenshot.png) → claude describes the image in 2–5 words → team_dashboard.png, kanye_west_laughing.png, iphone_settings_menu.png
  3. Otherwise the original name is kept

This makes the asset library searchable by content. Later, when editing in another tool, you (or another agent) can say "use the kanye meme" and it finds the file by name.

Don't have Claude Code? Both steps degrade — images all land in photos/ with original filenames. The bot still works.

Requirements

  • macOS or Linux (untested on Windows)
  • Python 3.10+
  • yt-dlp and ffmpeg on PATH (brew install yt-dlp ffmpeg)
  • A Slack workspace where you can install custom apps
  • Optional: Claude Code for image classification

Setup

1. Create the Slack app

  1. Go to https://api.slack.com/appsCreate New AppFrom manifest → pick your workspace.
  2. Paste the contents of manifest.yml. Click Create.
  3. Basic Information → scroll to App-Level TokensGenerate Token and Scopes → add connections:write → name it → copy the xapp-... token. That's your SLACK_APP_TOKEN.
  4. Install App → install to your workspace → copy the Bot User OAuth Token (xoxb-...). That's your SLACK_BOT_TOKEN.
  5. App Home → toggle Messages Tab ON and tick "Allow users to send Slash commands and messages from the messages tab".
  6. In Slack, find the bot in your sidebar and open a DM with it.

2. Install and configure

git clone https://github.com/louisedesadeleer/slack-assets-bot.git
cd slack-assets-bot
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python setup.py

The setup wizard asks you:

  • What to name your assets folder (default: ~/assets)
  • Which categories you want — checkbox list. Default 4: screenshots, photos, videos, sounds. Opt-in extras: memes, thumbnails, logos. Pick whichever fits how you organize stuff.
  • Your Slack tokens (from step 1)
  • Authorized Slack user IDs — leave empty for now if you don't know yours

It writes .env and creates the chosen folders.

3. Run the bot

python bot.py

You should see assets bot starting, saving to ....

4. Authorize yourself (if you picked "private" or "allowlist")

When a Slack app is installed in a workspace, any workspace member can DM it by default. Since this bot saves files to your computer, you almost certainly want to gate that. The setup wizard already asked which mode you want; here's how each one behaves:

Mode .env config Behavior
Private (just me) ALLOWED_SLACK_USERS=U01234ABCD Only listed user IDs can use the bot. Everyone else gets a polite refusal.
Specific teammates ALLOWED_SLACK_USERS=U01234,U05678,U09012 Same as above with multiple IDs.
Workspace-wide ALLOW_WORKSPACE=true Skips the check entirely. Use only if you're alone in the workspace.

If you don't know your Slack user ID:

  1. Start the bot with ALLOWED_SLACK_USERS= empty.
  2. DM the bot anything (e.g. "hi").
  3. It'll reply with Your Slack user ID is U01234ABCD.
  4. Paste that ID into .env, restart the bot.

To find a teammate's ID: open their profile in Slack → ⋮ menu → Copy member ID.

Now DM the bot a file or a link — it'll reply in-thread with the saved path.

5. Keep it running in the background (macOS)

python setup.py offers to install a LaunchAgent as its last step. Say yes and the bot:

  • Starts immediately
  • Auto-starts at every login
  • Auto-restarts within seconds if it crashes, your Mac sleeps, or the Python process dies for any reason

Logs go to bot.log in the repo. To stop it:

launchctl unload ~/Library/LaunchAgents/com.assetsbot.plist

To re-enable: launchctl load ~/Library/LaunchAgents/com.assetsbot.plist (or re-run python setup.py).

If you skipped this during setup, re-run python setup.py — it's idempotent and remembers your previous answers as defaults.

Message syntax

Rename

You type Result
name: kanye_laugh File saved as kanye_laugh.ext
rename: drake_pointing Same
save as: best_meme_ever Same
name=spongebob_yelling Same
save as kanye_laugh (at start of message, no colon) Same

Multiple files in one message with the same rename get _1, _2 suffixes. YouTube uses the same name for both the .mp4 and .mp3.

Project tagging

You type Result
📎 screenshot.png + morning routine video ~/assets/projects/morning-routine-video/screenshots/...
📎 hero.mp4 + kanye launch ~/assets/projects/kanye-launch/videos/hero.mp4
project: Q4 Brand Refresh + YouTube link ~/assets/projects/q4-brand-refresh/videos/...mp4 + .../sounds/...mp3
project=demo-2026 + image URL ~/assets/projects/demo-2026/photos/...

Smart detection: when you drop a file with a short caption (1–6 words, no URLs, no name: directive), the caption becomes the project name automatically. For URL-only messages, the explicit project: keyword is required (so commentary like "check this out" doesn't accidentally make a project).

Project names are slug-ified (lowercased, non-alphanumeric → -). Folders are created on demand. Combine freely with name::

project: kanye-launch  name: opening-shot
📎 hero.mp4
→ ~/assets/projects/kanye-launch/videos/opening-shot.mp4

Folder layout

The folder you picked during setup gets one subfolder per category you enabled, plus a projects/ namespace for project-tagged assets:

~/assets/
├── screenshots/                # untagged screenshots
├── photos/                     # untagged photos
├── videos/                     # untagged videos
├── sounds/                     # untagged sounds
└── projects/
    ├── kanye-launch/
    │   ├── screenshots/
    │   ├── videos/
    │   └── sounds/
    └── q4-brand-refresh/
        └── photos/

If you opt into memes, thumbnails, or logos during setup, those folders are added too. Project folders mirror whichever categories you enabled.

Pro tip: put ~/assets in your Finder sidebar

The bot is most useful when your asset library is one click away from any save dialog or browser download. Add the folder to Finder's sidebar Favorites once and you'll never hunt for it again:

  1. Open Finder (or wait for setup.py to do it for you on its last step).
  2. Navigate to your assets folder (~/assets by default).
  3. Drag the folder into the Favorites section of the left sidebar.

Now it shows up in every Save / Save As dialog, in the Finder sidebar, and in app file pickers — drop logos, photos, anything you grab off the web straight in without leaving the app you're in.

License

MIT

About

Drop assets into a Slack DM, the bot files them on your machine. In an age of agentic video editing and AI-generated content, your curated taste — memes, screenshots, sounds, clips — is what makes your work feel like yours.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages