BadgesAPI: Don't depend on getBadges module not being undefined (#942)

This commit is contained in:
Nuckyz 2023-04-18 02:25:14 -03:00 committed by GitHub
parent c0ac6a4b86
commit e70d00d008
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -61,8 +61,8 @@ export default definePlugin({
find: "Messages.PROFILE_USER_BADGES,role:",
replacement: [
{
match: /(?<=void 0:)\i.getBadges\(\)/,
replace: "Vencord.Api.Badges._getBadges(arguments[0]).concat($&??[])",
match: /null==\i\?void 0:(\i)\.getBadges\(\)/,
replace: (_, badgesMod) => `Vencord.Api.Badges._getBadges(arguments[0]).concat(${badgesMod}?.getBadges()??[])`,
},
{
// alt: "", aria-hidden: false, src: originalSrc