diff options
| author | Andrew Lee <alee14498@protonmail.com> | 2022-03-29 00:03:42 -0400 |
|---|---|---|
| committer | Andrew Lee <alee14498@protonmail.com> | 2022-03-29 00:03:42 -0400 |
| commit | 18f0b9d60c44f69fad6eb4716659c79f08f46711 (patch) | |
| tree | 9f18c1753bfb3fd695a0cc26068d3dc1515cb153 /commands | |
| parent | 08aae8cd9e5417bd7451b9af2e3190bf9c6a4e43 (diff) | |
| download | DLAP-18f0b9d60c44f69fad6eb4716659c79f08f46711.tar.gz DLAP-18f0b9d60c44f69fad6eb4716659c79f08f46711.tar.bz2 DLAP-18f0b9d60c44f69fad6eb4716659c79f08f46711.zip | |
Permission system on certain commands
Diffstat (limited to 'commands')
| -rw-r--r-- | commands/control.js | 3 | ||||
| -rw-r--r-- | commands/join.js | 2 | ||||
| -rw-r--r-- | commands/list.js | 6 | ||||
| -rw-r--r-- | commands/stop.js | 1 |
4 files changed, 8 insertions, 4 deletions
diff --git a/commands/control.js b/commands/control.js index b3dd0bf..28c3aad 100644 --- a/commands/control.js +++ b/commands/control.js @@ -30,8 +30,9 @@ export default { .setName('control') .setDescription('Controlling the music'), async execute(interaction, bot) { + if (![config.botOwner].includes(interaction.user.id)) return await interaction.reply({ content: "You do not have permissions to execute this command.", ephemeral: true }); const controlEmbed = new MessageEmbed() - .setAuthor({name:`${bot.user.username} Control Panel`, iconURL:bot.user.avatarURL()}) + .setAuthor({name: `${bot.user.username} Control Panel`, iconURL: bot.user.avatarURL()}) .addField('State', 'Playing') .addField('Currently Playing', audio) //.addField('Next Music', '(a possible feature when queue system is implemented?)') diff --git a/commands/join.js b/commands/join.js index 45f513c..8778aae 100644 --- a/commands/join.js +++ b/commands/join.js @@ -21,12 +21,14 @@ import { SlashCommandBuilder } from '@discordjs/builders' import { voiceInit } from "../AudioBackend.js"; +import config from '../config.json' assert {type: 'json'} export default { data: new SlashCommandBuilder() .setName('join') .setDescription('Joins voice chat.'), async execute(interaction, bot) { + if (![config.botOwner].includes(interaction.user.id)) return await interaction.reply({ content: "You do not have permissions to execute this command.", ephemeral: true }); await interaction.reply('Joining voice channel') voiceInit(bot); }, diff --git a/commands/list.js b/commands/list.js index 00c984e..4ec7156 100644 --- a/commands/list.js +++ b/commands/list.js @@ -29,9 +29,9 @@ export default { .setName('list') .setDescription('Lists the available audio tracks'), async execute(interaction) { - /* + interaction.reply('Listing the available audio tracks...'); fs.readdirSync(musicFolder).forEach(file => { - return interaction.reply('Listing the available audio tracks...\n' + file); - });*/ + console.log(file); + }); }, };
\ No newline at end of file diff --git a/commands/stop.js b/commands/stop.js index 3059997..62f4b1a 100644 --- a/commands/stop.js +++ b/commands/stop.js @@ -29,6 +29,7 @@ export default { .setName('stop') .setDescription('Powers off the bot'), async execute(interaction, bot) { + if (![config.botOwner].includes(interaction.user.id)) return await interaction.reply({ content: "You do not have permissions to execute this command.", ephemeral: true }); await interaction.reply('Powering off...') const statusEmbed = new MessageEmbed() |
