const MODULE_ID = 'mgt2-compendium-amiral-denisov'; const STARTUP_NOTICE_FLAG = `${MODULE_ID}.startupNoticePosted`; function isNoticeOwner() { if (!game.user?.isGM) return false; const activeGM = game.users?.activeGM; return !activeGM || activeGM.id === game.user.id; } function buildStartupNoticeHtml() { return `
MgT2e – outils · /commerce /pnj /rencontre /mission
par LeRatierBretonnien / Uberwald
`; } Hooks.once('ready', async () => { if (!isNoticeOwner()) return; if (globalThis[STARTUP_NOTICE_FLAG]) return; globalThis[STARTUP_NOTICE_FLAG] = true; await ChatMessage.create({ speaker: { alias: 'MgT2e - Compendium Amiral Denisov', }, content: buildStartupNoticeHtml(), style: CONST.CHAT_MESSAGE_STYLES.OTHER, }); });