From 9a2ac43ba5a90dcd663611be5c2a3ff98ee886e8 Mon Sep 17 00:00:00 2001 From: KungKurt Date: Sun, 23 Feb 2025 18:47:14 +0100 Subject: [PATCH] updated to version 0.1.20 --- module.json | 2 +- scripts/puckoapi/puckoapi.js | 4 ++-- scripts/puckochat/commands.js | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/module.json b/module.json index 7999b00..7dd24f3 100644 --- a/module.json +++ b/module.json @@ -6,7 +6,7 @@ "authors": [ { "name": "Robin Riis" } ], - "version": "0.1.19", + "version": "0.1.20", "socket": true, "minimumCoreVersion": 10, "compatibility": { diff --git a/scripts/puckoapi/puckoapi.js b/scripts/puckoapi/puckoapi.js index 2d5b0d0..28b6505 100644 --- a/scripts/puckoapi/puckoapi.js +++ b/scripts/puckoapi/puckoapi.js @@ -6,7 +6,7 @@ export class PuckoPruttApi { this.schema = this.apiUrl + "/schema/" } - _fetch_json(url) { + async _fetch_json(url) { const response = await fetch(url); if (!response.ok) { return -1; @@ -15,7 +15,7 @@ export class PuckoPruttApi { return json; } - dagens_lunch(spider) { + async dagens_lunch(spider) { return this._fetch_json(this.apiUrl + "/dagens_lunch/" + spider + "/?format=json"); } } \ No newline at end of file diff --git a/scripts/puckochat/commands.js b/scripts/puckochat/commands.js index 6b2c2ec..7611727 100644 --- a/scripts/puckochat/commands.js +++ b/scripts/puckochat/commands.js @@ -1,9 +1,9 @@ -function test(user) { +async function test(user) { return `hello ${user}`; } -function dagens(user, message) { - let week = await game.modules.get("puckoprutt-foundry-module").api.dagens_lunch(message[1]); +async function dagens(user, message) { + let week = game.modules.get("puckoprutt-foundry-module").api.dagens_lunch(message[1]); if (typeof week !== 'object') { return "could not fetch "+message[1]; }