diff --git a/example.env b/example.env index 248b1d6..10e1591 100644 --- a/example.env +++ b/example.env @@ -1,2 +1,3 @@ DISCORD_TOKEN= DISCORD_GUILD_ID= +SENTRY_DSN= diff --git a/pyproject.toml b/pyproject.toml index 2ac7613..68b3e2f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,6 +12,7 @@ dependencies = [ "discord.py==2.4.0", "feedparser==6.0.11", "beautifulsoup4==4.12.3", + "sentry-sdk==2.18.0", ] classifiers = [ "Private :: Do Not Upload" diff --git a/src/sr/discord_bot/__main__.py b/src/sr/discord_bot/__main__.py index 6866433..ac957e2 100644 --- a/src/sr/discord_bot/__main__.py +++ b/src/sr/discord_bot/__main__.py @@ -1,6 +1,7 @@ import os import sys import logging +import sentry_sdk from dotenv import load_dotenv from discord import Intents @@ -12,6 +13,10 @@ handler = logging.StreamHandler(sys.stdout) handler.setLevel(logging.INFO) logger.addHandler(handler) +sentry_sdk.init( + dsn=os.getenv("SENTRY_DSN"), + traces_sample_rate=1.0, +) intents = Intents.default() intents.members = True # Listen to member joins