66from math import floor , isfinite
77
88import disnake
9- import sentry_sdk
109from disnake import Intents
1110from disnake .ext import commands
1211from disnake .ext .commands import CheckFailure , CommandInvokeError , CommandNotFound , UserInputError
1817ORG_NAME = os .environ .get ("ORG_NAME" , "avrae" )
1918DISCORD_TOKEN = os .getenv ("DISCORD_TOKEN" )
2019GITHUB_TOKEN = os .getenv ("GITHUB_TOKEN" )
21- SENTRY_DSN = os .getenv ('SENTRY_DSN' ) or None
2220
2321
2422class Taine (commands .AutoShardedBot ):
2523 def __init__ (self , * args , ** kwargs ):
2624 super (Taine , self ).__init__ (* args , ** kwargs )
2725
28- if SENTRY_DSN is not None :
29- sentry_sdk .init (dsn = SENTRY_DSN , environment = "Production" )
30-
31- @staticmethod
32- def log_exception (exception = None ):
33- if SENTRY_DSN is not None :
34- sentry_sdk .capture_exception (exception )
35-
3626
3727intents = Intents .all ()
3828bot = Taine (
@@ -69,10 +59,6 @@ async def on_command_error(ctx, error):
6959 if isinstance (error , CommandInvokeError ):
7060 error = error .original
7161
72- # send error to sentry.io
73- if not isinstance (error , (ReportException , UserInputError , CheckFailure )):
74- bot .log_exception (error )
75-
7662 await ctx .message .channel .send (f"Error: { error } " )
7763 for line in traceback .format_exception (type (error ), error , error .__traceback__ ):
7864 log .warning (line )
@@ -83,10 +69,6 @@ async def on_slash_command_error(inter, error):
8369 if isinstance (error , CommandInvokeError ):
8470 error = error .original
8571
86- # send error to sentry.io
87- if not isinstance (error , (ReportException , UserInputError , CheckFailure )):
88- bot .log_exception (error )
89-
9072 await inter .response .send_message (f"Error: { error } " )
9173 for line in traceback .format_exception (type (error ), error , error .__traceback__ ):
9274 log .warning (line )
0 commit comments