Update internal system with dynamic message
This commit is contained in:
@@ -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."
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user