Files
dj-spangebob/src/messages.ts
2026-01-03 21:02:26 +01:00

84 lines
2.3 KiB
TypeScript

import { EmbedBuilder, InteractionEditReplyOptions, InteractionReplyOptions } from "discord.js";
import { getQueue } from "./playback";
import { PRIMARY_COLOR } from "./theme";
import { formatFilePath } from "./util/downloader";
const REPO_URL = "https://gitea.papryk.com/Papryk/dj-spangebob"
export function getPlayMsg(url: string): string {
return `TODO-3`
}
export function getCurrentSongMsg(): string {
return 'TODO-1'
}
export function getQueueMsg(): string {
return `TODO-2`
}
export function msg_searching(input: string): InteractionEditReplyOptions {
return {
embeds: [
new EmbedBuilder()
.setDescription(`🔎 Searching for: **${input}**`)
.setColor(PRIMARY_COLOR)
]
}
}
export function msg_downloading(url: string): InteractionEditReplyOptions {
return {
embeds: [
new EmbedBuilder()
.setDescription(`⬇️ Downloading: ${url}`)
.setColor(PRIMARY_COLOR)
]
}
}
export function msg_play(): InteractionEditReplyOptions {
const queue = getQueue();
const current = queue.current ? `[${formatFilePath(queue.current.path)}](${queue.current.url})` : "Nic nie gra";
const queueSongs = queue.songList
.map(audio => `[${formatFilePath(audio.path)}](${audio.url})`)
.slice(0, 10)
.map((queueItem, index) => `${index + 1}. ${queueItem}`)
return {
embeds: [
new EmbedBuilder()
.setTitle("🎵 DJ-SPANDŹBOB 🎵")
.setColor(PRIMARY_COLOR)
.addFields(
{ name: "Na Placku", value: current },
{ name: "Kolejka", value: queueSongs.length ? queueSongs.join("\n") : "Pusta Kolejka" }
)
.setTimestamp()
]
}
}
export function msg_help() {
return {
embeds: [
new EmbedBuilder()
.setDescription("")
.setTitle("🎵 DJ-SPANDŹBOB 🎵")
.setColor(PRIMARY_COLOR)
.addFields(
{ name: "Repo", value: REPO_URL },
)
.setTimestamp()
]
}
}
export function msg_skipped(song: AudioFile | null) {
if (song) {
return `Skipnięte ${formatFilePath(song.path)}`
}
return "Nic nie gra mordo"
}