diff options
Diffstat (limited to 'commands')
| -rw-r--r-- | commands/about.js | 4 | ||||
| -rw-r--r-- | commands/control.js | 28 | ||||
| -rw-r--r-- | commands/help.js | 2 | ||||
| -rw-r--r-- | commands/join.js | 2 | ||||
| -rw-r--r-- | commands/list.js | 2 | ||||
| -rw-r--r-- | commands/ping.js | 2 | ||||
| -rw-r--r-- | commands/play.js | 4 | ||||
| -rw-r--r-- | commands/stop.js | 2 |
8 files changed, 24 insertions, 22 deletions
diff --git a/commands/about.js b/commands/about.js index 55ef011..bd54e25 100644 --- a/commands/about.js +++ b/commands/about.js @@ -1,6 +1,6 @@ /************************************************************************** * - * DLMP3 Bot: A Discord bot that plays local MP3 audio tracks. + * DLAP Bot: A Discord bot that plays local audio tracks. * (C) Copyright 2022 * Programmed by Andrew Lee * @@ -21,6 +21,7 @@ import { SlashCommandBuilder } from '@discordjs/builders' import { MessageEmbed, version, MessageActionRow, MessageButton } from 'discord.js' +import npmPackage from '../package.json' assert { type:'json' } export default { data: new SlashCommandBuilder() @@ -30,6 +31,7 @@ export default { const aboutEmbed = new MessageEmbed() .setAuthor({name:`About ${bot.user.username}`, iconURL:bot.user.avatarURL()}) .addField('Information', 'A Discord bot that plays local MP3 audio tracks.') + .addField('Version', npmPackage.version) .addField('Original Creator', 'Andrew Lee (Alee#4277)') //.addField('Contributors', '[your name] (discord#0000)') //.addField('Forked by', '[your name] (discord#0000)') diff --git a/commands/control.js b/commands/control.js index f221898..83f603f 100644 --- a/commands/control.js +++ b/commands/control.js @@ -1,6 +1,6 @@ /************************************************************************** * - * DLMP3 Bot: A Discord bot that plays local MP3 audio tracks. + * DLAP Bot: A Discord bot that plays local audio tracks. * (C) Copyright 2022 * Programmed by Andrew Lee * @@ -21,7 +21,7 @@ import { SlashCommandBuilder } from '@discordjs/builders' import { MessageEmbed, MessageActionRow, MessageButton } from 'discord.js' -import {audio, player, destroyAudio, voiceInit, stopBot, searchAudio} from '../AudioBackend.js' +import { audio, player, destroyAudio, voiceInit, stopBot, searchAudio } from '../AudioBackend.js' import config from '../config.json' assert {type: 'json'} export let controlEmbed @@ -42,11 +42,11 @@ export default { const controlButtons = new MessageActionRow() .addComponents( new MessageButton() - .setStyle('SECONDARY') + .setStyle('SUCCESS') .setLabel('Join') .setCustomId('join'), new MessageButton() - .setStyle('SUCCESS') + .setStyle('PRIMARY') .setLabel('Play') .setCustomId('play'), new MessageButton() @@ -54,7 +54,7 @@ export default { .setLabel('Pause') .setCustomId('pause'), new MessageButton() - .setStyle('DANGER') + .setStyle('SECONDARY') .setLabel('Skip') .setCustomId('skip'), new MessageButton() @@ -86,35 +86,35 @@ export default { collector.on('collect', async ctlButton => { if (ctlButton.customId === 'join') { await ctlButton.reply({content:'Joining voice channel', ephemeral:true}) - await voiceInit(bot); + return await voiceInit(bot); } if (ctlButton.customId === 'play') { await ctlButton.reply({content:'Resuming music', ephemeral:true}) - player.unpause(); + return player.unpause(); } if (ctlButton.customId === 'pause') { await ctlButton.reply({content:'Pausing music', ephemeral:true}) - player.pause(); + return player.pause(); } if (ctlButton.customId === 'skip') { await ctlButton.reply({content:`Skipping \`${audio}\`...`, ephemeral:true}) - player.pause(); - await searchAudio(bot); + player.stop(); + return await searchAudio(bot); } if (ctlButton.customId === 'next') { - await interaction.editReply({ components: [controlButtons2] }); + return await interaction.editReply({ components: [controlButtons2] }); } if (ctlButton.customId === 'back') { - await interaction.editReply({ components: [controlButtons] }); + return await interaction.editReply({ components: [controlButtons] }); } if (ctlButton.customId === 'leave') { await ctlButton.reply({content:'Leaving voice channel.', ephemeral:true}) console.log('Leaving voice channel...'); - destroyAudio(interaction); + return destroyAudio(interaction); } if (ctlButton.customId === 'stop') { await ctlButton.reply({content:'Powering off...', ephemeral:true}) - await stopBot(bot, interaction); + return await stopBot(bot, interaction); } }); diff --git a/commands/help.js b/commands/help.js index e23b105..291f5fe 100644 --- a/commands/help.js +++ b/commands/help.js @@ -1,6 +1,6 @@ /************************************************************************** * - * DLMP3 Bot: A Discord bot that plays local MP3 audio tracks. + * DLAP Bot: A Discord bot that plays local audio tracks. * (C) Copyright 2022 * Programmed by Andrew Lee * diff --git a/commands/join.js b/commands/join.js index 72aae2e..0de2f14 100644 --- a/commands/join.js +++ b/commands/join.js @@ -1,6 +1,6 @@ /************************************************************************** * - * DLMP3 Bot: A Discord bot that plays local MP3 audio tracks. + * DLAP Bot: A Discord bot that plays local audio tracks. * (C) Copyright 2022 * Programmed by Andrew Lee * diff --git a/commands/list.js b/commands/list.js index 673b779..2b81acb 100644 --- a/commands/list.js +++ b/commands/list.js @@ -1,6 +1,6 @@ /************************************************************************** * - * DLMP3 Bot: A Discord bot that plays local MP3 audio tracks. + * DLAP Bot: A Discord bot that plays local audio tracks. * (C) Copyright 2022 * Programmed by Andrew Lee * diff --git a/commands/ping.js b/commands/ping.js index 14071ac..fc25135 100644 --- a/commands/ping.js +++ b/commands/ping.js @@ -1,6 +1,6 @@ /************************************************************************** * - * DLMP3 Bot: A Discord bot that plays local MP3 audio tracks. + * DLAP Bot: A Discord bot that plays local audio tracks. * (C) Copyright 2022 * Programmed by Andrew Lee * diff --git a/commands/play.js b/commands/play.js index df5be96..f53ac21 100644 --- a/commands/play.js +++ b/commands/play.js @@ -1,6 +1,6 @@ /************************************************************************** * - * DLMP3 Bot: A Discord bot that plays local MP3 audio tracks. + * DLAP Bot: A Discord bot that plays local audio tracks. * (C) Copyright 2022 * Programmed by Andrew Lee * @@ -32,7 +32,7 @@ export default { .addIntegerOption(option => option.setName('int') .setDescription('Input a number for the selection for the audio file.') - .setRequired(true), + .setRequired(false), ), 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 }); diff --git a/commands/stop.js b/commands/stop.js index c753a1b..ced8fe5 100644 --- a/commands/stop.js +++ b/commands/stop.js @@ -1,6 +1,6 @@ /************************************************************************** * - * DLMP3 Bot: A Discord bot that plays local MP3 audio tracks. + * DLAP Bot: A Discord bot that plays local audio tracks. * (C) Copyright 2022 * Programmed by Andrew Lee * |
