damn you kyza
This commit is contained in:
parent
5c8b8d0104
commit
e18bebd0a5
2 changed files with 31 additions and 2 deletions
|
|
@ -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)
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue