This commit is contained in:
Skillet 2023-04-17 19:24:32 -04:00
parent b4355321d1
commit 0a744b8c40

View File

@ -7,6 +7,7 @@ import axios from "axios"
import Layer from '../layers/layer.js';
import fs from 'fs'
import process from 'process'
import Logger from "core/logger";
export default class MapVote extends DiscordBasePlugin {
static get description() {
@ -1110,6 +1111,11 @@ export default class MapVote extends DiscordBasePlugin {
return;
}
Logger.verbose('Layers', 1, 'Pulling layers...');
const response = await axios.post( // Change get to post for mod support
'http://hub.afocommunity.com/api/layers.json', [0, 1959152751]
);
for (const layer of response.data.Maps) {
if (!Layers.layers.find((e) => e.layerid === layer.rawName)){
const hellolayer = new Layer(layer);