Skip to content

redpeacock78/tw-dl-bot

Repository files navigation

tw-dl-bot

DeepWiki Ask DeepWiki codecov

A Discord bot for downloading videos from Tweets.
Using Slash Commands (like /dl), you can send Tweet URLs to the bot, and it will trigger a GitHub Actions workflow to fetch the video and reply with the result directly in Discord.


Features

  • Discord Slash Commands support
  • Download single or multiple Tweet videos
  • Live progress updates: progress, success, and failure notifications
  • Asynchronous video processing powered by GitHub Actions
  • Built with Deno + TypeScript

Tech Stack


Setup

1. Environment Variables

Make sure these environment variables are set:

  • DISCORD_TOKEN – Discord Bot Token
  • DISPATCH_URLrepository_dispatch endpoint of your GitHub repository
  • GITHUB_TOKEN – GitHub Personal Access Token (for triggering Actions)

2. Run in Development

deno task dev

3. Build Executable

deno task build

Slash Commands

  • /dl url:<Tweet URL> Downloads one or more Tweet videos (space-separated URLs supported)
  • /dl-spoiler url:<Tweet URL> Same as /dl, but the resulting file is uploaded as a Discord spoiler attachment
  • /threaddl name:<Thread Name> Opens a Modal where you paste any number of Tweet URLs (one per line, or any combination of newlines / spaces / commas / semicolons), creates a thread with the given name, and posts each download result inside it; URLs are processed in parallel by a GitHub Actions matrix workflow
  • /threaddl-spoiler name:<Thread Name> Same as /threaddl, but every resulting file is uploaded with the SPOILER_ prefix

See docs/commands.md for the full command reference.


Workflow

  1. You run a Slash Command on Discord
  2. The bot triggers a repository_dispatch event in GitHub Actions
  3. A Docker container uses yt-dlp to download the video
  4. The result (video or error) is sent back to Discord

Development Helpers

  • deno lint Run code and text linting
  • deno task run Start the bot locally
  • deno task test / deno task test:coverage Run the Deno test suite (with optional coverage report) under tests/
  • docker/Dockerfile Defines the video processing runner image, shared by run.yml and run-thread.yml

Documentation

In-depth documentation lives under docs/:

日本語版ドキュメントは docs/jp/ を参照してください。


License

This project is licensed under the MIT License.