diff options
| author | Andrew Lee <alee14498@protonmail.com> | 2022-07-06 05:56:09 -0400 |
|---|---|---|
| committer | Andrew Lee <alee14498@protonmail.com> | 2022-07-06 05:56:09 -0400 |
| commit | cd5be9de38b9be071e7e47d27061cf62031dff62 (patch) | |
| tree | 818efc28811ac0d2226cb3d1c3b90b187c698a34 /commands | |
| parent | 1e294d91c3eab7e65936010c8f0c81c4c4f73b96 (diff) | |
| download | DLAP-cd5be9de38b9be071e7e47d27061cf62031dff62.tar.gz DLAP-cd5be9de38b9be071e7e47d27061cf62031dff62.tar.bz2 DLAP-cd5be9de38b9be071e7e47d27061cf62031dff62.zip | |
Cleaning up some stuff; Deprecating botOwner as Admin is required for commands
Diffstat (limited to 'commands')
| -rw-r--r-- | commands/join.js | 7 | ||||
| -rw-r--r-- | commands/leave.js | 6 | ||||
| -rw-r--r-- | commands/pause.js | 7 | ||||
| -rw-r--r-- | commands/play.js | 7 | ||||
| -rw-r--r-- | commands/skip.js | 6 | ||||
| -rw-r--r-- | commands/status.js | 4 | ||||
| -rw-r--r-- | commands/stop.js | 7 |
7 files changed, 26 insertions, 18 deletions
diff --git a/commands/join.js b/commands/join.js index 8ede21a..42f3e1c 100644 --- a/commands/join.js +++ b/commands/join.js @@ -20,13 +20,14 @@ ***************************************************************************/ import { SlashCommandBuilder } from '@discordjs/builders' -import { voiceInit } from '../AudioBackend.js'; -import config from '../config.json' assert {type: 'json'} +import { voiceInit } from '../AudioBackend.js' +import { PermissionFlagsBits } from 'discord-api-types/v10' export default { data: new SlashCommandBuilder() .setName('join') - .setDescription('Joins voice chat.'), + .setDescription('Joins voice chat') + .setDefaultMemberPermissions(PermissionFlagsBits.Administrator), async execute(interaction, bot) { await interaction.reply({ content: 'Joining voice channel', ephemeral: true }) return await voiceInit(bot); diff --git a/commands/leave.js b/commands/leave.js index 5024488..63b4245 100644 --- a/commands/leave.js +++ b/commands/leave.js @@ -20,12 +20,14 @@ ***************************************************************************/ import { SlashCommandBuilder } from '@discordjs/builders' -import { destroyAudio } from "../AudioBackend.js"; +import { destroyAudio } from "../AudioBackend.js" +import { PermissionFlagsBits } from "discord-api-types/v10" export default { data: new SlashCommandBuilder() .setName('leave') - .setDescription('Leaves the voice chat'), + .setDescription('Leaves the voice chat') + .setDefaultMemberPermissions(PermissionFlagsBits.Administrator), async execute(interaction) { console.log('Leaving voice channel...'); await destroyAudio(interaction); diff --git a/commands/pause.js b/commands/pause.js index 7615573..5306f63 100644 --- a/commands/pause.js +++ b/commands/pause.js @@ -20,13 +20,14 @@ ***************************************************************************/ import { SlashCommandBuilder } from '@discordjs/builders' -import config from '../config.json' assert {type: 'json'} -import {audioState, isAudioStatePaused, player} from "../AudioBackend.js"; +import { audioState, isAudioStatePaused, player } from "../AudioBackend.js" +import { PermissionFlagsBits } from "discord-api-types/v10" export default { data: new SlashCommandBuilder() .setName('pause') - .setDescription('Pauses the player'), + .setDescription('Pauses music') + .setDefaultMemberPermissions(PermissionFlagsBits.Administrator), async execute(interaction) { if (isAudioStatePaused === false) { audioState(); diff --git a/commands/play.js b/commands/play.js index 2a5a385..2785288 100644 --- a/commands/play.js +++ b/commands/play.js @@ -21,18 +21,19 @@ import { SlashCommandBuilder } from '@discordjs/builders' import { isAudioStatePaused, inputAudio, audio, audioState, player } from '../AudioBackend.js' -import config from '../config.json' assert {type: 'json'} +import { PermissionFlagsBits } from "discord-api-types/v10" export let integer; export default { data: new SlashCommandBuilder() .setName('play') - .setDescription('Plays the player') + .setDescription('Resumes music') .addIntegerOption(option => option.setName('int') .setDescription('Input a number for the selection for the audio file.'), - ), + ) + .setDefaultMemberPermissions(PermissionFlagsBits.Administrator), async execute(interaction, bot) { integer = interaction.options.getInteger('int'); diff --git a/commands/skip.js b/commands/skip.js index a49b904..3e1a836 100644 --- a/commands/skip.js +++ b/commands/skip.js @@ -20,12 +20,14 @@ ***************************************************************************/ import { SlashCommandBuilder } from '@discordjs/builders' -import { audio, player, searchAudio } from "../AudioBackend.js"; +import { audio, player, searchAudio } from "../AudioBackend.js" +import { PermissionFlagsBits } from "discord-api-types/v10" export default { data: new SlashCommandBuilder() .setName('skip') - .setDescription('Skips the track'), + .setDescription('Skips the audio track') + .setDefaultMemberPermissions(PermissionFlagsBits.Administrator), async execute(interaction, bot) { await interaction.reply({content:`Skipping ${audio}`, ephemeral:true}); player.stop(); diff --git a/commands/status.js b/commands/status.js index 804b046..d7012ce 100644 --- a/commands/status.js +++ b/commands/status.js @@ -20,8 +20,8 @@ ***************************************************************************/ import { SlashCommandBuilder } from '@discordjs/builders' -import { MessageEmbed } from "discord.js"; -import { audio, playerState } from "../AudioBackend.js"; +import { MessageEmbed } from "discord.js" +import { audio, playerState } from "../AudioBackend.js" export default { data: new SlashCommandBuilder() diff --git a/commands/stop.js b/commands/stop.js index b3997e2..c57301e 100644 --- a/commands/stop.js +++ b/commands/stop.js @@ -20,13 +20,14 @@ ***************************************************************************/ import { SlashCommandBuilder } from '@discordjs/builders' -import config from '../config.json' assert {type: 'json'} -import { stopBot } from "../AudioBackend.js"; +import { stopBot } from "../AudioBackend.js" +import { PermissionFlagsBits } from "discord-api-types/v10" export default { data: new SlashCommandBuilder() .setName('stop') - .setDescription('Powers off the bot'), + .setDescription('Powers off the bot') + .setDefaultMemberPermissions(PermissionFlagsBits.Administrator), async execute(interaction, bot) { await interaction.reply({ content: 'Powering off...', ephemeral: true}) return await stopBot(bot, interaction); |
