Add PlatformIndicators ShowBots Setting
Some checks are pending
Test / Test (push) Waiting to run

This commit is contained in:
thororen1234 2025-05-19 19:19:50 -04:00
parent d3ab1930aa
commit 8e01e87868
No known key found for this signature in database

View file

@ -21,7 +21,7 @@ import "./style.css";
import { addMemberListDecorator, removeMemberListDecorator } from "@api/MemberListDecorators"; import { addMemberListDecorator, removeMemberListDecorator } from "@api/MemberListDecorators";
import { addMessageDecoration, removeMessageDecoration } from "@api/MessageDecorations"; import { addMessageDecoration, removeMessageDecoration } from "@api/MessageDecorations";
import { addNicknameIcon, removeNicknameIcon } from "@api/NicknameIcons"; import { addNicknameIcon, removeNicknameIcon } from "@api/NicknameIcons";
import { definePluginSettings, migratePluginSetting } from "@api/Settings"; import { definePluginSettings, migratePluginSetting, Settings } from "@api/Settings";
import { Devs } from "@utils/constants"; import { Devs } from "@utils/constants";
import { classes } from "@utils/misc"; import { classes } from "@utils/misc";
import definePlugin, { OptionType } from "@utils/types"; import definePlugin, { OptionType } from "@utils/types";
@ -146,7 +146,7 @@ interface PlatformIndicatorProps {
} }
const PlatformIndicator = ({ user, isProfile, isMessage, isMemberList }: PlatformIndicatorProps) => { const PlatformIndicator = ({ user, isProfile, isMessage, isMemberList }: PlatformIndicatorProps) => {
if (user == null || user.bot) return null; if (user == null || (user.bot && !Settings.plugins.PlatformIndicators.showBots)) return null;
useEnsureOwnStatus(user); useEnsureOwnStatus(user);
const status: Record<Platform, string> | undefined = useStateFromStores([PresenceStore], () => PresenceStore.getState()?.clientStatuses?.[user.id]); const status: Record<Platform, string> | undefined = useStateFromStores([PresenceStore], () => PresenceStore.getState()?.clientStatuses?.[user.id]);
@ -227,6 +227,12 @@ const settings = definePluginSettings({
default: true, default: true,
restartNeeded: true restartNeeded: true
}, },
showBots: {
type: OptionType.BOOLEAN,
description: "Whether to show platform indicators on bots",
default: false,
restartNeeded: false
},
ConsoleIcon: { ConsoleIcon: {
type: OptionType.SELECT, type: OptionType.SELECT,
description: "What console icon to use", description: "What console icon to use",