From b290bb4d55ad2672ed2be636bfe4f9e867ab85d4 Mon Sep 17 00:00:00 2001 From: Beelzebub <65181309+Beelzebub2@users.noreply.github.com> Date: Sun, 14 Jul 2024 23:47:03 +0100 Subject: [PATCH] Add bot name to console title Signed-off-by: Beelzebub <65181309+Beelzebub2@users.noreply.github.com> --- src/index.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/index.ts b/src/index.ts index bea1b58c2..a093675b1 100644 --- a/src/index.ts +++ b/src/index.ts @@ -87,6 +87,15 @@ class ThemeSelector { const theme = new ThemeSelector(); +/** + * Sets the console window title. + * @param title - The new title for the console window. + */ +function setConsoleTitle(title: string): void { + // Write the escape sequence to change the console title + process.stdout.write(`\x1b]0;${title}\x07`); +} + async function main(): Promise { try { if (!fs.existsSync("./src/utils/LavaLogo.txt")) { @@ -94,6 +103,8 @@ async function main(): Promise { process.exit(1); } console.clear(); + // Set a custom title for the console window + setConsoleTitle("Lavamusic"); const logFile = fs.readFileSync("./src/utils/LavaLogo.txt", "utf-8"); // biome-ignore lint/suspicious/noConsoleLog: console.log(theme.purpleNeon(logFile));