From e5c86859e4c6a9a6829bcc2e3cf626b05a873ff7 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Tue, 20 Dec 2022 17:54:56 -0500 Subject: Revamped next/previous cmds (Voting system); Basic i18n support; --- Commands/shutdown.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Commands/shutdown.js') diff --git a/Commands/shutdown.js b/Commands/shutdown.js index d97922c..eefbab3 100644 --- a/Commands/shutdown.js +++ b/Commands/shutdown.js @@ -21,14 +21,14 @@ import { SlashCommandBuilder } from 'discord.js'; import { stopBot } from '../AudioBackend/Shutdown.js'; -import { PermissionFlagsBits } from 'discord-api-types/v10'; - +import { readFileSync } from 'node:fs'; +const { ownerID } = JSON.parse(readFileSync('./config.json', 'utf-8')); export default { data: new SlashCommandBuilder() .setName('shutdown') - .setDescription('Powers off the bot') - .setDefaultMemberPermissions(PermissionFlagsBits.Administrator), + .setDescription('Powers off the bot'), async execute(interaction, bot) { + if (interaction.user.id !== ownerID) return interaction.reply({ content: 'You need to be the creator of this bot to execute this command', ephemeral: true }); await interaction.reply({ content: 'Powering off...', ephemeral: true }); return await stopBot(bot, interaction); } -- cgit v1.2.3