aboutsummaryrefslogtreecommitdiff
path: root/commands
diff options
context:
space:
mode:
Diffstat (limited to 'commands')
-rw-r--r--commands/play.js10
-rw-r--r--commands/shutdown.js (renamed from commands/stop.js)2
-rw-r--r--commands/skip.js4
-rw-r--r--commands/status.js6
4 files changed, 14 insertions, 8 deletions
diff --git a/commands/play.js b/commands/play.js
index 2785288..d206c56 100644
--- a/commands/play.js
+++ b/commands/play.js
@@ -20,7 +20,7 @@
***************************************************************************/
import { SlashCommandBuilder } from '@discordjs/builders'
-import { isAudioStatePaused, inputAudio, audio, audioState, player } from '../AudioBackend.js'
+import { isAudioStatePaused, inputAudio, audio, audioState, player, files } from '../AudioBackend.js'
import { PermissionFlagsBits } from "discord-api-types/v10"
export let integer;
@@ -38,8 +38,12 @@ export default {
async execute(interaction, bot) {
integer = interaction.options.getInteger('int');
if (integer) {
- await inputAudio(bot, integer);
- return await interaction.reply({ content: `Now playing: ${audio}`, ephemeral: true });
+ if (integer < files.length) {
+ await inputAudio(bot, integer);
+ return await interaction.reply({content:`Now playing: ${audio}`, ephemeral:true});
+ } else {
+ return await interaction.reply({content:'Number is too big, choose a number that\'s less than ' + files.length + '.', ephemeral:true})
+ }
}
if (isAudioStatePaused === true) {
audioState();
diff --git a/commands/stop.js b/commands/shutdown.js
index c57301e..4c32bc6 100644
--- a/commands/stop.js
+++ b/commands/shutdown.js
@@ -25,7 +25,7 @@ import { PermissionFlagsBits } from "discord-api-types/v10"
export default {
data: new SlashCommandBuilder()
- .setName('stop')
+ .setName('shutdown')
.setDescription('Powers off the bot')
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator),
async execute(interaction, bot) {
diff --git a/commands/skip.js b/commands/skip.js
index 3e1a836..3003ca0 100644
--- a/commands/skip.js
+++ b/commands/skip.js
@@ -20,7 +20,7 @@
***************************************************************************/
import { SlashCommandBuilder } from '@discordjs/builders'
-import { audio, player, searchAudio } from "../AudioBackend.js"
+import { audio, player, nextAudio } from "../AudioBackend.js"
import { PermissionFlagsBits } from "discord-api-types/v10"
export default {
@@ -31,6 +31,6 @@ export default {
async execute(interaction, bot) {
await interaction.reply({content:`Skipping ${audio}`, ephemeral:true});
player.stop();
- return await searchAudio(bot, interaction);
+ return await nextAudio(bot, interaction);
},
}; \ No newline at end of file
diff --git a/commands/status.js b/commands/status.js
index d7012ce..e012239 100644
--- a/commands/status.js
+++ b/commands/status.js
@@ -21,18 +21,20 @@
import { SlashCommandBuilder } from '@discordjs/builders'
import { MessageEmbed } from "discord.js"
-import { audio, playerState } from "../AudioBackend.js"
+import {audio, audioArray, currentTrack, playerState} from "../AudioBackend.js"
export default {
data: new SlashCommandBuilder()
.setName('status')
.setDescription('Checks what audio file is playing currently'),
async execute(interaction, bot) {
+ let nextAudio = currentTrack
+ nextAudio++
let controlEmbed = new MessageEmbed()
.setAuthor({name: `${bot.user.username} Status`, iconURL: bot.user.avatarURL()})
.addField('State', playerState)
.addField('Currently Playing', audio)
- //.addField('Next Music', '(a possible feature when queue system is implemented?)')
+ .addField('Next Music', audioArray[nextAudio])
.setColor('#0066ff')
interaction.reply({embeds:[controlEmbed], ephemeral:true})
},