Skip to content

Instantly share code, notes, and snippets.

@ryuya0124
Last active May 18, 2025 13:37
Show Gist options
  • Select an option

  • Save ryuya0124/616258c8921ea70b56e13841968373d5 to your computer and use it in GitHub Desktop.

Select an option

Save ryuya0124/616258c8921ea70b56e13841968373d5 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Open Discord App
// @version 1.0.0
// @author ryuya
// @match https://discord.com/channels/*
// @downloadURL https://gist.github.com/ryuya0124/616258c8921ea70b56e13841968373d5/raw/Open%2520Discord%2520App.user.js
// @updateURL https://gist.github.com/ryuya0124/616258c8921ea70b56e13841968373d5/raw/Open%2520Discord%2520App.user.js
// @homepage https://gist.github.com/ryuya0124/616258c8921ea70b56e13841968373d5
// ==/UserScript==
if (window.location.pathname === '/redirect') return;
// Extract channel and message IDs from the Discord URL
const pathParts = window.location.pathname.split('/');
const channelId = pathParts[4];
const messageId = pathParts[5];
// Adjust the following line based on Discord's actual app URL structure
window.location.href = `discord://channel/${channelId}/${messageId}`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment