added history

This commit is contained in:
Patryk Koreń
2026-01-27 21:27:36 +01:00
parent bb2b31bb61
commit cbf39d2bae
5 changed files with 44 additions and 4 deletions

View File

@@ -3,6 +3,7 @@ import { player } from "./main";
import { CacheType, ChatInputCommandInteraction } from "discord.js";
import { getAudioFile } from "./util/downloader";
import { playSong } from "./util/helpers";
import { add_to_history } from "./util/history";
const queue: Queue = {
songList: [],
@@ -11,12 +12,14 @@ const queue: Queue = {
export async function requestSong(
interaction: ChatInputCommandInteraction<CacheType>,
url: string) {
url: string,
user?: any
) {
const path = await getAudioFile(url)
queue.songList.push({ path, url })
add_to_history({ interaction, url })
updatePlayer()
}
export async function forceRequestSong(