mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 03:08:55 -05:00
* First commit - Bring everything from dev cog minus NSFW support * Add a toggle for auto deafen * Add a one off Send to Owners * aaaaaaa * Update this to ensure `get_perms` is not called if the API is disabled * Apply suggestions from code review Co-authored-by: Vuks <51289041+Vuks69@users.noreply.github.com> * silence any errors here (in case API is down so it doesnt affect audio) * update the message to tell the mto join the Official Red server. * remove useless sutff, and change dj check order to ensure bot doesnt join VC for non DJ's * ffs * Update redbot/cogs/audio/core/tasks/startup.py Co-authored-by: Twentysix <Twentysix26@users.noreply.github.com> * Aikas Review * Add #3995 in here * update * *sigh* * lock behind owner * to help with debugging * Revert "to help with debugging" This reverts commit 8cbf17be * resolve last review Co-authored-by: Vuks <51289041+Vuks69@users.noreply.github.com> Co-authored-by: Twentysix <Twentysix26@users.noreply.github.com>
19 lines
427 B
Python
19 lines
427 B
Python
import logging
|
|
import sys
|
|
|
|
from typing import Final
|
|
|
|
IS_DEBUG: Final[bool] = "--debug" in sys.argv
|
|
|
|
|
|
def is_debug() -> bool:
|
|
return IS_DEBUG
|
|
|
|
|
|
def debug_exc_log(lg: logging.Logger, exc: Exception, msg: str = None) -> None:
|
|
"""Logs an exception if logging is set to DEBUG level"""
|
|
if lg.getEffectiveLevel() <= logging.DEBUG:
|
|
if msg is None:
|
|
msg = f"{exc}"
|
|
lg.exception(msg, exc_info=exc)
|