a
This commit is contained in:
parent
4b18ab3496
commit
38385a9761
|
@ -57,17 +57,7 @@ class Bot {
|
||||||
|
|
||||||
// Interaction event
|
// Interaction event
|
||||||
this.client.on("interactionCreate", async (interaction) => {
|
this.client.on("interactionCreate", async (interaction) => {
|
||||||
// Only process commands if:
|
// Only process commands if the user is authorized
|
||||||
// 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (interaction.user.id !== this.authorizedUserId) {
|
if (interaction.user.id !== this.authorizedUserId) {
|
||||||
console.log(`Unauthorized access attempt by ${interaction.user.tag} (${interaction.user.id})`);
|
console.log(`Unauthorized access attempt by ${interaction.user.tag} (${interaction.user.id})`);
|
||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
|
@ -92,7 +82,7 @@ class Bot {
|
||||||
async sendStartupNotification() {
|
async sendStartupNotification() {
|
||||||
// Create startup embed
|
// Create startup embed
|
||||||
const startupEmbed = {
|
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>`,
|
description: `Bot started successfully at <t:${Math.floor(Date.now() / 1000)}:F>`,
|
||||||
color: 0x00ff00,
|
color: 0x00ff00,
|
||||||
fields: [
|
fields: [
|
||||||
|
@ -108,7 +98,7 @@ class Bot {
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
footer: {
|
footer: {
|
||||||
text: "VPS Control Bot"
|
text: "blahaj.tr"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -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);
|
return originalExecute.call(this, interaction);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue