22 lines
567 B
JavaScript
22 lines
567 B
JavaScript
import "commands"
|
|
|
|
Hooks.on("init", function() {
|
|
console.log("[puckoprutt] Hello Init");
|
|
});
|
|
|
|
Hooks.on("ready", function() {
|
|
console.log("[puckoprutt] Hello Ready");
|
|
});
|
|
|
|
Hooks.on("chatMessage", (log, message, data) => {
|
|
to_send = "";
|
|
if(message[0] === "!") to_send = commands.puckocommand(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
|
|
});
|
|
}
|
|
}); |