From 4419d73d9779670161ebc1df2debf8c4286a9188 Mon Sep 17 00:00:00 2001 From: TheEssem Date: Fri, 5 Mar 2021 15:32:37 -0600 Subject: [PATCH] soundplayer crash prevention --- utils/soundplayer.js | 1 + 1 file changed, 1 insertion(+) diff --git a/utils/soundplayer.js b/utils/soundplayer.js index a2970e2..944c1cc 100644 --- a/utils/soundplayer.js +++ b/utils/soundplayer.js @@ -57,6 +57,7 @@ exports.connect = async () => { }; exports.play = async (sound, message, music = false) => { + if (!this.manager) return `${message.author.mention}, the sound commands are still starting up!`; if (!message.channel.guild) return `${message.author.mention}, this command only works in servers!`; if (!message.member.voiceState.channelID) return `${message.author.mention}, you need to be in a voice channel first!`; if (!message.channel.guild.members.get(client.user.id).permissions.has("voiceConnect") || !message.channel.permissionsOf(client.user.id).has("voiceConnect")) return `${message.author.mention}, I can't join this voice channel!`;