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';
|
import db from '../../models/index.js';
|
||||||
const ratelimit = {};
|
const ratelimit = {};
|
||||||
|
|
||||||
|
import dotenv from 'dotenv';
|
||||||
|
dotenv.config();
|
||||||
|
const { ownerId } = process.env;
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'interactionCreate',
|
name: 'interactionCreate',
|
||||||
async execute(interaction) {
|
async execute(interaction) {
|
||||||
|
@ -20,10 +25,15 @@ export default {
|
||||||
const commandName = interaction.commandName;
|
const commandName = interaction.commandName;
|
||||||
|
|
||||||
const command = client.commands.get(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;
|
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 {
|
try {
|
||||||
const date = new Date();
|
const date = new Date();
|
||||||
if (ratelimit[userID]) {
|
if (ratelimit[userID]) {
|
||||||
|
|
Loading…
Reference in a new issue