diff options
Diffstat (limited to 'commands')
| -rw-r--r-- | commands/about.js | 2 | ||||
| -rw-r--r-- | commands/join.js | 2 | ||||
| -rw-r--r-- | commands/leave.js | 2 | ||||
| -rw-r--r-- | commands/next.js | 3 | ||||
| -rw-r--r-- | commands/pause.js | 5 | ||||
| -rw-r--r-- | commands/play.js | 7 | ||||
| -rw-r--r-- | commands/previous.js | 2 | ||||
| -rw-r--r-- | commands/reshuffle.js | 5 | ||||
| -rw-r--r-- | commands/shutdown.js | 2 | ||||
| -rw-r--r-- | commands/status.js | 5 |
10 files changed, 19 insertions, 16 deletions
diff --git a/commands/about.js b/commands/about.js index 442cb48..e102a3e 100644 --- a/commands/about.js +++ b/commands/about.js @@ -39,7 +39,7 @@ export default { // { name: 'Forked by', value: '[your name] (discord#0000)' }, { name: 'Frameworks', value: `Discord.JS ${version} + Voice` }, { name: 'License', value: 'GNU General Public License v3.0' } - ) + ) .setFooter({ text: '© Copyright 2020-2022 Andrew Lee' }) .setColor('#0066ff'); diff --git a/commands/join.js b/commands/join.js index 7294724..c5f686d 100644 --- a/commands/join.js +++ b/commands/join.js @@ -20,7 +20,7 @@ ***************************************************************************/ import { SlashCommandBuilder } from 'discord.js'; -import { voiceInit } from '../AudioBackend.js'; +import { voiceInit } from '../backend/VoiceInitialization.js'; import { PermissionFlagsBits } from 'discord-api-types/v10'; export default { diff --git a/commands/leave.js b/commands/leave.js index 10634af..781bc0a 100644 --- a/commands/leave.js +++ b/commands/leave.js @@ -20,7 +20,7 @@ ***************************************************************************/ import { SlashCommandBuilder } from 'discord.js'; -import { destroyAudio } from '../AudioBackend.js'; +import { destroyAudio } from '../backend/Shutdown.js'; import { PermissionFlagsBits } from 'discord-api-types/v10'; export default { diff --git a/commands/next.js b/commands/next.js index 01c5df9..b507cd1 100644 --- a/commands/next.js +++ b/commands/next.js @@ -20,7 +20,8 @@ ***************************************************************************/ import { SlashCommandBuilder } from 'discord.js'; -import { player, nextAudio } from '../AudioBackend.js'; +import { player } from '../backend/VoiceInitialization.js'; +import { nextAudio } from '../backend/AudioControl.js'; import { PermissionFlagsBits } from 'discord-api-types/v10'; export default { diff --git a/commands/pause.js b/commands/pause.js index dffcfb5..d5d8edc 100644 --- a/commands/pause.js +++ b/commands/pause.js @@ -20,7 +20,7 @@ ***************************************************************************/ import { SlashCommandBuilder } from 'discord.js'; -import { audioState, isAudioStatePaused, player } from '../AudioBackend.js'; +import { toggleAudioState, isAudioStatePaused } from '../backend/AudioControl.js'; import { PermissionFlagsBits } from 'discord-api-types/v10'; export default { @@ -30,8 +30,7 @@ export default { .setDefaultMemberPermissions(PermissionFlagsBits.Administrator), async execute(interaction) { if (isAudioStatePaused === false) { - audioState(); - player.pause(); + toggleAudioState(); return await interaction.reply({ content: 'Pausing music', ephemeral: true }); } else { return await interaction.reply({ content: 'Music is already paused', ephemeral: true }); diff --git a/commands/play.js b/commands/play.js index f9701f7..fd8132c 100644 --- a/commands/play.js +++ b/commands/play.js @@ -20,7 +20,9 @@ ***************************************************************************/ import { SlashCommandBuilder } from 'discord.js'; -import { isAudioStatePaused, inputAudio, audio, audioState, player, files } from '../AudioBackend.js'; +import { inputAudio } from '../backend/QueueSystem.js'; +import { files, isAudioStatePaused, toggleAudioState } from '../backend/AudioControl.js'; +import { audio } from '../backend/PlayAudio.js'; import { PermissionFlagsBits } from 'discord-api-types/v10'; export let integer; @@ -46,8 +48,7 @@ export default { } } if (isAudioStatePaused === true) { - audioState(); - player.unpause(); + toggleAudioState(); return await interaction.reply({ content: 'Resuming music', ephemeral: true }); } else { return await interaction.reply({ content: 'Music is already playing', ephemeral: true }); diff --git a/commands/previous.js b/commands/previous.js index 2bb8960..6d5eff3 100644 --- a/commands/previous.js +++ b/commands/previous.js @@ -20,7 +20,7 @@ ***************************************************************************/ import { SlashCommandBuilder } from 'discord.js'; -import { previousAudio } from '../AudioBackend.js'; +import { previousAudio } from '../backend/AudioControl.js'; import { PermissionFlagsBits } from 'discord-api-types/v10'; export default { diff --git a/commands/reshuffle.js b/commands/reshuffle.js index 8de2d17..517c272 100644 --- a/commands/reshuffle.js +++ b/commands/reshuffle.js @@ -20,11 +20,12 @@ ***************************************************************************/ import { SlashCommandBuilder } from 'discord.js'; -import { player, shufflePlaylist } from '../AudioBackend.js'; +import { player } from '../backend/VoiceInitialization.js'; +import { shufflePlaylist } from '../backend/QueueSystem.js'; import { PermissionFlagsBits } from 'discord-api-types/v10'; import { readFileSync } from 'node:fs'; // import config from './config.json' assert {type: 'json'} -const { shuffle } = JSON.parse(readFileSync('./config.json')); +const { shuffle } = JSON.parse(readFileSync('./config.json', 'utf-8')); export default { data: new SlashCommandBuilder() diff --git a/commands/shutdown.js b/commands/shutdown.js index 0cf75b8..313866b 100644 --- a/commands/shutdown.js +++ b/commands/shutdown.js @@ -20,7 +20,7 @@ ***************************************************************************/ import { SlashCommandBuilder } from 'discord.js'; -import { stopBot } from '../AudioBackend.js'; +import { stopBot } from '../backend/Shutdown.js'; import { PermissionFlagsBits } from 'discord-api-types/v10'; export default { diff --git a/commands/status.js b/commands/status.js index 958a359..3143e16 100644 --- a/commands/status.js +++ b/commands/status.js @@ -21,7 +21,8 @@ import { EmbedBuilder, SlashCommandBuilder } from 'discord.js'; import { parseFile } from 'music-metadata'; -import { audio, currentTrack, files, playerState, audioTitle, metadataEmpty, duration } from '../AudioBackend.js'; +import { audio, metadataEmpty, duration, audioTitle, currentTrack } from '../backend/PlayAudio.js'; +import { files, playerState } from '../backend/AudioControl.js'; export default { data: new SlashCommandBuilder() @@ -54,7 +55,7 @@ export default { { name: 'State', value: playerState }, { name: 'Tracks', value: `${audioID}/${files.length}` }, { name: 'Duration', value: duration } - ) + ) .setColor('#0066ff'); if (metadataEmpty === true) { |
