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

23 lines
826 B
JavaScript
Raw Normal View History

2021-09-04 23:12:43 +00:00
module.exports = {
2021-09-04 23:54:56 +00:00
name: 'prev',
2021-09-04 23:12:43 +00:00
description: 'Previous Station',
permission: 'none',
category: 'info',
async execute(interaction, client) {
2021-09-05 00:37:03 +00:00
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
}
}
}