Skip to content
Contents

@haruhimemoe/harumin-config

The settings contract between the harumin osu! Discord bot and harumin.haruhime.moe: guild settings, /track entries and the bot's service routes.

Version 0.1.0, MIT

bun add @haruhimemoe/harumin-config

The settings contract between harumin, the osu! Discord bot, and harumin.haruhime.moe, its dashboard. Both import the same zod schemas, so the site never writes a document the bot can't read.

sh
bun add @haruhimemoe/harumin-config zod

What's in it

#
ExportWhat it is
guildSettingsSchema, GuildSettingsOne guild's settings: guildId, autoEmbeds (one boolean per link type), defaultMode, updatedAt, updatedBy. Missing fields take the defaults.
defaultGuildSettings(guildId)The settings a guild has before anyone changes them.
readGuildSettings(guildId, stored)A stored document with defaults filled in. Nothing stored, a document that doesn't parse, or another guild's document all read as the defaults.
guildSettingsPatchSchema, applyGuildSettingsPatch(current, patch, by, now?)What the dashboard may change (strict: unknown keys fail), and applying it without changing current.
AUTO_EMBED_KEYS, DEFAULT_AUTO_EMBEDS, AUTO_EMBED_LABELSmap, match, pack, pool, bb. Beatmaps, packs and pools are on by default. Labels for the dashboard.
RULESETS, rulesetSchema, snowflakeSchemaosu!'s rulesets, and a Discord id (17 to 20 digits).
trackEntrySchema, TrackEntry, MAX_TRACKED_PER_GUILDOne /track entry (guild, channel, osu! id and name, ruleset, who added it, when), and the per-guild cap (25).
HARUMIN_COLLECTIONSThe MongoDB collection names both apps use.
SERVICE_ROUTES, manageableGuildsSchema, guildChannelsSchema, revalidateBodySchemaThe bot's bearer-authenticated routes the dashboard calls, and their bodies.
guildIconUrl(guild, size?)A guild's icon on Discord's CDN, or null.

License

#

MIT