Add welcome message
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
/* -------------------------------------------- */
|
||||
|
||||
/* -------------------------------------------- */
|
||||
const ECRYME_WELCOME_MESSAGE_URL = "https://www.uberwald.me/gitea/public/fvtt-te-deum/raw/branch/master/welcome-message-tedeum.html"
|
||||
|
||||
export class TeDeumUtility {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@@ -169,14 +171,25 @@ export class TeDeumUtility {
|
||||
/* -------------------------------------------- */
|
||||
static welcomeMessage() {
|
||||
if (game.user.isGM) {
|
||||
ChatMessage.create({
|
||||
user: game.user.id,
|
||||
whisper: [game.user.id],
|
||||
content: `<div id="chat-welcome welcome-message-tedeum"><span class="rdd-roll-part">
|
||||
<strong>Bienvenu dans Te Deum Pour Un Massacre !</strong>
|
||||
<div class="chat-welcome">Ce système vous est proposé par Open Sesame Games.<br>
|
||||
Vous trouverez de l'aide dans @UUID[Compendium.fvtt-te-deum.aides.JournalEntry.uNwJgi4kXBCiZmAH]{Aide pour Te Deum}<br>
|
||||
ainsi que sur le Discord de Foundry FR : https://discord.gg/pPSDNJk</div>` });
|
||||
// Try to fetch the welcome message from the github repo "welcome-message-ecryme.html"
|
||||
fetch(ECRYME_WELCOME_MESSAGE_URL)
|
||||
.then(response => response.text())
|
||||
.then(html => {
|
||||
console.log("Fetched welcome message:", 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