Apply suggestions from code reviews

Co-authored-by: Nuckyz <61953774+Nuckyz@users.noreply.github.com>
This commit is contained in:
Cooper 2024-09-05 10:20:48 -05:00 committed by GitHub
parent 70d49a97c9
commit cb4071a3ce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 6 deletions

View file

@ -17,6 +17,6 @@ Allows you to open more connections in browser!
* 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 (don't have discord's token for facebook apis why even would i have that...)
* 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. I also went on the website for the first time and it decided to give me unlimited for free, then right after upgraded me to the family plan and that was not free and was a waste of $10.54, like bro, I was just trying to close all the popups then it froze and upgraded itself to the family plan)
* Amazon Music (nothing references to the actual amazon music user id in discord.

View file

@ -7,7 +7,6 @@
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
/**
* All the connection types implemented into this plugin
*/
@ -20,8 +19,8 @@ enum connectionTypes {
/**
* The uri to use.
* There are also two variables that you can use, name and id.
* The "name" is well the name of the account and the name is what shows up when viewing a connection on a discord profile.
* The "id" is an identifier that normal users don't see, it will usually be an user id (, for example Roblox has user ids, and discord stores that user id in the id field of the connection).
* 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",
*/
@ -52,7 +51,7 @@ export default definePlugin({
return {
find: "getPlatformUserUrl:",
replacement: {
match: new RegExp(`(?<=${serviceNames[connectionTypeSelected]}",.*},.+)(?=},)`),
match: new RegExp(`(r`),
replace: `, getPlatformUserUrl:e=>{let {name, id} = e; return \`${uris[connectionTypeSelected]}\`;}`
}
};