No description
  • TypeScript 93.4%
  • JavaScript 5%
  • Shell 1.4%
  • CSS 0.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Mobby 7e65d335a4
Some checks failed
Shiggy release / release (push) Failing after 50s
feat: add RG Embeds for Vencord and ShiggyCord
2026-10-19 02:24:52 +03:00
.forgejo/workflows feat: add RG Embeds for Vencord and ShiggyCord 2026-10-19 02:24:52 +03:00
docs feat: add RG Embeds for Vencord and ShiggyCord 2026-10-19 02:24:52 +03:00
scripts feat: add RG Embeds for Vencord and ShiggyCord 2026-10-19 02:24:52 +03:00
src feat: add RG Embeds for Vencord and ShiggyCord 2026-10-19 02:24:52 +03:00
tests feat: add RG Embeds for Vencord and ShiggyCord 2026-10-19 02:24:52 +03:00
.gitignore feat: add RG Embeds for Vencord and ShiggyCord 2026-10-19 02:24:52 +03:00
eslint.mobile.config.mjs feat: add RG Embeds for Vencord and ShiggyCord 2026-10-19 02:24:52 +03:00
LICENSE feat: add RG Embeds for Vencord and ShiggyCord 2026-10-19 02:24:52 +03:00
package-lock.json feat: add RG Embeds for Vencord and ShiggyCord 2026-10-19 02:24:52 +03:00
package.json feat: add RG Embeds for Vencord and ShiggyCord 2026-10-19 02:24:52 +03:00
README.md feat: add RG Embeds for Vencord and ShiggyCord 2026-10-19 02:24:52 +03:00
THIRD_PARTY_NOTICES.md feat: add RG Embeds for Vencord and ShiggyCord 2026-10-19 02:24:52 +03:00
tsconfig.json feat: add RG Embeds for Vencord and ShiggyCord 2026-10-19 02:24:52 +03:00
tsconfig.shiggy.json feat: add RG Embeds for Vencord and ShiggyCord 2026-10-19 02:24:52 +03:00

RG Embeds

Discord link rewriting for Vencord/Vesktop and ShiggyCord on Android. ShiggyCord also repairs existing incoming RedGifs video embeds locally; broader preview repair is available on Vencord.

For Android installation and debugging, see ShiggyCord setup.

Install on ShiggyCord

Paste this link into ShiggyCord Settings → Plugins → Install, then enable RG Embeds:

Install RG Embeds

Disable ShiggyCord’s built-in FixEmbed first. Keep plugin updates enabled to receive published builds through the same link. See ShiggyCord setup for development and troubleshooting.

Architecture

The framework-neutral application core owns configuration, provider selection, and rewriting. Host integrations implement limited ports for configuration, message interception, and provider-specific network access. Vencord-specific settings, hooks, native requests, and console globals live under src/adapters/vencord/.

Services, proxy deployments, replacer protocols, and capabilities are separate concepts. In particular, FxEmbed is one reusable replacer with service-specific Twitter and Bluesky bindings; adding another compatible deployment is primarily catalog data. This gives us practical source compatibility, not a universal Discord-mod ABI: other client mods get explicit thin adapters.

See docs/architecture.md for dependency rules and extension recipes. Dynamic post-send replacement and local replacement previews for existing messages are implemented.

Supported services

The plugin rewrites links just before send or edit. Every service has a provider dropdown and a Disabled choice:

  • X/Twitter: FxEmbed and its vanity deployments, BetterTwitFix, TwitterEZ, EmbedEZ
  • Bluesky: FxEmbed, VixBluesky, FixBluesky, bskye, vxBsky, boobsky
  • Instagram: InstaFix and other existing fixers, EmbedEZ, KKInstagram, vxInstagram, InstaEmbedRouter, OGInstagram
  • TikTok: fxTikTok and other existing fixers, EmbedEZ, KKTikTok
  • Reddit: FixReddit, vxReddit and other existing fixers, EmbedEZ
  • Twitch clips: FxTwitch
  • RedGifs: official metadata API to direct HD media, with Delay, Auto, and Immediate delivery modes
  • Pixiv: Phixiv
  • FurAffinity: xFurAffinity, FxRaffinity
  • Iwara: FxIwara
  • Facebook: EmbedEZ, FxFacebook, Facebed
  • Bilibili and Bilibili Opus: FxBilibili, EmbedEZ, BiliFix
  • Tumblr: FxTumblr
  • Threads: FixThreads, vxThreads, FixEmbed
  • PTT: FxPTT
  • DeviantArt: FxDeviantArt
  • Pinterest: EmbedEZ
  • YouTube: Koutube (disabled by default)

