mirror of
https://github.com/Vendicated/Vencord.git
synced 2024-09-20 06:30:35 +00:00
Merge f62795da6d
into b875ebf92d
This commit is contained in:
commit
0e2f3ce4f1
3 changed files with 84 additions and 0 deletions
21
src/plugins/extraConnectionLinks/README.md
Normal file
21
src/plugins/extraConnectionLinks/README.md
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
# ExtraConnectionLinks
|
||||||
|
Allows you to open more connections in browser!
|
||||||
|
|
||||||
|
### Before
|
||||||
|
![Shows the Roblox connection in the Discord client without the open profile button (the default).](https://github.com/Vendicated/Vencord/assets/73203995/734efd94-c61a-4f90-987d-3a4bbcc9311f)
|
||||||
|
### After
|
||||||
|
![Shows the Roblox connection in the Discord client with the open profile button.](https://github.com/Vendicated/Vencord/assets/73203995/eef59d09-78d9-4859-b722-242fc6aa7c8e)
|
||||||
|
|
||||||
|
## Platform Status
|
||||||
|
### Supported Platforms
|
||||||
|
* Xbox
|
||||||
|
* Epic Games
|
||||||
|
### Platforms that will never be supported
|
||||||
|
* Riot Games (Nothing made by Riot Games to view profiles online)
|
||||||
|
* League of Legends (Same as above since it's the same company)
|
||||||
|
* Battle.net (Nothing made by Blizzard to view profiles online)
|
||||||
|
* Bungie.net (Nothing made by Bungie.net to view profiles online)
|
||||||
|
* PlayStation Network (Sony built a service called My PlayStation, but removed it for unknown reasons in 2021)
|
||||||
|
* Facebook
|
||||||
|
* Crunchyroll (can't view other peoples profiles nor your own profile)
|
||||||
|
* Amazon Music (nothing references to the actual amazon music user id in discord.)
|
59
src/plugins/extraConnectionLinks/index.ts
Normal file
59
src/plugins/extraConnectionLinks/index.ts
Normal file
|
@ -0,0 +1,59 @@
|
||||||
|
/*
|
||||||
|
* Vencord, a Discord client mod
|
||||||
|
* Copyright (c) 2024 Cooper/coopeeo, Vendicated and contributors
|
||||||
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { Devs } from "@utils/constants";
|
||||||
|
import definePlugin from "@utils/types";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* All the connection types implemented into this plugin
|
||||||
|
*/
|
||||||
|
enum connectionTypes {
|
||||||
|
Roblox,
|
||||||
|
Xbox,
|
||||||
|
Epic,
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The uri to use.
|
||||||
|
* There are also two variables that you can use, name and id.
|
||||||
|
* The "name" is what shows up when viewing a connection on a discord profile.
|
||||||
|
* The "id" is the identifier of the account connected, the type depends on the service connected.
|
||||||
|
* @example [connectionTypes.Xbox]: "https://www.xbox.com/play/user/${name}",
|
||||||
|
* @example [connectionTypes.Roblox]: "https://www.roblox.com/users/${id}/profile",
|
||||||
|
*/
|
||||||
|
const uris = { // name (what shows up on connection on ui), id (an identifier thing)
|
||||||
|
//[connectionTypes.Roblox]: "https://www.roblox.com/users/${id}/profile",
|
||||||
|
[connectionTypes.Xbox]: "https://www.xbox.com/play/user/${name}",
|
||||||
|
[connectionTypes.Epic]: "https://store.epicgames.com/u/${id}",
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* What discord has the service named as.
|
||||||
|
* @example [connectionTypes.Epic]: "Epic Games",
|
||||||
|
*/
|
||||||
|
const serviceNames = {
|
||||||
|
//[connectionTypes.Roblox]: "Roblox",
|
||||||
|
[connectionTypes.Xbox]: "Xbox",
|
||||||
|
[connectionTypes.Epic]: "Epic Games",
|
||||||
|
};
|
||||||
|
|
||||||
|
export default definePlugin({
|
||||||
|
name: "ExtraConnectionLinks",
|
||||||
|
description: "Allows you to open more connections in browser!",
|
||||||
|
authors: [Devs.coopeeo],
|
||||||
|
patches: Object.keys(connectionTypes)
|
||||||
|
.filter(v => isNaN(Number(v)))
|
||||||
|
.map(key => {
|
||||||
|
const connectionTypeSelected = connectionTypes[key as keyof typeof connectionTypes];
|
||||||
|
return {
|
||||||
|
find: "getPlatformUserUrl:",
|
||||||
|
replacement: {
|
||||||
|
match: new RegExp("(r"),
|
||||||
|
replace: `, getPlatformUserUrl:e=>{let {name, id} = e; return \`${uris[connectionTypeSelected]}\`;}`
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}),
|
||||||
|
});
|
|
@ -531,6 +531,10 @@ export const Devs = /* #__PURE__*/ Object.freeze({
|
||||||
name: "Antti",
|
name: "Antti",
|
||||||
id: 312974985876471810n
|
id: 312974985876471810n
|
||||||
},
|
},
|
||||||
|
coopeeo: {
|
||||||
|
name: "Cooper",
|
||||||
|
id: 594864203102158859n
|
||||||
|
},
|
||||||
Joona: {
|
Joona: {
|
||||||
name: "Joona",
|
name: "Joona",
|
||||||
id: 297410829589020673n
|
id: 297410829589020673n
|
||||||
|
|
Loading…
Reference in a new issue