tested & working basic bot

This commit is contained in:
Darius
2025-09-27 16:12:50 +02:00
parent 44f3f7af0b
commit 10eee0c0fd
16 changed files with 161 additions and 127 deletions

View File

@@ -1,14 +1,14 @@
import * as readline from "node:readline";
import { apiClient } from "../core/api-client.ts";
import { logError, logInfo } from "./logger.ts";
import { logSuccess, logWarning } from "./logger.ts";
export async function getUserId(username: string): Promise<string | null> {
const user = await apiClient.users.getUserByName(username);
if (user) {
logInfo(`${user.name} => ${user.id}`);
if (user?.id) {
logSuccess(`${user.name} => ${user.id}`);
return user.id;
}
logError(`no user with name ${username} found`);
logWarning(`no user with name ${username} found`);
return null;
}