Skip to content

Commit

Permalink
Implement Sentry
Browse files Browse the repository at this point in the history
  • Loading branch information
andresdelfino committed Jun 22, 2024
1 parent 68e8094 commit cea8fdf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions bin/run_bot.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import os

from telegram.ext import Application, MessageHandler, filters
import sentry_sdk

from pycamp_bot.commands import auth
from pycamp_bot.commands import voting
from pycamp_bot.commands import manage_pycamp
Expand All @@ -12,6 +15,12 @@
from pycamp_bot.models import models_db_connection
from pycamp_bot.logger import logger


SENTRY_DATA_SOURCE_NAME_ENVVAR = 'SENTRY_DATA_SOURCE_NAME'
if SENTRY_DATA_SOURCE_NAME_ENVVAR in os.environ:
sentry_sdk.init(dsn=os.environ[SENTRY_DATA_SOURCE_NAME_ENVVAR])


async def unknown_command(update, context):
text = "No reconozco el comando, para ver comandos válidos usá /ayuda"
await context.bot.send_message(chat_id=update.message.chat_id, text=text)
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ dependencies = [
"munch==4.0.0",
"python-telegram-bot==21.3",
"peewee==3.17.5",
"sentry-sdk==2.6.0",
]
requires-python = "==3.10.*"
authors = [
Expand Down

0 comments on commit cea8fdf

Please sign in to comment.