This commit is contained in:
Xargana 2025-04-17 17:07:56 +03:00
parent 9df17b4a9d
commit 7ca886aa2e

View file

@ -11,7 +11,11 @@ class SystemCommandBase extends CommandBase {
// Add security check for all system commands // Add security check for all system commands
const originalExecute = this.execute; const originalExecute = this.execute;
this.execute = async function(interaction) { this.execute = async function(interaction) {
if (interaction.user.id !== process.env.AUTHORIZED_USER_ID) { // Get authorized users from the bot instance
const authorizedUserIds = client.bot?.authorizedUserIds || [];
// Check if user ID is in the authorized users array
if (!authorizedUserIds.includes(interaction.user.id)) {
return interaction.reply({ return interaction.reply({
content: "You are not authorized to use system commands.", content: "You are not authorized to use system commands.",
ephemeral: true ephemeral: true