diff --git a/redbot/core/_cli.py b/redbot/core/_cli.py index 312d3c999..886c9421f 100644 --- a/redbot/core/_cli.py +++ b/redbot/core/_cli.py @@ -137,6 +137,12 @@ def parse_cli_flags(args): ) parser.add_argument("--version", "-V", action="store_true", help="Show Red's current version") parser.add_argument("--debuginfo", action="store_true", help="Show debug information.") + parser.add_argument( + "--enable-debug-events", + action="store_true", + help="Enable discord.py raw socket events (on_socket_raw_receive and on_socket_raw_send)." + " This may reduce the bot's performance significantly.", + ) parser.add_argument( "--list-instances", action="store_true", diff --git a/redbot/core/bot.py b/redbot/core/bot.py index 891a7cadd..2af27c4b7 100644 --- a/redbot/core/bot.py +++ b/redbot/core/bot.py @@ -249,6 +249,9 @@ class Red( kwargs["max_messages"] = message_cache_size self._max_messages = message_cache_size + if cli_flags.enable_debug_events: + kwargs["enable_debug_events"] = True + self._uptime = None self._checked_time_accuracy = None