format wiadomości
This commit is contained in:
@@ -1,17 +1,83 @@
|
||||
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 `
|
||||
Request: ${url}
|
||||
https://gitea.papryk.com/Papryk/dj-spangebob pull requesty milewidziane XD\n` + getQueueMsg()
|
||||
return `TODO-3`
|
||||
}
|
||||
|
||||
export function getCurrentSongMsg(): string {
|
||||
return 'TODO-1'
|
||||
}
|
||||
export function getQueueMsg(): string {
|
||||
const queue = getQueue()
|
||||
return `Current: ${queue.current?.replace("/app/data/", "").replace(/\[.*\].opus/,"").trim()}
|
||||
Queue:
|
||||
${queue.songList.join('\n ').replace(/\/app\/data\//g, "").replace(/\[.*\].opus/g,"").trim()}`
|
||||
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"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user