add vanish command

This commit is contained in:
Darius
2025-09-29 00:50:18 +02:00
parent dbfb4f5d86
commit b22cbf160c
3 changed files with 92 additions and 2 deletions

View File

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