mirror of
https://github.com/warengroup/eximiabots-radiox.git
synced 2024-12-23 05:13:17 +00:00
Updated next command
This commit is contained in:
parent
8fdcdd0116
commit
dfada15b00
@ -6,7 +6,20 @@ module.exports = {
|
|||||||
async execute(interaction, client, command) {
|
async execute(interaction, client, command) {
|
||||||
if (client.funcs.check(client, interaction, command)) {
|
if (client.funcs.check(client, interaction, command)) {
|
||||||
const radio = client.radio.get(interaction.guild.id);
|
const radio = client.radio.get(interaction.guild.id);
|
||||||
let station = client.stations[client.stations.findIndex(station => station.name == radio.station.name) + 1];
|
|
||||||
|
let index = client.stations.findIndex(station => station.name == radio.station.name) + 1;
|
||||||
|
if(index == client.stations.length) index = 0;
|
||||||
|
|
||||||
|
let station = client.stations[index];
|
||||||
|
|
||||||
|
if(!station) return interaction.reply({
|
||||||
|
content: client.messageEmojis["error"] + client.messages.noSearchResults,
|
||||||
|
ephemeral: true
|
||||||
|
});
|
||||||
|
|
||||||
|
interaction.deferUpdate();
|
||||||
|
|
||||||
|
let url = station.stream[station.stream.default];
|
||||||
|
|
||||||
client.funcs.statisticsUpdate(client, interaction.guild, radio);
|
client.funcs.statisticsUpdate(client, interaction.guild, radio);
|
||||||
radio.audioPlayer.stop();
|
radio.audioPlayer.stop();
|
||||||
@ -15,9 +28,8 @@ module.exports = {
|
|||||||
radio.station = station;
|
radio.station = station;
|
||||||
radio.textChannel = interaction.channel;
|
radio.textChannel = interaction.channel;
|
||||||
radio.startTime = date.getTime();
|
radio.startTime = date.getTime();
|
||||||
client.funcs.play(interaction, interaction.guild, client, url);
|
client.funcs.play(null, interaction.guild, client, url);
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user