From 5c5275987bc51f618c9ed74ae8664413464e61e5 Mon Sep 17 00:00:00 2001 From: Dominik K Date: Wed, 27 Dec 2023 22:39:10 +0100 Subject: [PATCH] fix: security issue thingy --- src/commands/settings/custom.ts | 3 +-- src/commands/settings/type.ts | 4 +--- src/global.d.ts | 2 -- src/index.ts | 17 ++--------------- 4 files changed, 4 insertions(+), 22 deletions(-) diff --git a/src/commands/settings/custom.ts b/src/commands/settings/custom.ts index 20715cd4..636abc9f 100644 --- a/src/commands/settings/custom.ts +++ b/src/commands/settings/custom.ts @@ -121,8 +121,7 @@ const command: ChatInputCommand = { if ( (interaction?.member?.permissions as Readonly).has( PermissionFlagsBits.ManageGuild, - ) || - global.checkDebug(guildDb, interaction?.user?.id) + ) ) { switch (interaction.options.getSubcommand()) { case "add": diff --git a/src/commands/settings/type.ts b/src/commands/settings/type.ts index ba2a030e..71d35992 100644 --- a/src/commands/settings/type.ts +++ b/src/commands/settings/type.ts @@ -44,12 +44,10 @@ const command: ChatInputCommand = { execute: async (interaction, client, guildDb) => { let typeEmbed; - if ( (interaction.member?.permissions as Readonly).has( PermissionFlagsBits.ManageGuild, - ) || - global.checkDebug(guildDb, interaction?.user?.id) + ) ) { switch (interaction.options.getSubcommand()) { case "regular": diff --git a/src/global.d.ts b/src/global.d.ts index f2892fb1..87568329 100644 --- a/src/global.d.ts +++ b/src/global.d.ts @@ -1,7 +1,5 @@ declare global { var devBot: boolean; - var wouldYouDevs: string[]; - var checkDebug: (d, i) => boolean; } export {}; diff --git a/src/index.ts b/src/index.ts index 0518dc03..542bbd32 100644 --- a/src/index.ts +++ b/src/index.ts @@ -28,28 +28,15 @@ if (botId !== "981649513427111957" || process.env.STATUS === "DEVELOPMENT") { ); } -var dsnKey = process.env.SENTRY_DSN as string; - -if (dsnKey) { +if (process.env.SENTRY_DSN) { init({ - dsn: dsnKey, + dsn: process.env.SENTRY_DSN, // Performance Monitoring tracesSampleRate: 0.5, // 1.0 means that 100% of transactions will be sent to Sentry integrations: [...autoDiscoverNodePerformanceMonitoringIntegrations()], }); } -global.wouldYouDevs = [ - "805898988402376725", // Finn - "347077478726238228", // Dominik - "268843733317976066", // Sky - "510759794911739905", // Alt -]; - -global.checkDebug = (d, i) => { - return d?.debugMode ?? global?.wouldYouDevs?.includes(i); -}; - const client = new WouldYou(); client.loginBot().then(() => { console.log(