mirror of
https://github.com/warengroup/eximiabots-radiox.git
synced 2024-12-23 06:33:18 +00:00
Updated restoreradio.js
This commit is contained in:
parent
3b0f8068c1
commit
2d9b0ce732
@ -13,6 +13,10 @@ module.exports = {
|
|||||||
let state = client.funcs.loadState(client, guild);
|
let state = client.funcs.loadState(client, guild);
|
||||||
if(!state) return;
|
if(!state) return;
|
||||||
if(!state.station || !state.channels.voice || !state.channels.text) return;
|
if(!state.station || !state.channels.voice || !state.channels.text) return;
|
||||||
|
let voiceChannel = client.channels.cache.get(state.channels.voice);
|
||||||
|
if(!voiceChannel) return;
|
||||||
|
if(voiceChannel.members.size === 0) return;
|
||||||
|
|
||||||
|
|
||||||
const sstation = await client.funcs.searchStation(state.station.name, client);
|
const sstation = await client.funcs.searchStation(state.station.name, client);
|
||||||
let url = sstation.stream[sstation.stream.default];
|
let url = sstation.stream[sstation.stream.default];
|
||||||
@ -29,7 +33,6 @@ module.exports = {
|
|||||||
client.radio.set(guild.id, construct);
|
client.radio.set(guild.id, construct);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
let voiceChannel = client.channels.cache.get(state.channels.voice);
|
|
||||||
const connection =
|
const connection =
|
||||||
getVoiceConnection(guild.id) ??
|
getVoiceConnection(guild.id) ??
|
||||||
joinVoiceChannel({
|
joinVoiceChannel({
|
||||||
|
Loading…
Reference in New Issue
Block a user