forked from Supositware/Haha-Yes
guildOnly check
This commit is contained in:
parent
408176cc9d
commit
780aef27c5
2 changed files with 10 additions and 0 deletions
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue