fix: rozpierdalał sie przy dodawaniu do kolejki kiedy coś grało
This commit is contained in:
@@ -18,24 +18,25 @@ export function toggleLoop(): AudioFile | null {
|
||||
}
|
||||
|
||||
export async function requestSong(
|
||||
interaction: ChatInputCommandInteraction<CacheType>,
|
||||
url: string,
|
||||
user?: any
|
||||
data: Partial<HistoryObject>
|
||||
) {
|
||||
|
||||
const path = await getAudioFile(url)
|
||||
queue.songList.push({ path, url })
|
||||
add_to_history({ interaction, url })
|
||||
updatePlayer()
|
||||
getAudioFile(url).then((path) => {
|
||||
queue.songList.push({ path, url })
|
||||
add_to_history({ url, user: data.user })
|
||||
updatePlayer()
|
||||
})
|
||||
}
|
||||
|
||||
export async function forceRequestSong(
|
||||
interaction: ChatInputCommandInteraction<CacheType>,
|
||||
url: string) {
|
||||
url: string,
|
||||
data: Partial<HistoryObject>
|
||||
) {
|
||||
|
||||
const path = await getAudioFile(url)
|
||||
const audio = { path, url }
|
||||
queue.songList.push(audio)
|
||||
add_to_history({ url, user: data.user })
|
||||
queue.current = audio
|
||||
playSong(player, path);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user