From 3fc28a79cb65ae15d056f6460f84e92f1a3693cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Sun, 5 Sep 2021 02:39:59 +0300 Subject: [PATCH] Moved createAudioResource from discord.js/voice to play function --- src/client/commands/play.js | 3 +-- src/client/funcs/play.js | 4 ++++ src/client/restoreradio.js | 1 - 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/client/commands/play.js b/src/client/commands/play.js index b4fece3..041e9ad 100644 --- a/src/client/commands/play.js +++ b/src/client/commands/play.js @@ -1,6 +1,5 @@ const { createAudioPlayer, - createAudioResource, getVoiceConnection, joinVoiceChannel } = require("@discordjs/voice"); @@ -141,7 +140,7 @@ module.exports = { radio.station = station; radio.textChannel = interaction.channel; radio.startTime = date.getTime(); - play(interaction, interaction.guild, client, url, Discord); + client.funcs.play(interaction, interaction.guild, client, url, Discord); return; } diff --git a/src/client/funcs/play.js b/src/client/funcs/play.js index 8b4c764..83f9729 100644 --- a/src/client/funcs/play.js +++ b/src/client/funcs/play.js @@ -1,3 +1,7 @@ +const { + createAudioResource +} = require("@discordjs/voice"); + module.exports = async function play(interaction, guild, client, url, Discord) { let message = {}; const radio = client.radio.get(guild.id); diff --git a/src/client/restoreradio.js b/src/client/restoreradio.js index 982bc87..4916bbc 100644 --- a/src/client/restoreradio.js +++ b/src/client/restoreradio.js @@ -1,7 +1,6 @@ import Discord from "discord.js"; const { createAudioPlayer, - createAudioResource, getVoiceConnection, joinVoiceChannel } = require("@discordjs/voice");