Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

fix(team): the crown check takes any patch body

milind-soni32908625821a
diff --git a/server/host/team-crown.ts b/server/host/team-crown.ts
index 94de6a39ba..1df8b90be4 100644
--- a/server/host/team-crown.ts
+++ b/server/host/team-crown.ts
@@ -3,7 +3,7 @@
import { botOwner, type OwnedBot } from "../../shared/bot-owner.ts";
/** Why this PATCH may not crown `bot` on a team, or null. */
-export function teamCrownRefusal(team: boolean, bot: (OwnedBot & { name: string; chiefOfStaff?: boolean }) | null, body: { chiefOfStaff?: unknown }): string | null {
+export function teamCrownRefusal(team: boolean, bot: (OwnedBot & { name: string; chiefOfStaff?: boolean }) | null, body: Record<string, unknown>): string | null {
if (!team || body.chiefOfStaff !== true || !bot || bot.chiefOfStaff || bot.defaultBot?.person || !botOwner(bot)) return null;
return `${bot.name} can't be made a Chief of Staff on a team: each person's own MausBot already looks after their bots and holds their inbox.`;
}