Amelioration des commandes de tchat et aide

This commit is contained in:
2020-09-13 22:46:42 +02:00
parent 18be421ce5
commit cec65edb83
6 changed files with 89 additions and 22 deletions

View File

@ -138,26 +138,10 @@ Hooks.once("ready", function() {
/* -------------------------------------------- */
/* Foundry VTT Initialization */
/* -------------------------------------------- */
const table2func = { "queues": TMRUtility.getQueue, "ombre": TMRUtility.getOmbre, "tetehr": TMRUtility.getTeteHR, "tete": TMRUtility.getTete, "souffle": TMRUtility.getSouffle };
Hooks.on("chatMessage", (html, content, msg) => {
let regExp;
regExp = /(\S+)/g;
let commands = content.match(regExp);
// Setup new message's visibility
let rollMode = game.settings.get("core", "rollMode");
if (["gmroll", "blindroll"].includes(rollMode)) msg["whisper"] = ChatMessage.getWhisperIDs("GM");
if (rollMode === "blindroll") msg["blind"] = true;
msg["type"] = 0;
let regExp;
regExp = /(\S+)/g;
let commands = content.match(regExp);
let command = commands[0];
// Roll on a table
if (command === "/table") {
let tableName = commands[1].toLowerCase();
table2func[tableName]();
return false
}
return true;
return RdDUtility.processChatCommand( commands, content, msg );
} );