Compare commits

..

3 Commits

Author SHA1 Message Date
6915843c3a updated to version 0.1.8 2025-02-23 13:58:56 +01:00
ba9a3493e8 created a puckoapi instance 2025-02-23 13:57:58 +01:00
05b035dc9c moved main.js and added puckoapi init 2025-02-23 13:57:32 +01:00
3 changed files with 16 additions and 4 deletions

View File

@ -6,7 +6,7 @@
"authors": [ "authors": [
{ "name": "Robin Riis" } { "name": "Robin Riis" }
], ],
"version": "0.1.7", "version": "0.1.8",
"socket": true, "socket": true,
"minimumCoreVersion": 10, "minimumCoreVersion": 10,
"compatibility": { "compatibility": {
@ -32,7 +32,7 @@
] ]
}, },
"esmodules": [ "esmodules": [
"scripts/puckochat/main.js" "scripts/main.js"
], ],
"url": "https://git.puckoprutt.tech/puckoprutt/puckoprutt-foundry-module", "url": "https://git.puckoprutt.tech/puckoprutt/puckoprutt-foundry-module",
"download": "https://git.puckoprutt.tech/puckoprutt/puckoprutt-foundry-module/archive/main.zip", "download": "https://git.puckoprutt.tech/puckoprutt/puckoprutt-foundry-module/archive/main.zip",

View File

@ -1,7 +1,9 @@
import { puckocommand } from "./commands.js" import { PuckoPruttApi } from "./puckoapi/puckoapi.js"
import { puckocommand } from "./puckochat/commands.js"
Hooks.on("init", async function() { Hooks.on("init", async function() {
console.log("[puckoprutt] Hello Init"); console.log("[puckoprutt] Hello Init");
var puckoprutt = new PuckoPruttApi();
}); });
Hooks.on("ready", async function() { Hooks.on("ready", async function() {
@ -17,7 +19,7 @@ Hooks.on("chatMessage", (log, message, data) => {
if(to_send !== "") { if(to_send !== "") {
ChatMessage.create({ ChatMessage.create({
user: game.user.id, user: game.actors.getName("puckoprutt"),
speaker: ChatMessage.getSpeaker({actor: game.actors.getName("puckoprutt"), alias: "Almighty God"}), speaker: ChatMessage.getSpeaker({actor: game.actors.getName("puckoprutt"), alias: "Almighty God"}),
content: to_send content: to_send
}); });

View File

@ -0,0 +1,10 @@
class PuckoPruttApi {
constructor() {
this.apiUrl = "api.puckoprutt.tech"
this.schema = this.apiUrl + "/schema"
}
dagens_lunch(spider) {
return fetch(this.apiUrl + "/dagens_lunch/" + spider, {method: "GET"});
}
}