File tree Expand file tree Collapse file tree 4 files changed +12
-2
lines changed Expand file tree Collapse file tree 4 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 1- import sys ; import os ; sys .path .insert (0 , os .path .abspath (os .path .join (os .path .dirname (__file__ ), '..' ))) # noqa: E702
1+ import sys
2+ import os
3+
4+ sys .path .insert (
5+ 0 , os .path .abspath (os .path .join (os .path .dirname (__file__ ), ".." ))
6+ ) # noqa: E702
27# the above line allows us to import from src without any issues whilst using src/__main__.py
38from src .config import config
49import importlib .util
@@ -31,6 +36,7 @@ async def pre_main():
3136 # we import main here to apply patches before importing the most things we can
3237 # and allow the patches to be applied to later imported modules
3338 from src .start import main
39+
3440 await main ()
3541
3642
Original file line number Diff line number Diff line change @@ -25,5 +25,7 @@ async def handle_error(
2525 message = "Whoops! An error occurred while executing this command"
2626 if out :
2727 message += f"\n \n -# This error has been reported to the developers - `{ out } `"
28- await ctx .respond (message , ephemeral = True ) # pyright: ignore[reportUnknownMemberType]
28+ await ctx .respond (
29+ message , ephemeral = True
30+ ) # pyright: ignore[reportUnknownMemberType]
2931 raise error
Original file line number Diff line number Diff line change @@ -30,5 +30,6 @@ async def on_error(
3030 ):
3131 await handle_error (error , ctx , self .sentry_sdk )
3232
33+
3334def setup (bot : discord .Bot , config : dict [str , Any ]) -> None :
3435 bot .add_cog (NiceErrors (bot , bool (config .get ("sentry" , {}).get ("dsn" ))))
Original file line number Diff line number Diff line change 11from typing import Any
22from .handler import handle_error
33
4+
45async def patch (config : dict [str , Any ]):
56 sentry_sdk = None
67 if config .get ("sentry" , {}).get ("dsn" ):
You can’t perform that action at this time.
0 commit comments