27 lines
721 B
JavaScript
27 lines
721 B
JavaScript
import { puckocommand } from "./commands.js"
|
|
|
|
Hooks.on("init", async function() {
|
|
console.log("[puckoprutt] Hello Init");
|
|
});
|
|
|
|
Hooks.on("ready", async function() {
|
|
console.log("[puckoprutt] Hello Ready");
|
|
});
|
|
|
|
Hooks.on("chatMessage", (log, message, data) => {
|
|
let to_send = "";
|
|
let isGM = "";
|
|
let user = "";
|
|
let world = game.world.id;
|
|
console.log("[puckoprutt] chat!");
|
|
|
|
if(message[0] === "!") to_send = puckocommand(isGM, user, world, log, message.slice(1).split(" "), data);
|
|
|
|
if(to_send !== "") {
|
|
ChatMessage.create({
|
|
user: Gamepad.user.id,
|
|
speaker: ChatMessage.getSpeaker({actor: game.actors.getName("puckoprutt"), alias: "Almighty God"}),
|
|
content: to_send
|
|
});
|
|
}
|
|
}); |