Just-Some-Bots / MusicBot

:musical_note: The original MusicBot for Discord (formerly SexualRhinoceros/MusicBot)
https://just-some-bots.github.io/MusicBot/
MIT License
3.11k stars 2.35k forks source link

Error on bot startup #2313

Closed Azsunyx closed 1 year ago

Azsunyx commented 1 year ago

What went wrong?

I get multiple errors on bot startup following running an update, see text below

How do we reproduce this?

I tried updating an old version and initially encountered the error, so I tried to do a fresh install and encountered the same error.

Here is the full startup error:

[INFO] launcher: Starting sanity checks [INFO] launcher: Checking for Python 3.8+ [INFO] launcher: Checking console encoding [INFO] launcher: Setting console encoding to UTF-8 [INFO] launcher: Ensuring we're in the right environment [INFO] launcher: Adding local bins/ folder to path [INFO] launcher: Required checks passed. [INFO] launcher: Optional checks passed.

WARNING: Aliases file not found, copying example_aliases.json Starting MusicBot release-151221-1-g1df26df Loaded autoplaylist with 2531 entries Authenticated with Spotify successfully using client ID and secret. [ERROR:bot] Error in cleanup Traceback (most recent call last): File "C:\Users\zexyn\OneDrive\Documents\MusicBot\musicbot\bot.py", line 1070, in run self.loop.run_until_complete(self.start(*self.config.auth)) File "C:\Users\zexyn\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 646, in run_until_complete return future.result() File "C:\Users\zexyn\AppData\Roaming\Python\Python310\site-packages\discord\client.py", line 658, in start await self.connect(reconnect=reconnect) File "C:\Users\zexyn\AppData\Roaming\Python\Python310\site-packages\discord\client.py", line 599, in connect raise PrivilegedIntentsRequired(exc.shard_id) from None discord.errors.PrivilegedIntentsRequired: Shard ID None is requesting privileged intents that have not been explicitly enabled in the developer portal. It is recommended to go to https://discord.com/developers/applications/ and explicitly enable the privileged intents within your application's page. If this is not possible, then consider disabling the privileged intents instead.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\zexyn\OneDrive\Documents\MusicBot\musicbot\bot.py", line 1082, in run self._cleanup() File "C:\Users\zexyn\OneDrive\Documents\MusicBot\musicbot\bot.py", line 1057, in _cleanup pending = asyncio.all_tasks() File "C:\Users\zexyn\AppData\Local\Programs\Python\Python310\lib\asyncio\tasks.py", line 45, in all_tasks loop = events.get_running_loop() RuntimeError: no running event loop [ERROR] launcher: Error starting bot Traceback (most recent call last): File "C:\Users\zexyn\OneDrive\Documents\MusicBot\run.py", line 416, in main m.run() File "C:\Users\zexyn\OneDrive\Documents\MusicBot\musicbot\bot.py", line 1070, in run self.loop.run_until_complete(self.start(*self.config.auth)) File "C:\Users\zexyn\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 646, in run_until_complete return future.result() File "C:\Users\zexyn\AppData\Roaming\Python\Python310\site-packages\discord\client.py", line 658, in start await self.connect(reconnect=reconnect) File "C:\Users\zexyn\AppData\Roaming\Python\Python310\site-packages\discord\client.py", line 599, in connect raise PrivilegedIntentsRequired(exc.shard_id) from None discord.errors.PrivilegedIntentsRequired: Shard ID None is requesting privileged intents that have not been explicitly enabled in the developer portal. It is recommended to go to https://discord.com/developers/applications/ and explicitly enable the privileged intents within your application's page. If this is not possible, then consider disabling the privileged intents instead.

[INFO] launcher: All done.

musicbot.log

I'm running Python 3.10.7

Which version of the bot are you using?

release-151221

Which operating system are you using?

Windows 7 or higher

Just checking...

Alllen95Wei commented 1 year ago

@Azsunyx Did you turn on all the "Privileged Gateway Intents"? image

https://discord.com/developers/applications/ → Click the bot → "Bot" → Scroll down → "Privileged Gateway Intents" → Turn on all switchs

Azsunyx commented 1 year ago

That fixed it, thank you, not sure how one of the options got deselected, but it appears to be working now, thank you