Update internal system with dynamic message

This commit is contained in:
2025-10-17 14:59:37 +02:00
parent 01e13da234
commit d012f78881
32 changed files with 137 additions and 99 deletions

View File

@@ -72,11 +72,24 @@ Hooks.once("init", async function () {
/* -------------------------------------------- */
function welcomeMessage() {
if (game.user.isGM) {
ChatMessage.create({
user: game.user.id,
whisper: [game.user.id],
content: `<div id="welcome-message-ecryme"><span class="rdd-roll-part">
<strong>Bienvenu dans Ecryme !</strong>` });
// Try to fetch the welcome message from the github repo "welcome-message-ecryme.html"
fetch("https://raw.githubusercontent.com/uberwald/fvtt-ecryme/main/welcome-message-ecryme.html")
.then(response => response.text())
.then(html => {
ChatMessage.create({
user: game.user.id,
whisper: [game.user.id],
content: html
});
})
.catch(error => {
console.error("Error fetching welcome message:", error);
ChatMessage.create({
user: game.user.id,
whisper: [game.user.id],
content: "<b>Bienvenue dans Ecryme RPG !</b><br>Visitez le site officiel pour plus d'informations."
});
});
}
}