Closed RyanL-29 closed 4 years ago
I find solution of fixing the suddenly disconnect problem and the problem that I mention up there. Using the review version instead of the master version of the bot. Command: git clone https://github.com/Just-Some-Bots/MusicBot.git MusicBot -b review First, you need to one things in the bot.py (path: somewhere\Musicbot\musicbot\bot.py) Using any editor that can edit .py file e.g. Visual Studio Find the line below (Line: 2253)
if player.is_playing:
# TODO: Fix timedelta garbage with util function
song_progress = ftimedelta(timedelta(seconds=player.progress))
song_total = ftimedelta(timedelta(seconds=player.current_entry.duration)) if player.current_entry.duration != None else '(no duration data)'
prog_str = '`[%s/%s]`' % (song_progress, song_total)
if player.current_entry.meta.get('channel', False) and player.current_entry.meta.get('author', False):
lines.append(self.str.get('cmd-queue-playing-author', "Currently playing: `{0}` added by `{1}` {2}\n").format(
player.current_entry.title, player.current_entry.meta['author'].name, prog_str))
else:
lines.append(self.str.get('cmd-queue-playing-noauthor', "Currently playing: `{0}` {1}\n").format(player.current_entry.title, prog_str))
Change it to
if player.is_playing:
# TODO: Fix timedelta garbage with util function
song_progress = ftimedelta(timedelta(seconds=player.progress)) if player.progress != None else '(no progress data)'
song_total = ftimedelta(timedelta(seconds=player.current_entry.duration)) if player.current_entry.duration != None else '(no duration data)'
prog_str = '`[%s/%s]`' % (song_progress, song_total)
if player.current_entry.meta.get('channel', False) and player.current_entry.meta.get('author', False):
lines.append(self.str.get('cmd-queue-playing-author', "Currently playing: `{0}` added by `{1}` {2}\n").format(
player.current_entry.title, player.current_entry.meta['author'].name, prog_str))
else:
lines.append(self.str.get('cmd-queue-playing-noauthor', "Currently playing: `{0}` {1}\n").format(player.current_entry.title, prog_str))
Than save the file.
Second, go to the python site-packages (path: somewhere\AppData\Roaming\Python\Python37\site-packages)
Find the discord and discord.py-1.2.5.dist-info. Delete them
Open your command prompt, type: pip install discord.py[voice]
Than you almost done.
Just go back to the bot root file and click run.bat
Enjoy!
Sorry about that some additional information after the issue closed.
Remember: Don't allow user to add BiliBili video link to the playlist. Although BiliBili video can use youtube-dl module to let it download and play but it will let the bot getting some error on that if those videos are not allow to watch in your country or the video need for pay to watch.
I find solution of fixing the suddenly disconnect problem and the problem that I mention up there. Using the review version instead of the master version of the bot. Command: git clone https://github.com/Just-Some-Bots/MusicBot.git MusicBot -b review First, you need to one things in the bot.py (path: somewhere\Musicbot\musicbot\bot.py) Using any editor that can edit .py file e.g. Visual Studio Find the line below (Line: 2253)
if player.is_playing: # TODO: Fix timedelta garbage with util function song_progress = ftimedelta(timedelta(seconds=player.progress)) song_total = ftimedelta(timedelta(seconds=player.current_entry.duration)) if player.current_entry.duration != None else '(no duration data)' prog_str = '`[%s/%s]`' % (song_progress, song_total) if player.current_entry.meta.get('channel', False) and player.current_entry.meta.get('author', False): lines.append(self.str.get('cmd-queue-playing-author', "Currently playing: `{0}` added by `{1}` {2}\n").format( player.current_entry.title, player.current_entry.meta['author'].name, prog_str)) else: lines.append(self.str.get('cmd-queue-playing-noauthor', "Currently playing: `{0}` {1}\n").format(player.current_entry.title, prog_str))
Change it to
if player.is_playing: # TODO: Fix timedelta garbage with util function song_progress = ftimedelta(timedelta(seconds=player.progress)) if player.progress != None else '(no progress data)' song_total = ftimedelta(timedelta(seconds=player.current_entry.duration)) if player.current_entry.duration != None else '(no duration data)' prog_str = '`[%s/%s]`' % (song_progress, song_total) if player.current_entry.meta.get('channel', False) and player.current_entry.meta.get('author', False): lines.append(self.str.get('cmd-queue-playing-author', "Currently playing: `{0}` added by `{1}` {2}\n").format( player.current_entry.title, player.current_entry.meta['author'].name, prog_str)) else: lines.append(self.str.get('cmd-queue-playing-noauthor', "Currently playing: `{0}` {1}\n").format(player.current_entry.title, prog_str))
Than save the file.
Second, go to the python site-packages (path: somewhere\AppData\Roaming\Python\Python37\site-packages)
Find the discord and discord.py-1.2.5.dist-info. Delete them
Open your command prompt, type: pip install discord.py[voice]
Than you almost done.
Just go back to the bot root file and click run.bat
Enjoy!
This didn't work for me, I tried adding your code, I don't know why put that entire block of code, you only appended to one line (line 4 in the above snippit with your modification):
if player.progress != None else '(no progress data)'
I also removed the discord.py-1.2.5.dist-info and did a pip install of discord.py, everything installed successfully but still no luck, thanks for trying anyway.
(4 running on Ubuntu 18.04, 3 on Windows 10 Pro 64 bit, all 7 still crashing)
Please tick all applicable boxes.
[x] I am using Python 3.5.3 or higher (run
python --version
on the command line)[x] I have followed the official guides to install the bot for my system
[x] I have updated my dependencies to the latest version using the appropriate
update
scriptWhich version are you using? Python 3.7
master
version (release-260419)review
versionWhat type of issue are you creating?
Description of issue
Traceback (most recent call last): File "C:\Users\Server\Desktop\MusicBot\musicbot\bot.py", line 2813, in on_message response = await handler(**handler_kwargs) File "C:\Users\Server\Desktop\MusicBot\musicbot\bot.py", line 2243, in cmd_queue song_progress = ftimedelta(timedelta(seconds=player.progress)) TypeError: unsupported type for timedelta seconds component: NoneType
Steps to reproduce