From 4360b33f79b1bec8c959426e1a092a39d12de31f Mon Sep 17 00:00:00 2001 From: Legonzaur Date: Fri, 16 Jun 2023 22:38:59 +0200 Subject: [PATCH] set forceload availabe to owner only --- src/commands/forceload.ts | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/commands/forceload.ts b/src/commands/forceload.ts index 32c6a66..98de50b 100644 --- a/src/commands/forceload.ts +++ b/src/commands/forceload.ts @@ -1,10 +1,10 @@ import { type CommandInteraction, SlashCommandBuilder, - type GuildMember, ActivityType } from 'discord.js' -import { checkMemberPermissions, execute, insertGoob } from '../db' +import { execute, insertGoob } from '../db' +import { owner_id } from '../config.json' module.exports = { data: new SlashCommandBuilder() @@ -27,10 +27,18 @@ module.exports = { return } - if (!(await checkMemberPermissions(member as GuildMember)).delete) { - await interaction.reply({ content: "I am sorry dave, I cannot do that\nYou don't have the permission to manage roles on this server. You muse have the **delete** permission", ephemeral: true }) + if (interaction.user.id !== owner_id) { + await interaction.reply({ + content: 'You do not have access to this command!', + ephemeral: true + }) return } + + // if (!(await checkMemberPermissions(member as GuildMember)).delete) { + // await interaction.reply({ content: "I am sorry dave, I cannot do that\nYou don't have the permission to manage roles on this server. You muse have the **delete** permission", ephemeral: true }) + // return + // } const messageId = interaction.options.get('messageid')?.value if (messageId === undefined) { void interaction.reply({ content: 'Something went wrong : messageid null', ephemeral: true })