This commit is contained in:
Xargana 2025-04-16 23:02:51 +03:00
parent 4b18ab3496
commit 38385a9761
2 changed files with 3 additions and 21 deletions

View file

@ -57,17 +57,7 @@ class Bot {
// Interaction event
this.client.on("interactionCreate", async (interaction) => {
// Only process commands if:
// 1. It's a DM channel
// 2. The user is authorized
if (interaction.channel?.type !== ChannelType.DM) {
await interaction.reply({
content: "This bot only works in direct messages for security reasons.",
ephemeral: true
});
return;
}
// Only process commands if the user is authorized
if (interaction.user.id !== this.authorizedUserId) {
console.log(`Unauthorized access attempt by ${interaction.user.tag} (${interaction.user.id})`);
await interaction.reply({
@ -92,7 +82,7 @@ class Bot {
async sendStartupNotification() {
// Create startup embed
const startupEmbed = {
title: "VPS Control Bot Status",
title: "blahaj.tr bot status update",
description: `Bot started successfully at <t:${Math.floor(Date.now() / 1000)}:F>`,
color: 0x00ff00,
fields: [
@ -108,7 +98,7 @@ class Bot {
}
],
footer: {
text: "VPS Control Bot"
text: "blahaj.tr"
}
};

View file

@ -18,14 +18,6 @@ class SystemCommandBase extends CommandBase {
});
}
// Additional DM-only check
if (interaction.channel.type !== 'DM') {
return interaction.reply({
content: "System commands can only be used in Direct Messages for security.",
ephemeral: true
});
}
return originalExecute.call(this, interaction);
};
}