From b8d72d69011194cad9e19710220c4024f714fc2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Sasovsky?= Date: Sun, 1 Oct 2023 03:35:53 +0200 Subject: [PATCH] fix: not booting (#97) --- bin/radio_horizon_production.dart | 14 +++++++++++++- lib/src/settings.dart | 3 +++ lib/src/version.dart | 2 +- pubspec.yaml | 2 +- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/bin/radio_horizon_production.dart b/bin/radio_horizon_production.dart index f1caf06..6eb62b8 100644 --- a/bin/radio_horizon_production.dart +++ b/bin/radio_horizon_production.dart @@ -6,6 +6,7 @@ import 'dart:async'; +import 'package:logging/logging.dart'; import 'package:nyxx/nyxx.dart'; import 'package:nyxx_commands/nyxx_commands.dart'; import 'package:radio_horizon/radio_horizon.dart'; @@ -20,7 +21,13 @@ Future main() async { await Sentry.init( (options) { options - ..dsn = dotEnvFlavour.dotenv['SENTRY_DSN'] + ..dsn = sentryDsn + ..environment = dotEnvFlavour.name + ..release = packageVersion + ..debug = dotEnvFlavour == DotEnvFlavour.development + ..attachStacktrace = true + ..sampleRate = 1.0 + ..sendDefaultPii = true ..tracesSampleRate = 1.0 ..addIntegration(LoggingIntegration()); }, @@ -61,6 +68,11 @@ Future main() async { // Connect await client.connect(); }, (exception, stackTrace) async { + Logger('main').severe( + 'Uncaught exception when initialising the bot', + exception, + stackTrace, + ); await Sentry.captureException(exception, stackTrace: stackTrace); }); } diff --git a/lib/src/settings.dart b/lib/src/settings.dart index 00f5523..5204e1f 100644 --- a/lib/src/settings.dart +++ b/lib/src/settings.dart @@ -88,6 +88,9 @@ bool useSSL = getEnvBool('LAVALINK_USE_SSL', def: false); String rapidapiShazamSongRecognizerKey = getEnv('RAPIDAPI_SHAZAM_SONG_RECOGNIZER_KEY'); +/// The Sentry DSN to use for this instance. +String sentryDsn = getEnv('SENTRY_DSN'); + /// The basic intents needed to run Radio Horizon without privileged intents. const int intents = GatewayIntents.directMessages | GatewayIntents.guilds | diff --git a/lib/src/version.dart b/lib/src/version.dart index fd3271b..2db1f3c 100644 --- a/lib/src/version.dart +++ b/lib/src/version.dart @@ -1,2 +1,2 @@ // Generated code. Do not modify. -const packageVersion = '1.0.0+1'; +const packageVersion = '1.2.1'; diff --git a/pubspec.yaml b/pubspec.yaml index fea64fe..9482d1c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: radio_horizon description: Radio Horizon discord bot. -version: 1.0.0+1 +version: 1.2.1 homepage: https://github.com/tomassasovsky/radio_horizon repository: https://github.com/tomassasovsky/radio_horizon documentation: https://github.com/tomassasovsky/radio_horizon