aboutsummaryrefslogtreecommitdiff
path: root/commands
diff options
context:
space:
mode:
authorAndrew Lee <alee14498@protonmail.com>2022-03-30 16:34:24 -0400
committerAndrew Lee <alee14498@protonmail.com>2022-03-30 16:34:24 -0400
commit3f81f1086f46b8e1882ed0827483a22929330be3 (patch)
tree4bda5790eb359f53d4e5671225f38e18a1ce56b9 /commands
parentfd89e36490da711ba611c1f7c8dda93a3de054f0 (diff)
downloadDLAP-3f81f1086f46b8e1882ed0827483a22929330be3.tar.gz
DLAP-3f81f1086f46b8e1882ed0827483a22929330be3.tar.bz2
DLAP-3f81f1086f46b8e1882ed0827483a22929330be3.zip
Renamed project; Auto creates music folder when not detected; Removed audio limitation
Diffstat (limited to 'commands')
-rw-r--r--commands/about.js4
-rw-r--r--commands/control.js28
-rw-r--r--commands/help.js2
-rw-r--r--commands/join.js2
-rw-r--r--commands/list.js2
-rw-r--r--commands/ping.js2
-rw-r--r--commands/play.js4
-rw-r--r--commands/stop.js2
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
*