https://github.com/redpeacock78/tw-dl-bot
Discord bot to download Twitter videos via Slash Commands
https://github.com/redpeacock78/tw-dl-bot
automation deno discord discord-bot docker githib-actions hono twitter twitter-downloader typescript yt-dlp
Last synced: about 1 month ago
JSON representation
Discord bot to download Twitter videos via Slash Commands
- Host: GitHub
- URL: https://github.com/redpeacock78/tw-dl-bot
- Owner: redpeacock78
- License: mit
- Created: 2023-08-28T13:33:11.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2026-05-09T07:17:44.000Z (about 2 months ago)
- Last Synced: 2026-05-09T07:21:27.125Z (about 2 months ago)
- Topics: automation, deno, discord, discord-bot, docker, githib-actions, hono, twitter, twitter-downloader, typescript, yt-dlp
- Language: TypeScript
- Homepage: https://discord.com/api/oauth2/authorize?client_id=1145620099332579399&permissions=1067299887168&scope=bot
- Size: 468 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tw-dl-bot
[](https://deepwiki.com/redpeacock78/tw-dl-bot) [](https://deepwiki.com/redpeacock78/tw-dl-bot) [](https://codecov.io/gh/redpeacock78/tw-dl-bot)
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
- [Deno](https://deno.land/) + TypeScript
- [discordeno](https://deno.land/x/discordeno)
- [Hono](https://hono.dev/) for lightweight web routing
- [Deno test](https://docs.deno.com/runtime/fundamentals/testing/) + [`@std/assert`](https://jsr.io/@std/assert) for the test suite
- GitHub Actions + Docker for background jobs
- yt-dlp for video downloading
---
## Setup
### 1. Environment Variables
Make sure these environment variables are set:
- `DISCORD_TOKEN` – Discord Bot Token
- `DISPATCH_URL` – `repository_dispatch` endpoint of your GitHub repository
- `GITHUB_TOKEN` – GitHub Personal Access Token (for triggering Actions)
### 2. Run in Development
```bash
deno task dev
````
### 3. Build Executable
```bash
deno task build
```
---
## Slash Commands
* `/dl url:`
Downloads one or more Tweet videos (space-separated URLs supported)
* `/dl-spoiler url:`
Same as `/dl`, but the resulting file is uploaded as a Discord spoiler attachment
* `/threaddl 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:`
Same as `/threaddl`, but every resulting file is uploaded with the `SPOILER_` prefix
See [`docs/commands.md`](./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/):
* [`docs/architecture.md`](./docs/architecture.md) — system overview and data flow
* [`docs/commands.md`](./docs/commands.md) — slash command reference
* [`docs/development.md`](./docs/development.md) — local setup, env vars, GitHub token scopes
* [`docs/deployment.md`](./docs/deployment.md) — runner image and bot deployment
* [`docs/github-actions.md`](./docs/github-actions.md) — `repository_dispatch` payload, callback API, secrets
日本語版ドキュメントは [`docs/jp/`](./docs/jp/) を参照してください。
---
## License
This project is licensed under the [MIT License](./LICENSE).