Please describe the problem you are having in as much detail as possible:
Seek command can cause a crash if 24/7 is enabled while bot is not playing anything.
Prerequisites
master branch
"24/7": true (botconfig.js)
Reproduction Steps
Play any track with the music bot on a channel.
End the track e.g., >skip or >seek to the end of the track.
While the bot is not playing anything, use seek command, e.g., >seek 1s
In this step, the bot should still be in the channel while it is not playing anything because 24/7 is enabled.
Bot crashes.
See error on console
C:\Users\A\Desktop\Test\Discord-MusicBot-master\commands\seek.js:40
if (!player.queue.current.isSeekable)
^
TypeError: Cannot read properties of null (reading 'isSeekable')
at Object.run (C:\Users\A\Desktop\Test\Discord-MusicBot-master\commands\se
ek.js:40:31)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
Node.js v17.4.0
**Expected Behaviour**
Bot is supposed to say this string
` ❌ | **Nothing is playing right now...**"`
**Possible Fix**
https://github.com/SudhanPlayz/Discord-MusicBot/blob/1a73e72dce3a4b282f8cb5a8ec3c66e43b612840/commands/seek.js#L26
```diff
- );
+ );
+ if (!player.queue.current)
+ return client.sendTime(
+ message.channel,
+ "❌ | **Nothing is playing right now...**"
+ );
Bot no longer crashes after I added this on my end, the fix could be better, I guess.
Include a reproducible code sample here, if possible:
N/A
Please describe the problem you are having in as much detail as possible: Seek command can cause a crash if 24/7 is enabled while bot is not playing anything.
Prerequisites
Reproduction Steps
>seek 1s
TypeError: Cannot read properties of null (reading 'isSeekable') at Object.run (C:\Users\A\Desktop\Test\Discord-MusicBot-master\commands\se ek.js:40:31) at processTicksAndRejections (node:internal/process/task_queues:96:5)
Node.js v17.4.0
Bot no longer crashes after I added this on my end, the fix could be better, I guess.
Include a reproducible code sample here, if possible: N/A
Further details:
Relevant client options: