Update environment configuration and fix test case naming
Some checks failed
Deno-Workflow / Deploy (push) Has been cancelled
Some checks failed
Deno-Workflow / Deploy (push) Has been cancelled
This commit is contained in:
21
deno.lock
generated
21
deno.lock
generated
@@ -1,10 +1,14 @@
|
||||
{
|
||||
"version": "4",
|
||||
"version": "5",
|
||||
"specifiers": {
|
||||
"jsr:@melvdouc/xml-parser@*": "0.1.1",
|
||||
"jsr:@melvdouc/xml-parser@~0.1.1": "0.1.1",
|
||||
"jsr:@std/assert@1": "1.0.15",
|
||||
"jsr:@std/dotenv@*": "0.225.3",
|
||||
"jsr:@std/dotenv@0.225.3": "0.225.3",
|
||||
"jsr:@std/fmt@^1.0.5": "1.0.6",
|
||||
"jsr:@std/fs@^1.0.11": "1.0.15",
|
||||
"jsr:@std/internal@^1.0.12": "1.0.12",
|
||||
"jsr:@std/io@~0.225.2": "0.225.2",
|
||||
"jsr:@std/log@*": "0.224.14",
|
||||
"npm:@types/node@^22.14.1": "22.14.1",
|
||||
@@ -14,6 +18,12 @@
|
||||
"@melvdouc/xml-parser@0.1.1": {
|
||||
"integrity": "5c79d37c6471cb74efb344988317270b57b4f181decb873e441453db42eb6e5f"
|
||||
},
|
||||
"@std/assert@1.0.15": {
|
||||
"integrity": "d64018e951dbdfab9777335ecdb000c0b4e3df036984083be219ce5941e4703b",
|
||||
"dependencies": [
|
||||
"jsr:@std/internal"
|
||||
]
|
||||
},
|
||||
"@std/dotenv@0.225.3": {
|
||||
"integrity": "a95e5b812c27b0854c52acbae215856d9cce9d4bbf774d938c51d212711e8d4a"
|
||||
},
|
||||
@@ -23,6 +33,9 @@
|
||||
"@std/fs@1.0.15": {
|
||||
"integrity": "c083fb479889d6440d768e498195c3fc499d426fbf9a6592f98f53884d1d3f41"
|
||||
},
|
||||
"@std/internal@1.0.12": {
|
||||
"integrity": "972a634fd5bc34b242024402972cd5143eac68d8dffaca5eaa4dba30ce17b027"
|
||||
},
|
||||
"@std/io@0.225.2": {
|
||||
"integrity": "3c740cd4ee4c082e6cfc86458f47e2ab7cb353dc6234d5e9b1f91a2de5f4d6c7"
|
||||
},
|
||||
@@ -173,7 +186,11 @@
|
||||
"integrity": "sha512-q/1rj5D0/zayJB2FraXdaWxbhWiNKDvu8naDT2dl1yTlvJp4BLtOcp2a5BvgGNQpYYJzau7tf1WgKv3b+7mqpQ=="
|
||||
},
|
||||
"ws@8.18.1": {
|
||||
"integrity": "sha512-RKW2aJZMXeMxVpnZ6bck+RswznaxmzdULiBr6KY7XkTnW8uvt0iT9H5DkHUChXrc+uurzwa0rVI16n/Xzjdz1w=="
|
||||
"integrity": "sha512-RKW2aJZMXeMxVpnZ6bck+RswznaxmzdULiBr6KY7XkTnW8uvt0iT9H5DkHUChXrc+uurzwa0rVI16n/Xzjdz1w==",
|
||||
"optionalPeers": [
|
||||
"bufferutil@^4.0.1",
|
||||
"utf-8-validate@>=5.0.2"
|
||||
]
|
||||
}
|
||||
},
|
||||
"workspace": {
|
||||
|
||||
@@ -1,7 +1,17 @@
|
||||
import { load } from "jsr:@std/dotenv";
|
||||
|
||||
const _env = await load({
|
||||
// optional: choose a specific path (defaults to ".env")
|
||||
envPath: ".env",
|
||||
// optional: also export to the process environment (so Deno.env can read it)
|
||||
export: true,
|
||||
});
|
||||
|
||||
export type EnvConst = {
|
||||
ADMIN: string,
|
||||
BOT_TOKEN: string,
|
||||
RULE34_API_KEY: string,
|
||||
RULE34_API_USER: string,
|
||||
// DB_LOCATION: string
|
||||
}
|
||||
|
||||
@@ -10,6 +20,7 @@ export function loadConfig() {
|
||||
ADMIN: loadEnv("ADMIN"),
|
||||
BOT_TOKEN: loadEnv("BOT_TOKEN"),
|
||||
RULE34_API_KEY: loadEnv("RULE34_API_KEY"),
|
||||
RULE34_API_USER: loadEnv("RULE34_API_USER"),
|
||||
// DB_LOCATION: loadEnv("DB_LOCATION")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ import { requestJSON } from "@root/structures/apiRequest.ts";
|
||||
import { ImageResponse, postUrl } from "./api.ts";
|
||||
import { EmbedBuilder } from "@discordjs";
|
||||
|
||||
|
||||
export type PostRequestParameters = {
|
||||
limit?: string| null| undefined,
|
||||
id?: string| null| undefined,
|
||||
@@ -45,6 +46,7 @@ export function generateRequestURL(postRequestParams: PostRequestParameters) {
|
||||
parameterStrings.push(`&${k}=${v}`)
|
||||
}
|
||||
});
|
||||
parameterStrings.push('&api_key=&user_id=' + (Deno.env.get("RULE34_API_KEY") ?? ''));
|
||||
|
||||
parameterStrings.push('&api_key=' + (Deno.env.get("RULE34_API_KEY")) + '&user_id=' + (Deno.env.get("RULE34_API_USER")));
|
||||
return postCpy.href + parameterStrings.join('');
|
||||
}
|
||||
@@ -6,7 +6,7 @@ Deno.test("Test URL Search Parameters", () => {
|
||||
));
|
||||
});
|
||||
|
||||
Deno.test("Test Request Workder", async () => {
|
||||
Deno.test("Test Request Worker", async () => {
|
||||
console.debug(await requestWorker({
|
||||
limit: "12",
|
||||
tags: "sfw",
|
||||
@@ -15,6 +15,6 @@ Deno.test("Test Request Workder", async () => {
|
||||
|
||||
|
||||
|
||||
Deno.test("Test Request Workder 2", async () => {
|
||||
Deno.test("Test Request Worker 2", async () => {
|
||||
console.debug(await requestWorker({limit: "5",tags: "AI+catgirl"}));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user