feat(platformIndicators): option to view indicators on bots (#26)

This commit is contained in:
nyx 2024-08-01 21:24:00 +03:00 committed by GitHub
parent ec1a78f42f
commit b1c761d3c8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -108,7 +108,7 @@ function ensureOwnStatus(user: User) {
function getBadges({ userId }: BadgeUserArgs): ProfileBadge[] { function getBadges({ userId }: BadgeUserArgs): ProfileBadge[] {
const user = UserStore.getUser(userId); const user = UserStore.getUser(userId);
if (!user || user.bot) return []; if (!user || (user.bot && !Settings.plugins.PlatformIndicators.showBots)) return [];
ensureOwnStatus(user); ensureOwnStatus(user);
@ -131,7 +131,7 @@ function getBadges({ userId }: BadgeUserArgs): ProfileBadge[] {
} }
const PlatformIndicator = ({ user, wantMargin = true, wantTopMargin = false, small = false }: { user: User; wantMargin?: boolean; wantTopMargin?: boolean; small?: boolean; }) => { const PlatformIndicator = ({ user, wantMargin = true, wantTopMargin = false, small = false }: { user: User; wantMargin?: boolean; wantTopMargin?: boolean; small?: boolean; }) => {
if (!user || user.bot) return null; if (!user || (user.bot && !Settings.plugins.PlatformIndicators.showBots)) return null;
ensureOwnStatus(user); ensureOwnStatus(user);
@ -292,6 +292,12 @@ export default definePlugin({
description: "Whether to make the mobile indicator match the color of the user status.", description: "Whether to make the mobile indicator match the color of the user status.",
default: true, default: true,
restartNeeded: true restartNeeded: true
},
showBots: {
type: OptionType.BOOLEAN,
description: "Whether to show platform indicators on bots",
default: false,
restartNeeded: false
} }
} }
}); });