Move config files to new directory
This commit is contained in:
parent
6a409283af
commit
81ff5ae0ab
11 changed files with 10 additions and 10 deletions
|
@ -2,7 +2,7 @@ import Command from "./command.js";
|
||||||
import imageDetect from "../utils/imagedetect.js";
|
import imageDetect from "../utils/imagedetect.js";
|
||||||
import { runningCommands } from "../utils/collections.js";
|
import { runningCommands } from "../utils/collections.js";
|
||||||
import { readFileSync } from "fs";
|
import { readFileSync } from "fs";
|
||||||
const { emotes } = JSON.parse(readFileSync(new URL("../messages.json", import.meta.url)));
|
const { emotes } = JSON.parse(readFileSync(new URL("../config/messages.json", import.meta.url)));
|
||||||
import { random } from "../utils/misc.js";
|
import { random } from "../utils/misc.js";
|
||||||
|
|
||||||
class ImageCommand extends Command {
|
class ImageCommand extends Command {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import paginator from "../../utils/pagination/pagination.js";
|
import paginator from "../../utils/pagination/pagination.js";
|
||||||
import { readFileSync } from "fs";
|
import { readFileSync } from "fs";
|
||||||
const { searx } = JSON.parse(readFileSync(new URL("../../servers.json", import.meta.url)));
|
const { searx } = JSON.parse(readFileSync(new URL("../../config/servers.json", import.meta.url)));
|
||||||
import { random } from "../../utils/misc.js";
|
import { random } from "../../utils/misc.js";
|
||||||
import fetch from "node-fetch";
|
import fetch from "node-fetch";
|
||||||
import Command from "../../classes/command.js";
|
import Command from "../../classes/command.js";
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import fetch from "node-fetch";
|
import fetch from "node-fetch";
|
||||||
import { readFileSync } from "fs";
|
import { readFileSync } from "fs";
|
||||||
const { searx } = JSON.parse(readFileSync(new URL("../../servers.json", import.meta.url)));
|
const { searx } = JSON.parse(readFileSync(new URL("../../config/servers.json", import.meta.url)));
|
||||||
import { random } from "../../utils/misc.js";
|
import { random } from "../../utils/misc.js";
|
||||||
import paginator from "../../utils/pagination/pagination.js";
|
import paginator from "../../utils/pagination/pagination.js";
|
||||||
import Command from "../../classes/command.js";
|
import Command from "../../classes/command.js";
|
||||||
|
|
|
@ -10,7 +10,7 @@ services:
|
||||||
- ./logs:/home/esmBot/.internal/logs
|
- ./logs:/home/esmBot/.internal/logs
|
||||||
- ./bot-help:/home/esmBot/help
|
- ./bot-help:/home/esmBot/help
|
||||||
- ./bot-temp:/home/esmBot/temp
|
- ./bot-temp:/home/esmBot/temp
|
||||||
- ./servers.json:/home/esmBot/.internal/servers.json
|
- ./config/servers.json:/home/esmBot/.internal/config/servers.json
|
||||||
env_file:
|
env_file:
|
||||||
- .env
|
- .env
|
||||||
environment:
|
environment:
|
||||||
|
|
2
shard.js
2
shard.js
|
@ -16,7 +16,7 @@ import database from "./utils/database.js";
|
||||||
// command collections
|
// command collections
|
||||||
import { paths } from "./utils/collections.js";
|
import { paths } from "./utils/collections.js";
|
||||||
// playing messages
|
// playing messages
|
||||||
const { messages } = JSON.parse(readFileSync(new URL("./messages.json", import.meta.url)));
|
const { messages } = JSON.parse(readFileSync(new URL("./config/messages.json", import.meta.url)));
|
||||||
// other stuff
|
// other stuff
|
||||||
import { random } from "./utils/misc.js";
|
import { random } from "./utils/misc.js";
|
||||||
// generate help page
|
// generate help page
|
||||||
|
|
|
@ -8,7 +8,7 @@ export const jobs = {};
|
||||||
|
|
||||||
export const connections = new Map();
|
export const connections = new Map();
|
||||||
|
|
||||||
export const servers = JSON.parse(fs.readFileSync(new URL("../servers.json", import.meta.url), { encoding: "utf8" })).image;
|
export const servers = JSON.parse(fs.readFileSync(new URL("../config/servers.json", import.meta.url), { encoding: "utf8" })).image;
|
||||||
|
|
||||||
export async function getType(image, extraReturnTypes) {
|
export async function getType(image, extraReturnTypes) {
|
||||||
if (!image.startsWith("http")) {
|
if (!image.startsWith("http")) {
|
||||||
|
|
|
@ -24,7 +24,7 @@ export async function clean(text) {
|
||||||
.replaceAll("@", `@${String.fromCharCode(8203)}`);
|
.replaceAll("@", `@${String.fromCharCode(8203)}`);
|
||||||
|
|
||||||
const { parsed } = config();
|
const { parsed } = config();
|
||||||
const imageServers = JSON.parse(fs.readFileSync(new URL("../servers.json", import.meta.url), { encoding: "utf8" })).image;
|
const imageServers = JSON.parse(fs.readFileSync(new URL("../config/servers.json", import.meta.url), { encoding: "utf8" })).image;
|
||||||
|
|
||||||
if (imageServers?.length !== 0) {
|
if (imageServers?.length !== 0) {
|
||||||
for (const { server, auth } of imageServers) {
|
for (const { server, auth } of imageServers) {
|
||||||
|
|
|
@ -23,7 +23,7 @@ class ImageWorker extends BaseServiceWorker {
|
||||||
|
|
||||||
if (process.env.API_TYPE === "ws") {
|
if (process.env.API_TYPE === "ws") {
|
||||||
this.connections = new Map();
|
this.connections = new Map();
|
||||||
this.servers = JSON.parse(fs.readFileSync(new URL("../../servers.json", import.meta.url), { encoding: "utf8" })).image;
|
this.servers = JSON.parse(fs.readFileSync(new URL("../../config/servers.json", import.meta.url), { encoding: "utf8" })).image;
|
||||||
this.nextID = 0;
|
this.nextID = 0;
|
||||||
} else if (process.env.API_TYPE === "azure") {
|
} else if (process.env.API_TYPE === "azure") {
|
||||||
this.jobs = new Map();
|
this.jobs = new Map();
|
||||||
|
@ -115,7 +115,7 @@ class ImageWorker extends BaseServiceWorker {
|
||||||
}
|
}
|
||||||
|
|
||||||
async repopulate() {
|
async repopulate() {
|
||||||
const data = await fs.promises.readFile(new URL("../../servers.json", import.meta.url), { encoding: "utf8" });
|
const data = await fs.promises.readFile(new URL("../../config/servers.json", import.meta.url), { encoding: "utf8" });
|
||||||
this.servers = JSON.parse(data).image;
|
this.servers = JSON.parse(data).image;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ export let status = false;
|
||||||
export let connected = false;
|
export let connected = false;
|
||||||
|
|
||||||
export async function checkStatus() {
|
export async function checkStatus() {
|
||||||
const json = await fs.promises.readFile(new URL("../servers.json", import.meta.url), { encoding: "utf8" });
|
const json = await fs.promises.readFile(new URL("../config/servers.json", import.meta.url), { encoding: "utf8" });
|
||||||
nodes = JSON.parse(json).lava;
|
nodes = JSON.parse(json).lava;
|
||||||
const newNodes = [];
|
const newNodes = [];
|
||||||
for (const node of nodes) {
|
for (const node of nodes) {
|
||||||
|
|
Loading…
Reference in a new issue