diff --git a/events/client/interactionCreate.js b/events/client/interactionCreate.js index cc7ee93..e420b62 100644 --- a/events/client/interactionCreate.js +++ b/events/client/interactionCreate.js @@ -42,6 +42,11 @@ export default { return interaction.reply({ content: '❌ This command is reserved for the owner!', ephemeral: true }); } + // Guild only check + if (command.guildOnly && !interaction.guild) { + return interaction.reply({ content: '❌ This command only work in a server!', ephemeral: true }); + } + // Check if the bot has the needed permissions if (command.default_permission) { const clientMember = await interaction.guild.members.fetch(client.user.id); diff --git a/events/client/messageCreate.js b/events/client/messageCreate.js index e7924dc..75cfd18 100644 --- a/events/client/messageCreate.js +++ b/events/client/messageCreate.js @@ -307,6 +307,11 @@ export default { return message.reply({ content: '❌ This command is reserved for the owner!', ephemeral: true }); } + // Guild only check + if (command.guildOnly && !message.guild) { + return message.reply({ content: '❌ This command only work in a server!', ephemeral: true }); + } + // Check if the bot has the needed permissions if (command.clientPermissions) { const clientMember = await message.guild.members.fetch(client.user.id);