mirror of
https://github.com/Vendicated/Vencord.git
synced 2025-01-10 18:06:22 +00:00
change name, update code and readme
This commit is contained in:
parent
8b4fe6e95f
commit
e648bf92e2
4 changed files with 73 additions and 54 deletions
14
src/plugins/extraConnectionLinks/README.md
Normal file
14
src/plugins/extraConnectionLinks/README.md
Normal file
|
@ -0,0 +1,14 @@
|
|||
# ExtraConnectionLinks
|
||||
|
||||
Adds the Open Profile button to connections that don't natively have it in the regular Discord client.
|
||||
## Supported Platforms
|
||||
* Xbox
|
||||
* Roblox
|
||||
## Planned Platforms
|
||||
* None as of currently
|
||||
## Platforms that will never be supported
|
||||
* Riot Games/League of Legends (Nothing made by Riot Games to view profiles online)
|
||||
* Battle.net (Nothing made by Blizzard to view profiles online)
|
||||
* Bungie.net (Nothing made by Bungie.net to view profiles online)
|
||||
* Epic Games (Nothing made by Epic Games to view profiles online)
|
||||
* PSN/PlayStation Network (Sony built a service called My PlayStation, but removed it for unknown reasons in 2021)
|
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";
|
||||
|
||||
/**
|
||||
* platforms that dont open natively
|
||||
* ! riot and leage (can't view profiles)
|
||||
* ! epic (can't view profiles)
|
||||
* ! psn (can't view profiles after sony removed My PlayStation)
|
||||
* * roblox (Added)
|
||||
* * xbox (Added)
|
||||
* ! battle.net (can't view profiles)
|
||||
* ! bungie.net (can't view profiles)
|
||||
* ! facebook (don't have discord access token for facebook connection)
|
||||
**/
|
||||
|
||||
/** */
|
||||
enum contypes {
|
||||
Roblox = "Roblox",
|
||||
Xbox = "Xbox",
|
||||
}
|
||||
|
||||
const uris = { // name (what shows up on connection on ui), id (an identifier thing)
|
||||
[contypes.Roblox]: "https://www.roblox.com/users/${id}/profile",
|
||||
[contypes.Xbox]: "https://www.xbox.com/play/user/${name}",
|
||||
};
|
||||
|
||||
const serviceNames = { // What the name part in the discord code calls it.
|
||||
[contypes.Roblox]: "Roblox",
|
||||
[contypes.Xbox]: "Xbox",
|
||||
};
|
||||
|
||||
export default definePlugin({
|
||||
name: "ExtraConnectionLinks",
|
||||
description: "Adds the Open Profile button to connections that don't natively have it in the regular Discord client.",
|
||||
authors: [Devs.coopeeo],
|
||||
patches: makePatches(),
|
||||
});
|
||||
|
||||
|
||||
function makePatches() {
|
||||
return Object.keys(contypes)
|
||||
.filter(v => isNaN(Number(v)))
|
||||
.map(key => {
|
||||
const contype = contypes[key as keyof typeof contypes];
|
||||
return {
|
||||
find: "getPlatformUserUrl:",
|
||||
replacement: {
|
||||
match: new RegExp(`(?<=${serviceNames[contype]}",.*},.+)(?=},)`),
|
||||
replace: `, getPlatformUserUrl:e=>{let {name, id} = e; return \`${uris[contype]}\`;}`
|
||||
}
|
||||
};
|
||||
});
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
# OpenMoreConnections
|
||||
|
||||
Adds the Open Profile button to connections that don't natively have it in the regular Discord client.
|
||||
## Supported Platforms
|
||||
* Xbox
|
||||
* Roblox
|
||||
## Planned Platforms
|
||||
* PSN
|
||||
## Platforms that will never be supported
|
||||
* Riot Games/League of Legends
|
||||
* Battle.net
|
||||
* Epic Games
|
|
@ -1,42 +0,0 @@
|
|||
/*
|
||||
* 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";
|
||||
|
||||
//* platforms that dont open
|
||||
//* riot and leage (can't view profiles)
|
||||
//* epic (can't view profiles)
|
||||
//* psn (can't view profiles but I have a workaround for 3rd party stuff)
|
||||
//* roblox
|
||||
//* xbox
|
||||
//* battle.net (can't view profiles)
|
||||
|
||||
const uris = { // name = t, and id = l
|
||||
roblox: "https://www.roblox.com/users/${l}/profile",
|
||||
xbox: "https://www.xbox.com/play/user/${t}"
|
||||
};
|
||||
export default definePlugin({
|
||||
name: "OpenMoreConnections",
|
||||
description: "Adds the Open Profile button to connections that don't natively have it in the regular Discord client. Supported Platforms: Xbox, and Roblox. Planned Platforms: PSN. Platforms that will never be supported: Riot Games/League of Legends, Battle.net, and Epic Games",
|
||||
authors: [Devs.coopeeo],
|
||||
patches: [
|
||||
{
|
||||
find: "getPlatformUserUrl:e=>",
|
||||
replacement: {
|
||||
match: /(?<=Roblox",.*},.+)(?=},)/,
|
||||
replace: `, getPlatformUserUrl:e=>{let {name:t, id:l} = e; return \`${uris.roblox}\`;}`
|
||||
}
|
||||
},
|
||||
{
|
||||
find: "getPlatformUserUrl:e=>",
|
||||
replacement: {
|
||||
match: /(?<=Xbox",.*},.+)(?=},)/,
|
||||
replace: `, getPlatformUserUrl:e=>{let {name:t, id:l} = e; return \`${uris.xbox}\`;}`
|
||||
}
|
||||
}
|
||||
],
|
||||
});
|
Loading…
Reference in a new issue