Skip to content

Commit ff306b1

Browse files
committed
fix(plugin/scyyeBadges): Fix bot profile crashing
1 parent ea592e1 commit ff306b1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/userplugins/scyyeBadges/index.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@
1919
import { BadgePosition, BadgeUserArgs, ProfileBadge } from "@api/Badges";
2020
import { Badges } from "@api/index";
2121
import definePlugin from "@utils/types";
22-
import { ChannelStore, GuildChannelStore, GuildMemberStore, GuildStore, UserStore } from "@webpack/common";
23-
import { GuildMember } from "discord-types/general";
22+
import { GuildMemberStore, GuildStore, UserStore } from "@webpack/common";
2423
import React from "react";
2524

2625
var registered: ProfileBadge[] = [];
@@ -60,7 +59,7 @@ class Badge {
6059
key: string | undefined;
6160
image: string | undefined;
6261
description: string | undefined;
63-
shouldShow(user: BadgeUserArgs): boolean {
62+
shouldShow(_: BadgeUserArgs): boolean {
6463
return false;
6564
}
6665
link: string | undefined;
@@ -113,6 +112,7 @@ function addScyyeBadges() {
113112
image: UserStore.getUser("318902553024659456").getAvatarURL(),
114113
shouldShow(userInfo: BadgeUserArgs): boolean {
115114
// UserStore.getUser(userInfo.user.id);
115+
if ((userInfo.user as any).globalName === undefined || (userInfo.user as any).globalName === null) return false;
116116
return (userInfo.user as any).globalName.includes("』");
117117
}
118118
});

0 commit comments

Comments
 (0)