feat: Implement userService.getOrCreateUser and integrate it across commands, remove old utility scripts, and fix daily bonus calculation.
This commit is contained in:
@@ -1,9 +0,0 @@
|
||||
|
||||
import { readFile } from "fs/promises";
|
||||
|
||||
try {
|
||||
const content = await readFile(".env", "utf-8");
|
||||
console.log(content);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
|
||||
import { userService } from "@/modules/user/user.service";
|
||||
import { DrizzleClient } from "@/lib/DrizzleClient";
|
||||
import { users } from "@/db/schema";
|
||||
import { eq } from "drizzle-orm";
|
||||
|
||||
console.log("Starting test...");
|
||||
|
||||
try {
|
||||
const id = "109998942841765888";
|
||||
|
||||
console.log("Fetching user...");
|
||||
const user = await userService.getUserById(id);
|
||||
console.log("User fetched:", user);
|
||||
|
||||
if (user?.class) {
|
||||
console.log("User class fetched:", user.class);
|
||||
}
|
||||
} catch (e) {
|
||||
console.error("Error:", e);
|
||||
}
|
||||
|
||||
process.exit(0);
|
||||
@@ -1,4 +0,0 @@
|
||||
|
||||
import { env } from "@lib/env";
|
||||
|
||||
console.log("DATABASE_URL:", env.DATABASE_URL);
|
||||
@@ -1,20 +0,0 @@
|
||||
|
||||
import { writeFile } from "fs/promises";
|
||||
|
||||
const content = `DB_USER=kyoko
|
||||
DB_PASSWORD=kyoko
|
||||
DB_NAME=kyoko
|
||||
DB_PORT=5432
|
||||
DB_HOST=localhost
|
||||
DISCORD_BOT_TOKEN=MTQ0Mzg4NTA3NDM0ODExODA5OA.GcX7aT.S6G2jWqLmPAOx04JBHhJn7TCPsx5pK5RMUxN3g
|
||||
DISCORD_CLIENT_ID=1443885074348118098
|
||||
DISCORD_GUILD_ID=1443887793565728870
|
||||
DATABASE_URL=postgres://kyoko:kyoko@localhost:5432/kyoko
|
||||
`;
|
||||
|
||||
try {
|
||||
await writeFile(".env", content);
|
||||
console.log("Updated .env");
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
Reference in New Issue
Block a user