From 85ab61b17d4a333a3e884b138e0c8ec96e157338 Mon Sep 17 00:00:00 2001 From: Red-GitHubBot <88117545+Red-GitHubBot@users.noreply.github.com> Date: Wed, 8 Sep 2021 20:18:17 +0200 Subject: [PATCH] [3.4] use rich console print for red colour (#5184) (#5253) (cherry picked from commit 2ab46fbe418108be665c137c96c493d37ab7d35b) Co-authored-by: Vexed Co-authored-by: Vexed --- redbot/__main__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/redbot/__main__.py b/redbot/__main__.py index 1af3486ea..f47ef3526 100644 --- a/redbot/__main__.py +++ b/redbot/__main__.py @@ -18,6 +18,7 @@ from pathlib import Path from typing import NoReturn import discord +import rich # Set the event loop policies here so any subsequent `new_event_loop()` # calls, in particular those as a result of the following imports, @@ -395,10 +396,12 @@ async def run_bot(red: Red, cli_flags: Namespace) -> None: sys.exit(0) sys.exit(1) except discord.PrivilegedIntentsRequired: - print( + console = rich.get_console() + console.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" + "https://docs.discord.red/en/stable/bot_application_guide.html#enabling-privileged-intents", + style="red", ) sys.exit(1)