Enhance bot functionality with new features and improvements
- Updated package dependencies to include `@sentry/node` for error tracking. - Refactored command routing to incorporate user and guild blacklisting checks, improving command execution safety. - Enhanced health server metrics to include queue waiting times, providing better insights into system performance. - Introduced confirmation handling for guild backup commands, streamlining user interactions. - Improved moderation commands with better error handling and case management, ensuring robust moderation capabilities. - Added new duration parsing functions to handle timeout durations effectively, enhancing moderation features. - Updated localization files to reflect new command structures and user guidance improvements.
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
"@radix-ui/react-separator": "^1.1.12",
|
||||
"@radix-ui/react-slot": "^1.3.0",
|
||||
"@radix-ui/react-switch": "^1.3.4",
|
||||
"@sentry/node": "^10.67.0",
|
||||
"bullmq": "^5.34.0",
|
||||
"class-variance-authority": "^0.7.1",
|
||||
"clsx": "^2.1.1",
|
||||
|
||||
6
apps/webui/src/instrumentation.ts
Normal file
6
apps/webui/src/instrumentation.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
export async function register(): Promise<void> {
|
||||
if (process.env.NEXT_RUNTIME === 'nodejs') {
|
||||
const { initWebuiSentry } = await import('./lib/sentry');
|
||||
initWebuiSentry();
|
||||
}
|
||||
}
|
||||
32
apps/webui/src/lib/sentry.ts
Normal file
32
apps/webui/src/lib/sentry.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import * as Sentry from '@sentry/node';
|
||||
import { env } from './env';
|
||||
|
||||
let initialized = false;
|
||||
|
||||
export function initWebuiSentry(): void {
|
||||
if (initialized || !env.SENTRY_DSN) {
|
||||
return;
|
||||
}
|
||||
Sentry.init({
|
||||
dsn: env.SENTRY_DSN,
|
||||
environment: env.NODE_ENV,
|
||||
release: 'nexumi-webui@0.1.0',
|
||||
tracesSampleRate: env.NODE_ENV === 'production' ? 0.1 : 1.0,
|
||||
initialScope: {
|
||||
tags: { service: 'webui' }
|
||||
}
|
||||
});
|
||||
initialized = true;
|
||||
}
|
||||
|
||||
export function captureWebuiException(error: unknown, context?: Record<string, unknown>): void {
|
||||
if (!env.SENTRY_DSN) {
|
||||
return;
|
||||
}
|
||||
Sentry.withScope((scope) => {
|
||||
if (context) {
|
||||
scope.setExtras(context);
|
||||
}
|
||||
Sentry.captureException(error);
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user