damn you kyza

This commit is contained in:
amy 2025-03-12 16:07:39 +03:30
parent 5c8b8d0104
commit e18bebd0a5
No known key found for this signature in database
2 changed files with 31 additions and 2 deletions

View file

@ -10,7 +10,7 @@ import {
SlashCommandBuilder
} from "discord.js";
import {getSongOnPreferredProvider} from "../helper.ts"
import {getSongOnPreferredProvider, kyzaify} from "../helper.ts"
import {Config} from "../config.ts";
function keepV(url: string): string {
@ -70,7 +70,7 @@ export default class PingCommand extends Command {
currentRow.addComponents(
new ButtonBuilder()
.setURL(songlink.linksByPlatform[meowi].url)
.setLabel(meowi)
.setLabel(kyzaify(meowi))
.setStyle(ButtonStyle.Link)
);
}

View file

@ -56,3 +56,32 @@ export function getSongOnPreferredProvider(json: any, link: string): Song | null
}
return null
}
export function kyzaify(input: string): string {
//im gonna write this as shittily as possible just because.
if (input === "youtube") {
return "YouTube";
} else if (input === "youtubeMusic") {
return "YouTube Music";
} else if (input === "itunes") {
return "iTunes";
} else if (input === "soundcloud") {
return "SoundCloud";
}
if (input.length === 0) return input;
let result = input.charAt(0).toUpperCase();
for (let i = 1; i < input.length; i++) {
const char = input.charAt(i);
if (char === char.toUpperCase()) {
result += ' ' + char;
} else {
result += char;
}
}
return result;
}