add vanish command
This commit is contained in:
@@ -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> {
|
||||
|
||||
Reference in New Issue
Block a user