Skip to content

Instantly share code, notes, and snippets.

@ryuya0124
Last active December 29, 2023 16:55
Show Gist options
  • Save ryuya0124/616258c8921ea70b56e13841968373d5 to your computer and use it in GitHub Desktop.
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/54c6620845fcb729d9b9955dad82d8a40125098c/Open%2520Discord%2520App.user.js
// @updateURL https://gist.github.com/ryuya0124/616258c8921ea70b56e13841968373d5/raw/54c6620845fcb729d9b9955dad82d8a40125098c/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