Kemono post URLs are recognized, matching Embed Fixer's catalog, but remain disabled because the upstream implementation extracts media rather than supplying a proxy URL. That requires a separate dynamic resolver and is not silently approximated here.

Proxy availability is external and can change. Selecting a proxy means Discord and people opening the rewritten URL interact with that third-party service.

On Vencord, for messages from other users, recognized source and proxy links are resolved locally and projected through Discord's normal embed renderer without changing the message. Native embeds remain in place until a replacement preview succeeds. Suppressed <URL> links and links beyond Discord's ten visible-embed slots are ignored.

Replacers are behavior, not hostname maps. Each receives the original domain, origin, complete URL, service discriminator, and that service's typed options, then returns a complete replacement URL. Proxy bindings provide the deployed hosts and advertise capabilities. FxEmbed additionally exposes presentation modes and translation for X/Twitter and Bluesky.

The expanded service/provider catalog and related URL parsing behavior are adapted from seriaati/embed-fixer; see THIRD_PARTY_NOTICES.md for attribution and licensing details.

Local setup

Prerequisites: Git, Node 22 or newer, and a Vesktop or Discord test install. This repository vendors upstream tools under vendor/; they are deliberately excluded from Git.

npm run bootstrap
npm test
npm run build

The bootstrap script checks out Vencord in vendor/Vencord, installs its pinned pnpm dependencies, and mirrors this plugin into vendor/Vencord/src/userplugins/rgEmbeds.

If a Discord or Vesktop update causes breakage, update the vendored Vencord build and validate this plugin against it with:

npm run update-vencord

The updater refuses to overwrite tracked changes inside vendor/Vencord, fetches and fast-forwards to upstream main, installs Vencord's pinned toolchain and dependencies, runs the complete RG Embeds checks, and builds the development bundle. Fully quit Vesktop, including its tray process, and reopen it after the command succeeds.

For a fast edit/build loop:

npm run dev

The one-shot development build includes development tools such as PatchHelper. A rebuild does not always hot-reload a running client; use Ctrl+R in Vesktop after a changed build.

npm run dev registers a source watcher before its initial copy, then serializes each complete copy with a one-shot pnpm build --dev. Changes during copying or compilation coalesce into another pass. A failed copy never starts a build; a later source change retries. Shutdown closes the watcher and forwards the signal to the active build. This deliberately avoids upstream --watch, whose independent compiler could observe a partial copied tree. Rebuilding a complete development bundle costs more than upstream incremental watch; one-shot --dev uses minified output and external source maps; upstream --watch uses unminified output and inline maps. Do not run another sync/build command concurrently with this loop. The copied directory is generated; edit only the top-level src/ files. Mobile sources are excluded from the desktop copy.

Vesktop Flatpak

For the dev.vencord.Vesktop Flatpak, grant persistent read-only access to the generated build once:

flatpak override --user dev.vencord.Vesktop \
  --filesystem="$(pwd)/vendor/Vencord/dist:ro"

Then open Vesktop Settings, set Vencord Location to the absolute vendor/Vencord/dist directory, fully quit Vesktop, and restart it. This explicit step is not automated because it changes Flatpak permissions and Vesktop state.

Debugging and console REPL

Enable Vencord's built-in ConsoleShortcuts plugin and RG Embeds. Open Chromium DevTools in Vesktop (Ctrl+Shift+I) and use:

await RgEmbeds.rewrite("https://x.com/example/status/123")
RgEmbeds.configuration()
RgEmbeds.proxies()

The DevTools console is the most useful REPL because it runs in Discord's renderer and can inspect live messages, React, Flux stores, and webpack modules. ConsoleShortcuts adds convenient globals; PatchHelper helps develop webpack patches. Treat anything pasted into this console as fully trusted code with access to your logged-in client.

Each supported service has a provider selector in the plugin settings, including a Disabled option. The static service and proxy catalogs are available through RgEmbeds.services() and RgEmbeds.proxies(). Rewrite results include provenance receipts for debugging and the planned embed-health workflow. Custom per-service domains are supported; custom Twitter and Bluesky providers may additionally opt into the FxEmbed protocol.