eximiabots-radiox/src/client/commands/next.js

23 lines
843 B
JavaScript
Raw Normal View History

2021-09-04 23:12:43 +00:00
module.exports = {
name: 'next',
description: 'Next Station',
permission: 'none',
category: 'info',
2021-09-05 00:37:03 +00:00
async execute(interaction, client, command) {
if (client.funcs.check(client, interaction, command)) {
const radio = client.radio.get(interaction.guild.id);
2021-09-05 01:42:11 +00:00
let station = client.stations[client.stations.findIndex(station => station.name == radio.station.name) + 1];
client.funcs.statisticsUpdate(client, interaction.guild, radio);
radio.audioPlayer.stop();
let date = new Date();
radio.station = station;
radio.textChannel = interaction.channel;
radio.startTime = date.getTime();
client.funcs.play(interaction, interaction.guild, client, url);
return;
2021-09-04 23:12:43 +00:00
}
}
}