feat(commmands/administration): Update the log command's permission check to use the isOwner function
This commit is contained in:
parent
0c081a7ace
commit
dde23bf13a
1 changed files with 4 additions and 3 deletions
|
|
@ -16,6 +16,7 @@ import {
|
||||||
import emoji from '../../../assets/emoji.json' assert { type: 'json' };
|
import emoji from '../../../assets/emoji.json' assert { type: 'json' };
|
||||||
import { Guild, User } from '@prisma/client';
|
import { Guild, User } from '@prisma/client';
|
||||||
import { log } from '@lib/log';
|
import { log } from '@lib/log';
|
||||||
|
import { isOwner } from '@lib/perm.js';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
|
|
@ -106,7 +107,7 @@ export default {
|
||||||
|
|
||||||
switch (choice) {
|
switch (choice) {
|
||||||
case 'logs_show': {
|
case 'logs_show': {
|
||||||
if (!userData.isOwner) {
|
if (!await isOwner(interaction.user.id)) {
|
||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
content: `${emoji.answer.no} | This command is only for owner`,
|
content: `${emoji.answer.no} | This command is only for owner`,
|
||||||
flags: MessageFlags.Ephemeral,
|
flags: MessageFlags.Ephemeral,
|
||||||
|
|
@ -143,7 +144,7 @@ export default {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
case 'logs_auto': {
|
case 'logs_auto': {
|
||||||
if (!userData.isOwner) {
|
if (!await isOwner(interaction.user.id)) {
|
||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
content: `${emoji.answer.no} | This command is only for owner`,
|
content: `${emoji.answer.no} | This command is only for owner`,
|
||||||
flags: MessageFlags.Ephemeral,
|
flags: MessageFlags.Ephemeral,
|
||||||
|
|
@ -319,7 +320,7 @@ export default {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'logs_disable': {
|
case 'logs_disable': {
|
||||||
if (!userData.isOwner) {
|
if (!await isOwner(interaction.user.id)) {
|
||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
content: `${emoji.answer.no} | This command is only for owner`,
|
content: `${emoji.answer.no} | This command is only for owner`,
|
||||||
flags: MessageFlags.Ephemeral,
|
flags: MessageFlags.Ephemeral,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue