Skip to content

Commit

Permalink
fix: security issue thingy
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominik K committed Dec 27, 2023
1 parent 0b47dc2 commit 5c52759
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 22 deletions.
3 changes: 1 addition & 2 deletions src/commands/settings/custom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,7 @@ const command: ChatInputCommand = {
if (
(interaction?.member?.permissions as Readonly<PermissionsBitField>).has(
PermissionFlagsBits.ManageGuild,
) ||
global.checkDebug(guildDb, interaction?.user?.id)
)
) {
switch (interaction.options.getSubcommand()) {
case "add":
Expand Down
4 changes: 1 addition & 3 deletions src/commands/settings/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,10 @@ const command: ChatInputCommand = {

execute: async (interaction, client, guildDb) => {
let typeEmbed;

if (
(interaction.member?.permissions as Readonly<PermissionsBitField>).has(
PermissionFlagsBits.ManageGuild,
) ||
global.checkDebug(guildDb, interaction?.user?.id)
)
) {
switch (interaction.options.getSubcommand()) {
case "regular":
Expand Down
2 changes: 0 additions & 2 deletions src/global.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
declare global {
var devBot: boolean;
var wouldYouDevs: string[];
var checkDebug: (d, i) => boolean;
}

export {};
17 changes: 2 additions & 15 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 5c52759

Please sign in to comment.