Update to d.py 1.5.1, explicitly request privileged intents (#4423)

Co-authored-by: Draper <27962761+Drapersniper@users.noreply.github.com>
This commit is contained in:
jack1142
2020-10-21 20:55:25 +02:00
committed by GitHub
parent 34fe88da29
commit e1226c6c88
8 changed files with 69 additions and 6 deletions

View File

@@ -300,7 +300,7 @@ def handle_edit(cli_flags: Namespace):
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
data_manager.load_basic_configuration(cli_flags.instance_name)
red = Red(cli_flags=cli_flags, description="Red V3", dm_help=None, fetch_offline_members=True)
red = Red(cli_flags=cli_flags, description="Red V3", dm_help=None)
try:
driver_cls = drivers.get_driver_class()
loop.run_until_complete(driver_cls.initialize(**data_manager.storage_details()))
@@ -391,6 +391,13 @@ async def run_bot(red: Red, cli_flags: Namespace) -> None:
print("Token has been reset.")
sys.exit(0)
sys.exit(1)
except discord.PrivilegedIntentsRequired:
print(
"Red requires all Privileged Intents to be enabled.\n"
"You can find out how to enable Privileged Intents with this guide:\n"
"https://docs.discord.red/en/stable/bot_application_guide.html#enabling-privileged-intents"
)
sys.exit(1)
return None
@@ -487,9 +494,7 @@ def main():
data_manager.load_basic_configuration(cli_flags.instance_name)
red = Red(
cli_flags=cli_flags, description="Red V3", dm_help=None, fetch_offline_members=True
)
red = Red(cli_flags=cli_flags, description="Red V3", dm_help=None)
if os.name != "nt":
# None of this works on windows.