ownerOnly commands
This commit is contained in:
parent
4530b265e7
commit
ce945612da
1 changed files with 11 additions and 1 deletions
|
@ -1,5 +1,10 @@
|
|||
import db from '../../models/index.js';
|
||||
const ratelimit = {};
|
||||
|
||||
import dotenv from 'dotenv';
|
||||
dotenv.config();
|
||||
const { ownerId } = process.env;
|
||||
|
||||
export default {
|
||||
name: 'interactionCreate',
|
||||
async execute(interaction) {
|
||||
|
@ -20,10 +25,15 @@ export default {
|
|||
const commandName = interaction.commandName;
|
||||
|
||||
const command = client.commands.get(commandName);
|
||||
console.log(`\x1b[33m${userTag} (${userID})\x1b[0m launched command \x1b[33m${commandName}\x1b[0m`);
|
||||
|
||||
if (!command) return;
|
||||
|
||||
console.log(`\x1b[33m${userTag} (${userID})\x1b[0m launched command \x1b[33m${commandName}\x1b[0m`);
|
||||
|
||||
if (command.ownerOnly && interaction.user.id !== ownerId) {
|
||||
return interaction.reply({ content: '❌ This command is reserved for the owner!', ephemeral: true });
|
||||
}
|
||||
|
||||
try {
|
||||
const date = new Date();
|
||||
if (ratelimit[userID]) {
|
||||
|
|
Loading…
Reference in a new issue