Skip to content

Commit

Permalink
Partially added seek function
Browse files Browse the repository at this point in the history
  • Loading branch information
Olebeh committed Sep 23, 2022
1 parent 7aba9fd commit 00d8954
Show file tree
Hide file tree
Showing 8 changed files with 208 additions and 19 deletions.
188 changes: 188 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
"dependencies": {
"@discordjs/opus": "^0.8.0",
"@discordjs/voice": "^0.11.0",
"@types/fluent-ffmpeg": "^2.1.20",
"discord.js": "^14.3.0",
"ffmpeg-static": "^5.1.0",
"genius-lyrics": "^4.4.0",
"get-audio-duration": "^3.1.0",
"play-dl": "^1.9.5",
Expand All @@ -32,7 +34,6 @@
"directories": {
"example": "examples"
},
"devDependencies": {},
"repository": {
"type": "git",
"url": "git+https://github.com/Olebeh/olebeh-music-player.git"
Expand Down
3 changes: 1 addition & 2 deletions src/Player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ export class Player extends TypedEmitter<PlayerEvents> {

this.client.on(`voiceStateUpdate`, async (oldState, newState) => {
if (oldState.channel?.id && !newState.channel?.id && oldState.member?.id === this.client.user.id) {
console.log('disconnected')
const queue = this.getQueue(newState.guild.id)

if (!queue) return
Expand Down Expand Up @@ -356,7 +355,7 @@ export class Player extends TypedEmitter<PlayerEvents> {
return await SpotifySearchResult(undefined, playlist)
}
} else {
if (query.includes('://cdn.discordapp.com/') || query.includes('://media.discordapp.net/') && !query.includes(' ')) {
if (query) {
const trackInfo = await fetch(query)
const duration = await getAudioDuration(query)
const track = new Track(this, {
Expand Down
Loading

0 comments on commit 00d8954

Please sign in to comment.