Merge branch 'dev' of https://github.com/Vendicated/Vencord into discord-types

This commit is contained in:
ryan-0324 2024-07-11 17:02:42 -04:00
commit e45d0bc8ab
3 changed files with 22 additions and 15 deletions

View file

@ -15,7 +15,11 @@ const containerWrapper: Record<string, string> = findByPropsLazy("memberSinceWra
const container: Record<string, string> = findByPropsLazy("memberSince"); const container: Record<string, string> = findByPropsLazy("memberSince");
const getCreatedAtDate = findByCodeLazy('month:"short",day:"numeric"'); const getCreatedAtDate = findByCodeLazy('month:"short",day:"numeric"');
const lastSection: Record<string, string> = findByPropsLazy("lastSection"); const lastSection: Record<string, string> = findByPropsLazy("lastSection");
const section: Record<string, string> = findLazy(m => m.section !== undefined && Object.keys(m).length === 1); const section: Record<string, string> = findLazy((m: any) =>
m.section !== undefined
&& m.heading !== undefined
&& Object.values(m).length === 2
);
export default definePlugin({ export default definePlugin({
name: "FriendsSince", name: "FriendsSince",

View file

@ -257,6 +257,7 @@ export default definePlugin({
// in profiles // in profiles
{ {
find: ",overrideDiscriminator:", find: ",overrideDiscriminator:",
group: true,
replacement: [ replacement: [
{ {
// prevent channel id from getting ghosted // prevent channel id from getting ghosted
@ -264,7 +265,7 @@ export default definePlugin({
match: /user:\i,nick:\i,/, match: /user:\i,nick:\i,/,
replace: "$&moreTags_channelId," replace: "$&moreTags_channelId,"
}, { }, {
match: /,botType:(\i\((\i)\)),/g, match: /,botType:(\i),(?<=user:(\i).+?)/g,
replace: ",botType:$self.getTag({user:$2,channelId:moreTags_channelId,origType:$1,location:'not-chat'})," replace: ",botType:$self.getTag({user:$2,channelId:moreTags_channelId,origType:$1,location:'not-chat'}),"
} }
] ]

View file

@ -184,14 +184,24 @@ export default definePlugin({
}, },
patches: [ patches: [
// Profiles Modal pfp // Avatar component used in User DMs "User Profile" popup in the right and Profiles Modal pfp
...[".MODAL,hasProfileEffect", ".FULL_SIZE,hasProfileEffect:"].map(find => ({ {
find, find: ".overlay:void 0,status:",
replacement: [
...[/"PRESS_VIEW_PROFILE".+?(?=children:)(?<=avatarSrc:(\i).+?)/, /avatarSrc:(\i),eventHandlers:(\i).+?"div",{...\2,/].map(match => ({
match,
replace: "$&style:{cursor:\"pointer\"},onClick:()=>{$self.openImage($1)},"
}))
]
},
// Old Profiles Modal pfp
{
find: ".MODAL,hasProfileEffect",
replacement: { replacement: {
match: /\{src:(\i)(?=,avatarDecoration)/, match: /\{src:(\i)(?=,avatarDecoration)/,
replace: "{src:$1,onClick:()=>$self.openImage($1)" replace: "{src:$1,onClick:()=>$self.openImage($1)"
} }
})), },
// Banners // Banners
...[".NITRO_BANNER,", "=!1,canUsePremiumCustomization:"].map(find => ({ ...[".NITRO_BANNER,", "=!1,canUsePremiumCustomization:"].map(find => ({
find, find,
@ -203,7 +213,7 @@ export default definePlugin({
'onClick:ev=>$1&&ev.target.style.backgroundImage&&$self.openImage($2),style:{cursor:$1?"pointer":void 0,' 'onClick:ev=>$1&&ev.target.style.backgroundImage&&$self.openImage($2),style:{cursor:$1?"pointer":void 0,'
} }
})), })),
// User DMs "User Profile" popup in the right // Old User DMs "User Profile" popup in the right
{ {
find: ".avatarPositionPanel", find: ".avatarPositionPanel",
replacement: { replacement: {
@ -211,14 +221,6 @@ export default definePlugin({
replace: "$1style:($2)?{cursor:\"pointer\"}:{},onClick:$2?()=>{$self.openImage($3)}" replace: "$1style:($2)?{cursor:\"pointer\"}:{},onClick:$2?()=>{$self.openImage($3)}"
} }
}, },
{
find: ".canUsePremiumProfileCustomization,{avatarSrc:",
replacement: {
match: /\.avatar,\i\.clickable\),onClick:\i,(?<=avatarSrc:(\i).+?)/,
replace: "$&style:{cursor:\"pointer\"},onClick:()=>{$self.openImage($1)},"
}
},
// Group DMs top small & large icon // Group DMs top small & large icon
{ {
find: /\.recipients\.length>=2(?!<isMultiUserDM.{0,50})/, find: /\.recipients\.length>=2(?!<isMultiUserDM.{0,50})/,