Compare commits
3 Commits
5cacca37a1
...
6915843c3a
| Author | SHA1 | Date | |
|---|---|---|---|
| 6915843c3a | |||
| ba9a3493e8 | |||
| 05b035dc9c |
@ -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",
|
||||||
|
|||||||
@ -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
|
||||||
});
|
});
|
||||||
10
scripts/puckoapi/puckoapi.js
Normal file
10
scripts/puckoapi/puckoapi.js
Normal 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"});
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user